07.12.2012 Views

DRM081, Multi-Button IR Remote Control using the MC9RS08KA2 ...

DRM081, Multi-Button IR Remote Control using the MC9RS08KA2 ...

DRM081, Multi-Button IR Remote Control using the MC9RS08KA2 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

clr 3,Auto_Mode<br />

bclr 3,Cool_Mode<br />

bclr 3,Humd_Mode<br />

bclr 3,Wind_Mode<br />

bclr 3,Heat_Mode<br />

bset TX_READY,Tx_Flag ; Tx ready<br />

<strong>Multi</strong>-<strong>Button</strong> <strong>IR</strong> <strong>Remote</strong> <strong>Control</strong> <strong>using</strong> <strong>the</strong> <strong>MC9RS08KA2</strong>, Rev. 0<br />

Transmitter Software Implementation<br />

jmp Tx_Frame<br />

; ----------------------------------------------------------------------------- *<br />

S2_Key: ; Modes Key pressed (MODE)<br />

; (Auto>Cool>Humd>Wind>Heat)<br />

brclr 7,Tx_Data10,Slip_S2 ; No action if S1=OFF<br />

bclr 3,Tx_Data32 ; Clear Sleep<br />

bclr 3,Auto_Mode<br />

bclr 3,Cool_Mode<br />

bclr 3,Humd_Mode<br />

bclr 3,Wind_Mode<br />

bclr 3,Heat_Mode<br />

lda Tx_Data10 ; Here (S1=ON)<br />

lsra ; shift higher nibble to lower nibble<br />

lsra ; All higher nibble is %0000<br />

lsra<br />

lsra<br />

cmp #%00001100 ; Reach Max. value (Heat mode)?<br />

blo Inc_Modes<br />

lda Tx_Data10<br />

and #%10001111 ; Change mode to 000<br />

sta Tx_Data10<br />

bset TX_READY,Tx_Flag ; Tx ready<br />

bra Mode_Update<br />

Inc_Modes:<br />

inca<br />

lsla<br />

lsla<br />

lsla<br />

lsla<br />

sta Tx_Data_Temp ; Store higher nibble<br />

lda Tx_Data10<br />

and #%00001111 ; mask higher nibble<br />

ora Tx_Data_Temp<br />

sta Tx_Data10<br />

bset TX_READY,Tx_Flag ; Tx ready<br />

Mode_Update: ; Mode parameter to Tx_Data32<br />

lda Tx_Data10<br />

and #%01110000<br />

cmp #%00000000 ; Check Auto mode?<br />

beq Auto_2_D32<br />

cmp #%00010000 ; Check Cool mode?<br />

beq Cool_2_D32<br />

Freescale Semiconductor 35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!