Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 Some MCP2515 not response to ESP32 #34

Open
UnknownPP opened this issue Mar 20, 2022 · 3 comments
Open

ESP32 Some MCP2515 not response to ESP32 #34

UnknownPP opened this issue Mar 20, 2022 · 3 comments

Comments

@UnknownPP
Copy link

I'm connecting 3 MCP2515 to esp32 each of which Initializing is done After that, some MCP2515 stops are available to esp32.
I measure single CS and INT during not a response to esp32, CS always HIGH and INT always LOW.

My setup
// Init CAN
SPI.begin();

ACAN2515Settings settings1(QUARTZ_FREQUENCY, 500UL * 1000UL); // 500 kpbs
ACAN2515Settings settings2(QUARTZ_FREQUENCY, 500UL * 1000UL); // 500 kpbs
ACAN2515Settings settings3(QUARTZ_FREQUENCY, 500UL * 1000UL); // 500 kpbs

settings1.mRequestedMode = ACAN2515Settings::NormalMode;
settings1.mReceiveBufferSize = 100;
uint16_t errorCode1 = can1.begin(settings1, []
                                 { can1.isr(); });

delay(50);

settings2.mRequestedMode = ACAN2515Settings::NormalMode;
settings2.mReceiveBufferSize = 100;
uint16_t errorCode2 = can2.begin(settings2, []
                                 { can2.isr(); });

delay(50);

settings3.mRequestedMode = ACAN2515Settings::NormalMode;
settings3.mReceiveBufferSize = 100;
uint16_t errorCode3 = can3.begin(settings3, []
                                 { can3.isr(); });

delay(50);
@pierremolinaro
Copy link
Owner

pierremolinaro commented Mar 31, 2022 via email

@UnknownPP
Copy link
Author

UnknownPP commented Apr 1, 2022

Thank you for your response.

In the first step, I connect three MCP2515 to ESP32.

SPI Pin
MOSI 23
MISO 19
SCK 18

#define CAN1_CS 2
#define CAN2_CS 5
#define CAN3_CS 0
#define CAN1_INT 4
#define CAN2_INT 34
#define CAN3_INT 35

Second, It can be initialized.
Note: Why do I have three settings some devices that I want to logger data have three data lines and baud rates are not the same

ACAN2515Settings settings1(QUARTZ_FREQUENCY, 500UL * 1000UL); // 500 kpbs
ACAN2515Settings settings2(QUARTZ_FREQUENCY, 500UL * 1000UL); // 500 kpbs
ACAN2515Settings settings3(QUARTZ_FREQUENCY, 500UL * 1000UL); // 500 kpbs

uint16_t errorCode1 = can1.begin(settings1, []
{ can1.isr(); });
uint16_t errorCode2 = can2.begin(settings2, []
{ can2.isr(); });
uint16_t errorCode3 = can3.begin(settings3, []
{ can3.isr(); });

Third, It can run for a few minutes after that some MCP2515 does not respond to my ESP32. I measure signal pin CS and INT that do not respond to CS signal always HIGHT and INT signal always LOW.

And final, It has only one or two MCP2515 (usually only one) that responded to ESP32.

Thank you.

@pierremolinaro
Copy link
Owner

pierremolinaro commented Apr 4, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants