2005-09-09 12:27 AM
FIFO 1 CAN Interrupts not working
2011-05-17 02:37 AM
I am having trouble getting CAN interrupts to work with the ST9. I was able to get CAN Tx interrupts and CAN Rx interrupts for FIFO 0 working. But I can't get interrupts working for FIFO 1.
Here is a snippet from my init code: /* Enable interrupts. */ spp(CAN0_CTRL_PG); CAN_CIER = CIER_tmeie | CIER_fmpie0 | CIER_fmpie1; spp(SINT_PG); SIMRL |= (SIm_imf0m | SIm_ime0m | SIm_ime1m); SITRL |= (SIm_itef0m | SIm_itee0m | SIm_itee1m); In CrtBegin.spp I have the following vectors defined: .org 0xA0 .word ServicePolledCAN ;CAN Rx interrupts .word ServicePolledCAN ;CAN Rx interrupts .word SendTxQueues ;CAN Tx interrupts The SIVR register is set to 0xBE. I am using the emulator and have break points set on both the ServicePolledCAN and SendTxQueues. Everytime the ST9 tries to transmit I get an interrupt and the code breaks on SendTxQueues. When I send data to FIFO 0 the emulator breaks on ServicePolledCAN. But when I send a CAN packet that goes to FIFO 1 the SIPRL register gets set to 0x02 but never generates an interrupt to vector 0xA2. Any ideas?2011-05-17 02:37 AM
hi
be sure when using interrupts, that your core has the same clock-speed as the peripherals. see acutal datasheet v4, there are some hints about bugs in the st9 (especially the interrupts) and some workarounds. siggi