#include "c:\miniIDE\hcs12.inc" org $1500 ct1 brset CAN1TFLG,$07,tb_empty ; wait until all transmit buffers are empty bra ct1 tb_empty bset CAN1CTL0,SLPRQ ; request to enter sleep mode ct2 brclr CAN1CTL1,SLPAK,ct2 ; wait unti sleep more is entered bset CAN1CTL0,INITRQ ; request to enter initialization mode ct3 brclr CAN1CTL1,INITAK,ct3 ; wait until initialization mode is entered movb #$10,CAN1IDAC ; select 4 16-bit acceptance mode movb #$54,CAN1IDAR0 ; set up filter for letter 'T' for standard movb #0,CAN1IDAR1 ; identifier movb #$50,CAN1IDAR2 ; set up filter for letter 'P' for standard clr CAN1IDAR3 ; identifier clr CAN1IDMR0 ; acceptance mask for 'T' movb #$F7,CAN1IDMR1 ; check IDE bit only (0 for standard identifier) clr CAN1IDMR2 ; acceptance mask for 'P' movb #$F7,CAN1IDMR3 ; check IDE bit only (must be 0) movb #$54,CAN1IDAR4 ; set up filter for letter 'T' for standard movb #0,CAN1IDAR5 ; identifier movb #$50,CAN1IDAR6 ; set up filter for letter 'P' for standard clr CAN1IDAR7 ; identifier clr CAN1IDMR4 ; acceptance mask for 'T' movb #$F7,CAN1IDMR5 ; check IDE bit only (0 for standard identifier) clr CAN1IDMR6 ; acceptance mask for 'P' movb #$F7,CAN1IDMR7 ; check IDE bit only (must be 0) bclr CAN1CTL0,INITRQ ; exit initialization mode bclr CAN1CTL0,SLPRQ ; exit sleep mode end