CAN reciever interrupt flage problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

CAN reciever interrupt flage problem

594 次查看
kdn
Contributor III

I am using CAN module of MC9S12XHZ512 microcontroller, I successfully archive transmitting of data from my microcontroller, but problem is that I am able to receive data only one time after that my controller get hang, I think that I have not clear my CAN receiver  interrupt flag, can anyone tell me where I can get CAN receiver interrupt flag in datasheet, I post my interrupt code for CAN below. Do MC9S12XHZ512 compiler support sprintf function.

 

 

#pragma CODE_SEG __NEAR_SEG NON_BANKED

 

 

interrupt void Vcan1RxISR(void)

 

{

     unsigned char  RxBuffer[8],u8Length=8;

   

    unsigned int R,temp;

   

    LCD_Cmd(0x80);

 

     R = CAN1RXDSR0;

    

       

    

         Convert(R);

         LCD_Data(D);

         delay();

         LCD_Data(C);

         delay();

         LCD_Data(B);

         delay();;

         LCD_Data(A);

         delay();

                       

      PORTA = 0xFF;

    

        

      CAN1RFLG_RXF = 1;

}

标签 (1)
0 项奖励
2 回复数

455 次查看
TICS_Fiona
NXP Employee
NXP Employee

The Receive Buffer Full Flag(RXF) is bit 0 in MSCAN Receiver Flag Register (CANRFLG).

After the CPU has read that message from the RxFG buffer in the receiver FIFO, the RXF flag must be cleared to release the buffer.

For details, please see section 14.3.2.5 in data sheet:

http://cache.freescale.com/files/microcontrollers/doc/data_sheet/MC9S12XHZ512.pdf

And MC9S12XHZ512 compiler supports sprintf function, please include the head file <stdio.h>.

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 项奖励

455 次查看
kdn
Contributor III

RXF indicate Receiver FIFO get full , I am looking for CAN Receiver interrupt flag.

Thanks for sprintf function

0 项奖励