
Chipcon
Chipcon
Chipcon
Chipcon
SmartRF
SmartRF
SmartRF
SmartRF â CC1010
Chipcon AS
SmartRFâ CC1010 PRELIMINARY Datasheet (rev. 1.0) 2002-09-18
Page 39 of 133
CC1010 is now ready to be programmed, as
described in the next section.
Programming the Flash Memory
After the initialisation is completed, SPI
programming can be performed as follows:
•
Device identity can be verified using
the Read Signature Byte instruction.
•
Perform Chip Erase.
•
Load one page into the buffer using
the Load Program Memory Page
instruction.
•
Write the buffer to Flash by using the
Write
Program
Memory
Page
instruction.
•
Repeat the loading and writing of each
new page.
•
Programming can be verified using the
Read Program Memory instruction.
•
Set the lock bits using the Write Lock
Bits instruction.
•
Lock bits can be verified by using the
Read Lock Bits instruction.
8051 Flash Programming
Each of the 256 pages (128 bytes each) in
Flash
program
memory
can
be
programmed individually from the 8051.
The 8051 must be set in Idle Mode while
programming the Flash, since it has no
access to the program memory while the
writing is in progress.
The step for writing a page to Flash is
described as follows:
•
Set the correct write cycle time,
according
to
the
current
crystal
oscillator frequency, in the FLTIM
SFR. This number is used to generate
the timing to the on-chip Flash
interface, as was also done with SPI
Flash programming. It must be set so
that:
MHz
f
MHz
f
XOSC
XOSC
4
.
0
8
.
0
≤
≤ FLTIM
•
The time used for programming a
Flash page is strongly dependent on
the setting in FLTIM. It is therefore
recommended to set FLTIM as low as
possible, as with the SPI Flash
programming.
•
Write the desired Flash page number
to the FLADR register.
•
Disable all interrupts except the Flash
/ Debug interrupt, which must be
enabled (through EICON.FDIE)
•
Store the 128 bytes of data to be
written in the external data memory.
The address of the first byte in the
bufffer must be a multiple of 128.
•
Write the 4 most significant bits of the
RAM
buffer
address
to
FLCON.RMADR(3:0)
. Also set the bit
FLCON.WRFLASH
•
Set the 8051 in Idle Mode by setting
PCON.IDLE
. The Flash page is then
autmatically erased and programmed.
The sequence of the above steps are not
important. Flash programming is started
whenever
entering
Idle
Mode
while
FLCON.WRFLASH
is set.
A Flash / Debug interrupt will be generated
when
the
page
write
operation
is
completed, which will get the 8051 out of
Idle Mode. An ISR must be present to
service the Flash / Debug interrupt.
FLADR (0xAE) - Flash Write Address Register
Bit
Name
R/W
Description
7:0
FLADR(7:0)
R/W
The number of of the Flash page to be written (8 MSB of the byte
address)