As mentioned previously, I can of course modify the routine to do
something like this:
// SendMsg routine
If Hardware Transmit Buffer Available (TBS1, TBS2, or TBS3) Then
Put Message into a Hardware Buffer
Transmission Request (CANCMR)
Else
Put Message into a Software Buffer
Enable Transmit Interrupt (CANIER)
End If
// Tx ISR
While Software Buffer Is Not Empty AND
Hardware Transmit Buffer Is Available
Get Message From Software Buffer
Put Message Into Hardware Transmit Buffer
End While
If Software Buffer Is Empty
Disable Transmit Interrupt (CANIER)
End If
VICVectAddr = 0xffffffff; // Acknowledge Interrupt
I don't like the idea of continuously enabling/disabling the Transmit
Interrupt
using CANIER. There has to be a way to clear the interrupt request,
although simply reading CANICR does NOT work and I don't see anything
in the User's Manual that will do it.
Thanks,
JT
> Pseudocode looks something like this:
>
> If a hardware transmit buffer is available
> Send message directly
> else
> Add message to software buffer
> end if
>
> And then in the transmit interrupt routine:
>
> while software buffer is not empty and there is a hardware buffer
> available
> get message from software buffer
> put message into a hardware buffer
>
> VICVectAddr = 0xffffffff; // Acknowledge Interrupt
>
> If I test the code by sending one message, the routine sends it out
> and then the interrupt routine is called to signify that the
> transmission is complete. However, simply executing the routine
does
> not acknowledge the interrupt and it gets called repeatedly. Any
> ideas?
>
> Thanks,
>
> JTMessage
Re: Philips LCP2129 CAN Transmit Interrupt
2004-07-10 by johnthomasedwardtimm
Attachments
- No local attachments were found for this message.