3.1. KERNEL OUTSIDE INTERRUPT
The part of kernel which is outside of the interrupt routine, is located in the file kernel.asm. It
also includes files p18lf25k50.inc (with processor definitions), macros.inc (with macro
definitions) and int.inc (the part of kernel which is executed in interrupt).
First, it presets Special Function Registers:
OSCCON and OSCCON2: Sleep mode enabled, all other bits are unchanged, as defined in
configuration words
ANSEL: all inputs all digital, except C2, which is AN14 (Note: ANSEL registers are in
BANKED address space!)
INTCON2: Internal pull-ups enabled, int0 on falling edge of PORTB,0 input. 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 display dimming (LED intensity control)
T2CON: Timer 2 with 1:4 prescaler and no postscaler. Used for PWM peripheral which
generates a 40 KHz carrier for infrared transmitter. PWM peripheral is defined with
CCP2CON (which selects PWM mode) and CCP2L which defines signal/pause ratio to
approximately 50:50
TXSTA1, RCSTA1, BAUDCON1, SPBRGH1, SPBRG1: UART TX/RX programmed to 2400
baud, no parity, 8 data bits, 1 stop bit
Содержание SUPERCONFERENCE BADGE
Страница 1: ...HACKADAY SUPERCONFERENCE BADGE Pasadena 2016 Nov 5 6 Ver 1 Rev 0 ...
Страница 7: ......
Страница 14: ......