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

sends 2 messages at once when I add multiple values to a frame #66

Open
Loverboy7000 opened this issue Aug 3, 2021 · 0 comments
Open

Comments

@Loverboy7000
Copy link

Loverboy7000 commented Aug 3, 2021

Hey,

I run in an issue with a custom board I made (uses an Atmega328PB), but it feels like this is a general issue. If I send a message adding only 1 value everything works fine.
For example this is ok:

    canMsg1.can_id  = CANID;
    canMsg1.can_dlc = 8;
    canMsg1.data[1] = A0_Value;
    canMsg1.data[2] = 0x00;
    canMsg1.data[3] = 0x00;
    canMsg1.data[4] = 0x00;
    canMsg1.data[5] = 0x00;
    canMsg1.data[6] = 0x00;
    canMsg1.data[7] = 0x00;

    mcp2515.sendMessage(&canMsg1);

but once I populate the full message it always bursts the message out twice when calling sendMessage.
Does someone have an idea whats wrong here?:

    canMsg1.can_id  = CANID;
    canMsg1.can_dlc = 8;
    canMsg1.data[0] = highByte(A0_Value);
    canMsg1.data[1] = lowByte(A0_Value);
    canMsg1.data[2] = highByte(A1_Value);
    canMsg1.data[3] = lowByte(A1_Value);
    canMsg1.data[4] = highByte(A2_Value);
    canMsg1.data[5] = lowByte(A2_Value);
    canMsg1.data[6] = highByte(A3_Value);
    canMsg1.data[7] = lowByte(A3_Value);
    
    mcp2515.sendMessage(&canMsg1);

Thanks for the help!
Andre

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

1 participant