-
Notifications
You must be signed in to change notification settings - Fork 96
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
Issue with due can library and DUE #44
Comments
Your example code seems correct. So, it should (in theory) work as-is. It
is possible that something in the non-simplified version changes the way it
works. But, it seems odd that it accepts one message and ignores the rest.
That sounds like a filter but you aren't filtering. You might try having
the Due just read and see if you can get that working before doing any
sending. Also, make sure nothing funny is happening with the Rs pin on the
SN65HVD230 transceiver.
…On Sun, Feb 23, 2020 at 8:32 AM AAKFISHERMAN ***@***.***> wrote:
Hi,
I'm testing canbus using DUE and transceiver sn65hvd230 shield.
I have a canbus network as follows;
CANBUS NETWORK:
- 2 arduinos NANO with MCP2515
- 1 arduino MEGA 2560 with MCP2515
- 1 arduino DUE with sn65hvd230
Network is property terminated with 120 ohm resistors.
Each arduino sends at least two canbus messages, each with 8 bytes and its
own ID;
Each arduino reads canbus and shows at serial, messages received.
BEHAVIOR:
All arduinos (NANO/MEGA) read all messages on canbus network... BUT DUE
only one message... Seems other messages are ignored. But there isn't can
filter configured.
DUE sends one message, but none of arduinos can receive...
I think sketch from NANO and MEGA doesn't matter because they are working
very well...
On DUE: (Simplified sketch)
#include <variant.h>
#include <due_can.h>
SETUP
void setup()
{
Serial.begin(115200);
Can0.begin(CAN_BPS_250K);
Can0.watchFor();
}
void CANBUSTX()
{
CAN_FRAME CANBus_TX;
CANBus_TX.id = 0x090;
CANBus_TX.extended = false;
CANBus_TX.priority = 4;
CANBus_TX.length = 8;
CANBus_TX.rtr = 0;
CANBus_TX.data.byte[0] = 24;
CANBus_TX.data.byte[1] = 33;
CANBus_TX.data.byte[2] = 23;
CANBus_TX.data.byte[3] = 11;
CANBus_TX.data.byte[4] = 0;
CANBus_TX.data.byte[5] = 0;
CANBus_TX.data.byte[6] = 0;
CANBus_TX.data.byte[7] = 10;
Can0.sendFrame(CANBus_TX);
}
void CANBUSRX()
{
CAN_FRAME CANBus_RX;
if (Can0.available() > 0)
{
Can0.read(CANBus_RX);
Serial.print(F(">>>>>>>>>> Received CANBUS!!! "));
Serial.println(CANBus_RX.id,HEX);
}
}
LOOP:
void loop()
{
CANBUSTX();
CANBUSRX();
}
Of course i had simplified the sketch. Arduinos are sending not only
constant values, but values read from sensors (byte format).
What can be wrong? With MCP2515 on arduinos and sn65hvd230 on ESP32
(example), they works very well.
Thanks for any help
Regards
Alex
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#44?email_source=notifications&email_token=AAQLWZIMMLXJ547VIFJFHXDREJ3GRA5CNFSM4KZ2UUMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IPR2EEA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQLWZOYVMIMGDBVMWTPBH3REJ3GRANCNFSM4KZ2UUMA>
.
|
Hi. |
Hi, I did some wiring modifications on my canbus network (shielded cables) and now i´m receiving several different frames on DUE (only RX). But still not transmiting; None of arduinos receive frames from DUE, but from other arduinos OK. It´s necessary to check number os mailboxes to TX? Or something that i can check? Thanks |
The default is one TX mailbox. This should be plenty. Sometimes people
sending very rapidly like 2 TX mailboxes so that the hardware can load one
while sending the other and basically send non-stop. Still, you can do over
1000 frames per second with just one TX mailbox. I don't think that's the
issue. It's really starting to sound like the CANTX pin of the Due is not
making it to the transceiver. If you have an oscilloscope you might try a
trace of that line to make sure it is happening properly.
…On Tue, Feb 25, 2020 at 4:05 PM AAKFISHERMAN ***@***.***> wrote:
Hi, I did some wiring modifications on my canbus network (shielded cables)
and now i´m receiving several different frames on DUE (only RX). But still
not transmiting; None of arduinos receive frames from DUE, but from other
arduinos OK. It´s necessary to check number os mailboxes to TX? Or
something that i can check? Thanks
Alex
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#44?email_source=notifications&email_token=AAQLWZOLGHACJNMNLPAOD4LREWB2BA5CNFSM4KZ2UUMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM5P5EA#issuecomment-591068816>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQLWZIBM44B3FWZUL3XVHLREWB2BANCNFSM4KZ2UUMA>
.
|
Hi. Thanks for your help Collin. I did a trace with oscilloscope and found some inconsistences. Voltage on DUE CAN TX was very low.... like 0.282V... At DUE CAN RX also, 0.820V... Then i change CJMCU-230 transceiver for another one... Same problem... Finally, i got one transceiver from an older ESP32 test board and works fine... TX and RX are working very well... Its very strange, because transceivers i have with chipset VP230 "82M" not works... Transceivers that works are VP230 "75M" and "68M".... I don´t know differences between them. But all of VP230 82M i have (3 pieces) not works... Thank you very much for your support. |
Hello, sorry for my English I use a translator. I send a uno to the due I receive the id but the data is fixed while the values change. I tested instead of the DUe a mega2560 + mpc2515 there it works ID + data change. I tested live without the SN65HDV230 it's the same Id ok but fixed data! I noticed a strange thing the uno with the mpc is set to 500Kbs and the due sees nothing in 500 but sees in 250Kbs! I tested on CAN0 and on CAN1 it's the same! With or without filter it's the same! // Required libraries //Leave defined if you use native port, comment if using programming port void setup() Serial.begin(38400); // Initialize CAN0 and CAN1, Set the proper baud rates here } void printFrame(CAN_FRAME &frame) { void loop(){ if (Can1.available() > 0) { Help me Thanks |
Hi, I come back to you, I tested with a teensy 4 and another library it did the same chose! so I tested other chosen: If I put the UNO with mcp2515 on one side and on the other side the Mega with mcp2515 everything is ok if I put in the middle arduino DUE and your library (and another teensy4 and other library) there it works as long as it is between 2! I think of the resistance I would test. OK: Not ok: If that can help another |
Hi,
I'm testing canbus using DUE and transceiver sn65hvd230 shield.
I have a canbus network as follows;
CANBUS NETWORK:
BEHAVIOR:
I think sketch from NANO and MEGA doesn't matter because they are working very well...
On DUE: (Simplified sketch)
#include <variant.h>
#include <due_can.h>
SETUP
void setup()
{
Serial.begin(115200);
Can0.begin(CAN_BPS_250K);
Can0.watchFor();
}
void CANBUSTX()
{
CAN_FRAME CANBus_TX;
CANBus_TX.id = 0x090;
CANBus_TX.extended = false;
CANBus_TX.priority = 4;
CANBus_TX.length = 8;
CANBus_TX.rtr = 0;
CANBus_TX.data.byte[0] = 24;
CANBus_TX.data.byte[1] = 33;
CANBus_TX.data.byte[2] = 23;
CANBus_TX.data.byte[3] = 11;
CANBus_TX.data.byte[4] = 0;
CANBus_TX.data.byte[5] = 0;
CANBus_TX.data.byte[6] = 0;
CANBus_TX.data.byte[7] = 10;
Can0.sendFrame(CANBus_TX);
}
void CANBUSRX()
{
CAN_FRAME CANBus_RX;
if (Can0.available() > 0)
{
Can0.read(CANBus_RX);
Serial.print(F(">>>>>>>>>> Received CANBUS!!! "));
Serial.println(CANBus_RX.id,HEX);
}
}
LOOP:
void loop()
{
CANBUSTX();
CANBUSRX();
}
Of course i had simplified the sketch. Arduinos are sending not only constant values, but values read from sensors (byte format).
What can be wrong? With MCP2515 on arduinos and sn65hvd230 on ESP32 (example), they works very well.
Thanks for any help
Regards
Alex
The text was updated successfully, but these errors were encountered: