User's Manual

CRXi
µ
µµ
µ
Core Module
CR
µ
µµ
µ
X Logic,
2001 all rights reserved
9
The flash area that contains the bootloader code consists of four 8K (2000h) segments and occupies the
80C320 code space at reset. It is automatically executed at reset regardless of the state of jumper J3. User
has no access to this code space and it is write protected. The bootloader’s main function is downloading
Intel .hex format files (users code), erasing the flash, reading and writing to memory and executing user
code. Other functions were incorporated into the boot code during development. Upon receiving the ‘G’
(go) command from the bootloader or reading the state of jumper J3 on reset, the bootloader code is
disabled and is overlayed with the users code and execution will again begin at address 0000h (80C320
reset vector).
The main flash gives the user access to 128K of code space. It consists of eight 16K (4000h) segments.
Since the 80C320 (and all 8051 derivatives) can address only 64K of code a paging scheme is used to
access the additional memory. If the users code is within the 64K limit the page register is of no concern to
the user. Flash segments 0 – 3 occupy the first 64K, called page 0, and this is the default page. There are
two additional pages for a total of three pages (page 0, page 1, page 2). Each page appears to have its own
64K space, but notice the bottom 32K of each page is duplicated in each page. This is referred to as the
common area and allows all pages to access a common area of code as well as all the interrupt vectors.
Figure 2 (CRXi memory map)
Switching between pages is done by writing to the page register, location C0E0h. The lower 2 bits are
written with 0, 1 or 2. The default is page 0 – no changes need be done if code occupies less than 64K
bytes. The user can use any paging scheme desired, being aware of the issues of paging. Many commercial
compilers
5
offer paging in their packages and is easily integrated. This is sometimes done by linking in a
special file into users code to handle the page switching and other details. Some modification of the paging
code may be needed.
NOTE: Care must be taken when writing to the page register. The upper bits of the page register are
reserved for internal use and must not be overwritten. Some commercial compiler vendors may not
protect unused bits in the page register – all writes to this register should be done via a mask to protect
these bits.