AN2633 Freescale Semiconductor / Motorola, AN2633 Datasheet - Page 12

no-image

AN2633

Manufacturer Part Number
AN2633
Description
LIN Drivers for SLIC Module on the MC68HC908QL4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2633/D
12
1
2
3
4
5
ENTER ISR AND LOAD
SLCSV INTO INDEX
REGISTER.
JUMP TO ENTRY IN JUMP
TABLE FOR INTERRUPT
SOURCE IN SLCSV.
JUMP DIRECTLY TO
APPROPRIATE
SERVICE HANDLER
SERVICE THE INTERRUPT
SOURCE AS NEEDED
NOTE:
WHEN FINISHED, JUMP TO
COMMON EXIT CODE WHICH
CLEARS THE INTERRUPT
FLAG. tHIS SAVES ROM SPACE.
IF DESIRED, THIS CODE CAN
BE INCLUDED AT THE END
OF EACH SERVICE HANDLER
REGARDLESS OF THE
LOCATION OF THIS CODE,
IT ALWAYS TAKES TWO
jmp INSTRUCTIONS TO
BEGIN EXECUTING.
subroutines which handle each SLCSV value accordingly.
flow of the assembly based ISR with a SLCSV value of 0x2C (ID Received).
The jump table serves the same purpose as a switch(temp_SLCSV)
statement would in a C-based ISR, but the jump table always executes in fixed
time. In a switch(var) statement, cases near the end of the list might take
longer to execute, because all cases must be searched. This may be optimized
by the C compiler to minimize execution time, but execution time will still vary
based on which case is taken.
It is possible to further optimize this assembly routine by grouping all unused
service handlers together so that they can share a common exit point. The
entries in the jump table for unused services could even be made to jump
directly to the exit code.
slic_isr:
jmptab:jmp
serve0x2C:
exit_isr:
LIN Drivers for SLIC Module on the MC68HC908QL4
Freescale Semiconductor, Inc.
For More Information On This Product,
pshh
clrh
ldx
jmp
nop
...
jmp
nop
...
jmp
nop
lda
cmp
bne
...
jmp
lda
ora
sta
pulh
rti
SLCSV
jmptab.x
serve 0x2C
serve 0x3C
SLCID
LINID
next_id_l
exit_isr
SLCS
#mSLIC
SLCS
Go to: www.freescale.com
serv0x00
Figure 7. SLIC Assembly ISR Flowchart
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
ID Received Successfully - parity OK - ser
Performing ID lookup to determine message
Push H onto stack
clear H to ensure proper addressing
Load SLCSV value into index register
SLCSV used as offset into jump table
No interrupts pending
ID Received Successfully - parity OK
Wakeup
Load up ID of incoming message
Is it the ID we’re looking for?
If not, check for next ID
Load mask for SLCF bit
Clear SLCF bit
restore from stack
return from interrupt
Figure 7
MOTOROLA
shows the

Related parts for AN2633