serial receive interrupts for MC9S12XEP100

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

serial receive interrupts for MC9S12XEP100

1,010 Views
ughadge
Contributor II


Hi,
I want to write an Interrupt service routine for MC9S12XEP100 controller (HCS12X) when I am receiving the data serially. I want to see an example of how to do it so that I can implement my ISR accordingly
how to write registers and the ISR ?

 

 

0 Kudos
2 Replies

930 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

I suggest you refer TN101 of how to implement interrupt for 16bit MCU.

Vector number can be found in datasheet vector locations table.

Count from bottom of the table for the “vector number”. the reset vector is vector number 0 (located at address 0), vector number 1 is located just after the vector 0 (at address 0x2) and so on.

ie Reset = 0 (address is $FFFE), Clock monitor reset = 1,  COP watchdog reset = 2 , ...... You can see “Vector Priority” in this table. When the two interrupt occurs, the system will accept the higher priority interrupt.

 

Have a nice day,

Jun Zhang

0 Kudos

986 Views
Bernhard3
Contributor I

; asm only
;* Namen Adressen Interrupt Vectors *
ORG $FFD0
fdb K_VecBDL ;Interupt BDLC
fdb K_VecATD ;Interupt ATD ffd2
fdb K_VecSI1 ;Interupt SCI1 ffd4
fdb K_VecSCI ;Interupt SCI0 ffd6
fdb K_VecSPI ;Interupt SPI ffd8
fdb K_VecPAI ;Interupt PAI ffda
fdb K_VecPAO ;Interupt PAO ffdc
fdb K_VecTOv ;Interupt TOv ffde
fdb K_VecTC7 ;Interupt TC7 ffe0
fdb K_VecTC6 ;Interupt TC6 ffe2
fdb K_VecTC5 ;Interupt TC5 ffe4
fdb K_VecTC4 ;Interupt TC4 ffe6
fdb K_VecTC3 ;Interupt TC3 ffe8
fdb K_VecTC2 ;Interupt TC2 ffea
fdb K_VecTC1 ;Interupt TC1 ffec
fdb K_VecTC0 ;Interupt TC0 ffee
fdb K_VecRTI ;Interupt RTI fff0
fdb K_VecIRQ ;Interupt IRQ fff2
fdb K_VecXIR ;Interupt XIR fff4
fdb K_VecSWI ;Interupt SWI fff6
fdb K_VecUIM ;Interupt UIM fff8
fdb K_VecCOP ;Interupt COP fffa
fdb K_VecCOC ;Interupt COC fffc
fdb K_VecRes ;Adresse Start aus Reset fffe


; Program- Adresse Reset und nicht benutzter Interrupte
ORG $C000
K_VecRes: ;K_Vecxxx and folower: $C000
K_VecBDL: ;Interupt BDLC ffd0
K_VecATD: ;Interupt ATD ffd2
K_VecSI1: ;Interupt SI ffd4
K_VecSPI: ;Interupt SPI ffd8
K_VecPAI: ;Interupt PAI ffda
K_VecPAO: ;Interupt PAO ffdc
K_VecTOv: ;Interupt TOv ffde
K_VecTC1: ;Interupt TC1 ffec
K_VecTC2: ;Interupt TC2 ffee
K_VecTC3: ;Interupt TC3 ffee
K_VecTC4: ;Interupt TC4 ffee
K_VecTC5: ;Interupt TC5 ffee
K_VecTC6: ;Interupt TC6 ffee
K_VecTC7: ;Interupt TC7 ffee
K_VecIRQ: ;Interupt IRQ fff2
K_VecXIR: ;Interupt XIR fff4
K_VecSWI: ;Interupt SWI fff6
K_VecUIM: ;Interupt UIM fff8
K_VecCOP: ;Interupt COP fffa
K_VecCOC: ;Interupt COC fffc

; SCI Interrupt Program
ORG $CD00 ; erste Adresse Pogram
K_VecSCI:
ldaa R_SCISR10 ;löscht Interr Fla
; Daten empfangen
ldab R_SCIDRL0 ;angekommenes Byte ins b
;
;
; Daten nach SCI
ldaa #$BD ; Sync 189
Z_OutC1: brclr R_SCISR10,$80,Z_OutC1 ;OUTPUT READY?
staa R_SCIDRL0 ;jetzt raus starten
;

Z_NAend1: nop
rti ; Ende RTI

0 Kudos