Other Parts Discussed in Thread: HALCOGEN
I need to work with TMS570 DCAN module in interrupt mode. As I understand, it is nessessary to set EIE and SIE bits for enabling 'Error' and 'Status Change' interrupts accordingly in the DCAN CTL register. Also I have set bits IE0 and IE1 in the DCAN CTL register for enabling both interrupt lines. After that I have assigned VIM channel 16 (can1HighLevelInterrupt) to IRQ, and also have enabled interrupts for corresponding message boxes for TX and RX in HALCoGen. I have configured Message Box 1-8 for TX and Message Box 9-16 for RX.
I can transmit and recieve messages, using canTransmit() and canGetData(), but i can't get the interrupt functionality when transmitting or recieving messages. Interrupt Handler for 'can1HighLevelInterrupt' just didn't work (I also cheked other handlers, for 'high' and 'low' level - with the same results), though the corresponding interrupt flag in the INTPNDx[12] register is set to '1' (its value, in my case, is '0x00000001' for transmittion and '0x00000100' for recieving). I also read the DCAN ES register during operation, and it shows '0x00000008' when transmitting a message (box 1), and '0x00000010' when recieving a message (box 9), so TxOK and RxOK flags shows the right values.
As I understand, the value '0x00010000' in the DCAN INT during transmittion shows that the interrupt from Message Box 1 is routed to DCAN1INT line (now I use only Message Box 1 for TX), and the value '0x00090000' in the DCAN INT during recieving shows that the interrupt from Message Box 9 is also routed to DCAN1INT line (now I use only Message Box 9 for RX). These values remains unchanged after the first transmittion or recieving. Is it right that they must be cleared in the DCAN interrupt handler or in another way?
In TRM document (spnu489a) I found that "Status Change interrupts can only be routed to interrupt line DCAN0INT", but as i see from the values of DCAN INT register these interrupts are routed to DCAN1INT. The value in the INTMUXx[12] register is '0x0000FFFF', as I set all interrupt priorities to 'High Priority' for Message Box 1-16 in the HALCoGen.
Thanks,
Evgenyy