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

can2.setClock() resets baud rate of can1 #76

Open
piranha771 opened this issue Apr 18, 2024 · 0 comments
Open

can2.setClock() resets baud rate of can1 #76

piranha771 opened this issue Apr 18, 2024 · 0 comments

Comments

@piranha771
Copy link

piranha771 commented Apr 18, 2024

What did I do

I use 2 CAN objects in my firmware. can1 and can2:

    // Setup
    can1.begin();
    can1.setClock(CLK_60MHz);
    can1.setBaudRate(125'000);
    can1.setMaxMB(16);
    can1.enableFIFO();
    can1.enableFIFOInterrupt();
    can1.onReceive(onCan1Receive);

    can2.begin();
    can2.setClock(CLK_60MHz);
    can2.setBaudRate(250'000);
    can2.setMaxMB(16);
    can2.enableFIFO();
    can2.enableFIFOInterrupt();
    can2.onReceive(onCan2Receive);

Expected behavior

After setup:
can1.getBaudRate() result is 125'000

Observed behavior

After setup:
can1.getBaudRate() result is 0

Additional information:

when a debug print is placed in the method setBaudRate you can see that this method is called multiple times with 0 when on any canbus object .setClock() is called.

@piranha771 piranha771 changed the title can2.begin() resets baud rate of can1 can2.setClock() resets baud rate of can1 Apr 18, 2024
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