Hi Guys,
I need a CAN interrupt (external CAN) for the ECIO40P16 or a suggestion on how to create a user-defined interrupt. Can someone help me out there?
Thanks!
Christina
CAN interrupt (external CAN) for the ECIO40P16
Moderator: Benj
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: CAN interrupt (external CAN) for the ECIO40P16
Hi.
The MCP2515 has 2 Pins that can beset to Go low when the buffer has valid data and high when the buffer is empty
RX0BF and RX1BF ,what you need to do is
You will have to use the Datasheet and write C code to help you out unless MATRIX is willing to add this for you to the component
Hope this helps
The MCP2515 has 2 Pins that can beset to Go low when the buffer has valid data and high when the buffer is empty
RX0BF and RX1BF ,what you need to do is
- Connect these to pins to the ECIO40P16 IOC pins (Interrupt on change pins)
Configure from Flowcode Interupt Icon the 2 IOC interupts
Set the correcsponding registers in the MCP2515 to activate the RX0BF and RX1BF pins (see datasheet) you can do a SPI write to these registers by a C icon how it will function is when the IOC Interrupt pins on the MCU trigger an interrupt you know which buffer has a message and then read that buffer
You will have to use the Datasheet and write C code to help you out unless MATRIX is willing to add this for you to the component
Hope this helps
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: CAN interrupt (external CAN) for the ECIO40P16
An alternative would be to connect the MCP2515 INT pin to one IOC pin then you trigger a interrupt with the IOC pin and check both buffers , read the one that has a message.This option you do not need any C code written to the 2515 as the INT pin alweays toggle on and message received ,just configure the IOC Interrupt in FC and use the CAN component to read the buffers
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
Re: CAN interrupt (external CAN) for the ECIO40P16
Thanks for the tip, that's how I imagined it would be.
I will also try the internal CAN in parallel, possibly with an custom interrupt, flags should be described in the description of the microcontroller.
I will also look in the FC forum to see if there is an example of a custom interrupt.
Regards
Christina
I will also try the internal CAN in parallel, possibly with an custom interrupt, flags should be described in the description of the microcontroller.
I will also look in the FC forum to see if there is an example of a custom interrupt.
Regards
Christina
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: CAN interrupt (external CAN) for the ECIO40P16
Hi Christina,
Some help on custom interrupts here.
https://www.matrixtsl.com/wiki/index.ph ... sPIC/PIC24
Let us know how you're getting on
Some help on custom interrupts here.
https://www.matrixtsl.com/wiki/index.ph ... sPIC/PIC24
Let us know how you're getting on
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: CAN interrupt (external CAN) for the ECIO40P16
Thanks Ben, that's what I was looking for!
I've already picked out the appropriate registers, it will certainly work with this example.
Thanks again!
Christina
I've already picked out the appropriate registers, it will certainly work with this example.
Thanks again!
Christina