2018-06-08 01:55 AM
Dear All, I have an question about CAN bus transmit interrupt. I use STM32F303.
In reference manual, it describes when transmit mailbox becomes empty, the interrupt will be triggered.
It also means of that when transmit procedure is completed, the interrupt will be triggered. right?
if yes, what should I do in the ISR(interrupt service routine)? There are no thing need to process due to the transmission is already completed. it seems like of an superfluous ISR.
#stm32 #can-busSolved! Go to Solution.
2018-06-10 10:15 PM
Hi Thomas,
Thanks your reply and time. It's useful to me.
2018-06-08 02:53 AM
Hi Shunfan,
if the interrupt is useful or not of course depends on your application and architecture.
It is very often useful for applications which have to transmit more than one CAN message.
For instance if you would like to transmit a packet of a higher level protocol which has to be split in several CAN messages.Then the hardware informs you with the CAN transmit interrupt that the current transmission is complete and your program could proceed sending the next CAN message. What to do in the ISR to 'tell' your program this, heavily depends on your architecture, e.g. if you work on a threaded environment or have some software transmit FIFO for CAN etc.
If you gurantee that you do not want to transmit a second CAN message while onotherone is currently being transmitted or if you make sure that this is the case by polling, the interrupt is of little use (and you could then disable it).
For more information about the two paradigms of interrupts vs. polling you can refer to this article:
http://www.electronics-base.com/useful-info/software-related/90-polling-vs-interrupt
2018-06-08 03:25 AM
As I understood the RM, this interrupt is generated when the mailbox is empty, i.e. the contents has been transferred to the send hardware. This means, the physical send has only started. Depending on the baudrate, this can take long.
In the meantime, you can fill the next message into the mailbox.
2018-06-10 10:15 PM
Hi Thomas,
Thanks your reply and time. It's useful to me.
2018-06-10 10:16 PM
I already solve my question by your explanation.
2018-06-10 10:18 PM
Hi AvaTar,
Thanks, my opinion is same as you said. Thanks your reply.