![Atmel STK511 User Manual Download Page 29](http://html.mh-extra.com/html/atmel/stk511/stk511_user-manual_3003507029.webp)
STK511 Transmitter Board
5-6
STK511 User Guide
4842B–AVR–10/09
KeepAlive:
RJMP
Main
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; routine: ISRPinChg
; calls: Debounce, S1S2Pressed, WDTStart
; called by: <uC interrupt firmware>
; function: services a single button-press; and, checks for simultaneous
; button press (for changing modulation modes)
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ISRPinChg:
PUSH
R19
; TP - All functions must have push and pop
statements!
IN
r31, SREG
; save Status Register
CLI
; TP - Disable interrupts
WDR
; TP - Clear watchdog timer
RCALL
Debounce
; TP - Add delay for debounce
IN
r16, PINB
; see which button was pushed
CPI
R16,0x06
; TP - IF BOTH
BREQ
ISRPinBoth
CPI
R16,0x02
; TP - IF only S2
BREQ
ISRPinS2
CPI
R16,0x04
; TP - IF only S1
BREQ
ISRPinS1
RJMP
ISRPinChgEnd; TP - Exit if glitch
ISRPinBoth:
CPI
MODE,FSK
; TP - For both buttons pressed, check current
state
BREQ
SETmodeASK
; TP - If currently FSK, set mode to ASK
LDI
mode,FSK
; TP - If not FSK, set mode to FSK
RJMP
ISRPinLoop
; TP - Exit button ISR when buttons released
SETmodeASK: