Skip to content

using the entire frame structure in the arduino code for mcp2515 #26

Open
@krish97git

Description

@krish97git

Hey i'm trying to interface arduino and mcp2515 with busmaster through a Peak USB device.
But since there is some problem with the usage of the frame structure, bus master is neither able to transmit or receive data. So the question is how do I code the entire frame for transmitting or receiving. Examples maybe Start of frame, Arbitration field and the control field. The code needs to follow the same format.
canMsg.can_id = 0x036; //CAN id as 0x036
canMsg.can_dlc = 8; //CAN data length as 8
canMsg.data[0] = h; //Update humidity value in [0]
canMsg.data[1] = t; //Update temperature value in [1]
canMsg.data[2] = 0x00; //Rest all with 0
canMsg.data[3] = 0x00;
canMsg.data[4] = 0x00;
canMsg.data[5] = 0x00;
canMsg.data[6] = 0x00;
canMsg.data[7] = 0x00;
mcp2515.sendMessage(&canMsg); //Sends the CAN message

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions