pierremolinaro / acan2517

Arduino CAN driver for MCP2517FD CAN Controller (in CAN 2.0B mode)
MIT License
22 stars 10 forks source link

TRANSMIT_FIFO_INDEX is 0 (should be 2) #18

Open PeterOGB opened 2 years ago

PeterOGB commented 2 years ago

I haven't been able to build your Arduino code as I don't have a suitable shield for an Arduino, but I am using it as a starting point for code to run on a Pi PICO with a MCP2518 attached. Looking at the code I se TRANSMIT_FIFO_INDEX is defined as 0, but functions like C1FIFOCON_REGISTER() expect 1..31 (according to the comments). I think using C1FIFOCON_REGISTER (TRANSMIT_FIFO_INDEX) will produce a register address for CiTXQCON (0x50) not CiFIFOCON1 (0x5C). Peter Onion

pierremolinaro commented 2 years ago

Hello,

I think the ACAN2517 library works with a Pi Pico. The ACAN2515 runs on Pi Pico, I use the Earle F. Philhower board manager, it is very stable, more than Arduino Mbed Os RP 2040 one.

Where did you see that TRANSMIT_FIFO_INDEX is defined as 0 ? In ACAN2517.cpp file, line 160, it is set to 2 : static const uint8_t TRANSMIT_FIFO_INDEX = 2 ;

Pierre

Le 24 mars 2022 à 21:16, PeterOGB @.***> a écrit :

I haven't been able to build your Arduino code as I don't have a suitable shield for an Arduino, but I am using it as a starting point for code to run on a Pi PICO with a MCP2518 attached. Looking at the code I se TRANSMIT_FIFO_INDEX is defined as 0, but functions like C1FIFOCON_REGISTER() expect 1..31 (according to the comments). I think using C1FIFOCON_REGISTER (TRANSMIT_FIFO_INDEX) will produce a register address for CiTXQCON (0x50) not CiFIFOCON1 (0x5C). Peter Onion

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan2517/issues/18, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVFMNFVMP3GBW5OZ2UDVBTETNANCNFSM5RSGQHXQ. You are receiving this because you are subscribed to this thread.