2.3. MEMORY ORGANIZATION
PIC18LF25K50 contains 32 K (0x8000) Program Flash memory, 2 K (0x0800) Data RAM memory
and 256 (0x0100) bytes Data EEPROM memory. Program Flash memory and Data RAM memory
are directly accessible, but Data EEPROM memory acts as a peripheral device, since it is
accessed through a set of control registers.
Kernel uses Data EEPROM memory as non-volatile storage for Brightness control (1 byte) and as
a buffer for data received via the infrared communication channel (255 bytes).
2.3.1. PROGRAM MEMORY ORGANIZATION
Bootloader and kernel are integrated and they are used as the main firmware module, taking
0x3300 bytes of MCU's program space. User application must start at 0x3300 and must contain
redirection vectors for HIgh Priority ISR (Interrupt Service Routine) at the address 0x3308, and
for Low Priority ISR at the address 0x3318. By default, they should contain jumps to 0x2B08,
where the ISR routine which does most of the Kernel job is located. Low Priority ISR is not used
in this version of Kernel, so it also points to the High Priority ISR, but this jump should never
happen.
Another way is to redirect those interrupt vectors to the alternative user ISR routine, located
inside the User Code area. In that case, the new ISR code should be written, or it may act as the
expansion of the existing High Priority Interrupt.
There are a few subroutines which are available to the user. One of them is a 32-bit
pseudorandom number subroutine, with the entry point at the address 0x2B04. The execution
time for this subroutine is 79 T cycles (which is 6.6 µs), including Call to this subroutine and
Return. It uses Data RAM locations 0x730...0x733 as 32-bit SEED, and locations 0x734...0x737 as
the internal arithmetic registers. At the end, before RETURN, this subroutine XORs and ADDs all
SEED bytes to produce the pseudorandom number in W register. Also, it XORs contents of
TMR0 and TMR2 Special Function Registers in a single 8-bit random result in W register.
The following drawing represents program memory organization of the bootloader, kernel and
user application.
Содержание SUPERCONFERENCE BADGE
Страница 1: ...HACKADAY SUPERCONFERENCE BADGE Pasadena 2016 Nov 5 6 Ver 1 Rev 0 ...
Страница 7: ......
Страница 14: ......