After register presetting, program erases (presets to 0x00) all data memory, using uninitialized
Data RAM to preset RND Seed registers. Four RND Seed registers are preset with random
contents, each of them by XORing 512 bytes of Data RAM before erasing.
Next, it loads the binary serial number from program memory address 0x100E (assuming that
Offset is preset to 0x1000) to data memory 2-byte location MYserial. Every badge has its unique
serial number defined in the Bootloader, but if you want to redefine it, you can just change the
kernel definition.
Next, it loads the Brightness value from internal EEPROM at address 0x00. This EEPROM
contents will be modified every time when brightness is modified by the keyboard.
Next, it loads the display text from internal EEPROM at addresses 0x01-0xFF to data RAM text
buffer at fixed addresses 0x600-0x6FE. If the first character is 0x00 or 0xFF, it loads the default
greeting message from program memory.
At last, it enables TIMER 0 interrupt and jumps to user's program at 0x3300.
Port C2 (which is used by Bootloader to blink one LED) will be left as dummy analogue input for
the whole operating time - if you define it as output it will disturb normal multiplex operation,
and if it is digital input, the voltage on this pin will be outside the allowed range.
There is also an "rnd" subroutine which is not used by kernel, but can be used by user software.
It is a 32-bit pseudorandom generator routine, which executes function SEED = SEED *
0x41 0x00006073. SEED is defined as Ma0, Ma1, Ma2 and Ma3 in data memory. It also
uses arithmetic temporary registers Mc0, Mc1, Mc2 and Mc3 in data memory. At the end, this
routine XORs or ADDs all SEED registers and TMR0 and TMR2 also, to scramble the W register
and increase its entropy, so W should be considered as 8-bit random output.
3.2. KERNEL INSIDE INTERRUPT
Interrupt nesting is disabled, so both the External Interrupt 0 (INT key) and TIMER 0 use the
same Interrupt vector 0x0008, which is redirected to 0x2B08 by the bootloader routine.
Routine first tests INTCON,INT0IF bit to determine if the interrupt was caused by INT0 (kernel
will not allow such external interrupts except inside TIMER 0 interrupt during processor
sleeping, but this test is executed in case user uses it for some purpose). By default, this is a
dummy interrupt routine, as it does nothing except reset the interrupt flag.
Содержание SUPERCONFERENCE BADGE
Страница 1: ...HACKADAY SUPERCONFERENCE BADGE Pasadena 2016 Nov 5 6 Ver 1 Rev 0 ...
Страница 7: ......
Страница 14: ......