Skip to main content
nbutts
Associate
September 9, 2005
Question

FIFO 1 CAN Interrupts not working

  • September 9, 2005
  • 2 replies
  • 838 views
Posted on September 09, 2005 at 09:27

FIFO 1 CAN Interrupts not working

This topic has been closed for replies.

2 replies

siegmund
Associate III
May 17, 2011
Posted on May 17, 2011 at 11:37

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

nbutts
nbuttsAuthor
Associate
May 17, 2011
Posted on May 17, 2011 at 11:37

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?