background image

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 ...

Страница 2: ...ouple of pre programmed applications mainly to demonstrate some of the possibilities of the hardware By default there is a Tetris game a moving message display and an accelerometer demo There will be a special computer with infrared interface at the venue which anyone can use to load a custom message to their own badge We encourage everyone to keep their badge in Display mode with their own messag...

Страница 3: ...In Circuit Serial Programmer and the other one is 9 pole I O connector PCB dimensions are 46 139 mm 8 16 LED matrix is built of 128 discrete SMD LEDs and refreshed by SCT2024CSSG constant current driver permanently assisted by MCU CPU clock is 48 MHz which is 12 MIPS so display refresh takes about 1 of processor time Infrared transmitter is a single 940 nm LED and the receiver is TSOP6240TTCD whic...

Страница 4: ...me critical points predominantly its ISR vectors The easiest way to do it is to change its OFFSET variable which is defined in RAMDEF INC file and to comment out the line include BootLoader 2b inc which is in the KERNEL 2 INC file The whole project hardware and all source files for all modules is open so you are free to use it copy and modify and redistribute it 2 1 CONFIGURATION BITS Internal RC ...

Страница 5: ...ET and ON OFF Release the left button first an the release the right button At this moment the LED in the top left corner of the badge should blink and the new drive named HackABadge should appear on your computer s screen All you have to do is to drag and drop the HEX file on the HackABdge icon After the taskbar finishes its its job and disappears you have to start your application on the badge b...

Страница 6: ... 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 T...

Страница 7: ......

Страница 8: ...y kernel Pause mode clr by kernel Run mode do not modify 1 Timer 0 interrupt 1200 Hz handshaking user must reset 2 Full display scan 150 Hz handshaking user must reset 3 set EEPROM RX buffer function disabled set clr by user 4 Timer 0 interrupt in 2nd phase LED OFF period do not modify 5 set Disable pause mode 6 Flag that display message was received user must reset 7 Not used 0x07 RXFlag 0 set En...

Страница 9: ...x720 0x72F Pause display buffer displayed only during pause 0x730 0x733 RND seed don t modify 0x734 0x737 RND internal arithmetic registers may be used for another purpose 0x738 0x7FF User data RAM space 3 KERNEL Kernel supports LED matrix multiplex It also contains an initialization routine which is normally executed only once after RESET and Timer 2 Interrupt routine which should always be activ...

Страница 10: ...put This interrupt will be used inside TIMER 0 interrupt routine for wake up after sleep WPUB Only PortB 6 pull up enabled that s key1 key4 input driven by A0 A3 output ports LATx and TRISx bits preset as hardware requires T0CON Timer 0 defined as 8 bit timer prescaler 128 software interrupt on overflow This interrupt is used for LED display refresh support with dynamically adjusted timing for dis...

Страница 11: ...ft 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 0x41C64E6D 0x000...

Страница 12: ... should test one of those bits and reset it after it detects that it was set it is not automatically reset If user routine has to test if some key is permanently pressed it has to test bit 0 in one of ROTOR0 ROTOR4 registers It is NOT recommended to test port pins directly except for the INT key as keys 1 4 have only one common input Special test is made for Left Right Up and for Left Right Down k...

Страница 13: ... if RXFlag 0 is set valid header is detected and if the serial number matches the message will be received otherwise it will be ignored When the new message is received the old one is automatically cleared Message terminator is pause which is at least 200ms long At the end of the the message terminator 0x00 will be inserted automatically to the received string in data memory Thus the maximal messa...

Страница 14: ......

Отзывы: