background image

2.3.2. DATA RAM ORGANIZATION 

Kernel uses Data RAM GPR (General Purpose Register) area locations 0x000...0x029 for 
housekeeping registers. Locations 0x600...0737 are used for special purpose. 

addr  name   

bit 

description 

0x00  KeyEdge 

0 =  set by kernel if key INT edge detected (user must clear) 

 

 

 

1 =  set by kernel if key LEFT edge detected (user must clear) 

 

 

 

2 =  set by kernel if key UP edge detected (user must clear) 

 

 

 

3 =  set by kernel if key DOWN edge detected (user must clear) 

 

 

 

4 =  set by kernel if key RIGHT edge detected (user must clear) 

 

 

 

5...7  Not used 

0x01  Rotor0  

Used for key INT debouncer (rotate left, bit = 0 if key pressed) 

0x02  Rotor1  

Used for key LEFT debouncer (rotate left, bit = 0 if key pressed) 

0x03  Rotor2  

Used for key UP debouncer (rotate left, bit = 0 if key pressed) 

0x04  Rotor3  

Used for key DOWN debouncer (rotate left, bit = 0 if key pressed) 

0x05  Rotor4  

Used for key RIGHT debouncer (rotate left, bit = 0 if key pressed) 

0x06  Flag 

 

0 =  set by 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: Enable RX to RAM 0x601...0x6FF and EEprom (set/clr by user) 

 

 

 

1 =  set: RX header reception is in progress (do not modify) 

 

 

 

2 =  set: RX message reception is in progress (do not modify) 

 

 

 

3 =  set: RX message received (internal use, do not modify it) 

 

 

 

4...7  Not used  

0x08  Brightness 

Display PWM, user presets to 0...15 for dimming 

0x09  GPreg   

General purpose register, may be used by user 

0x0A  Anode Count  display multiplex column counter 0...7 
0x0B  BitMask 

10000000...00000001, shift reg used for anode scan 

0x0C  T0period 

Total Timer 0 period, may be modified to alter scan frequency 

0x0D  InnerInt 

Loop counter, used by interrupt routine 

0x0E  OuterInt 

Loop counter, used by interrupt routine 

0x0F  OuterPlusInt  Loop counter, used by interrupt routine 

Summary of Contents for SUPERCONFERENCE BADGE

Page 1: ...HACKADAY SUPERCONFERENCE BADGE Pasadena 2016 Nov 5 6 Ver 1 Rev 0 ...

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

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

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

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

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

Page 7: ......

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

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

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

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

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

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

Page 14: ......

Reviews: