Skip to content

Problem with CAN BUS Receive Data  #135

Closed
@Shoihya

Description

@Shoihya

Hello everyone,

i am trying to test Recieve and send signal using Seed-Arduino CAN Shield V2.0 using arduino Mega 2560 the sending signal working good actualy. but i have issue with recieve data:

The problem is that the code cannot get the data length and always get it zero so i cannot got the write signal as i need it to programm some digital stuff.

Aslo the Loop didnot want to work until i put (CAN_MSGAVAIL != CAN.checkReceive())
insteadt (CAN_MSGAVAIL = CAN.checkReceive()) . I have no idea why !

What i understand from the syntax example code that:
1- len=0 is a defined var will be filled as soon as the data length will delivered then gonna use this data to read it or control something else.

2- [[ CAN_MSGAVAIL == CAN.checkReceive() ]] this line is for checking if data is comming and will not be equal until data is comming, howerver if i send data throw CAN.
Actually (CAN_MSGAVAIL != CAN.checkReceive()) working and allow the loop to continiue. but the further Loop (for Loop) didn't work as "len" always equal zero cause it didn't get the new value.

I am testing the send and recieve using CANoe Software and i only can see the data that i send, but i cannot read this data back to my Arduino Program.

Questions:

Is there anyway to check/Solve that or should i add something in the code.

I hope my attached code lead u to find the issue.

Thanks
Ahmed

CANoe_Signal_Test
Reciev_Send_Can_Test.zip

Metadata

Metadata

Assignees

Labels

Seeed_Arduino_CANLabel for Seeed_Arduino_CANUAYUnassigned yet

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions