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

Set clock fequency #3

Open
ssshake opened this issue Oct 13, 2021 · 3 comments
Open

Set clock fequency #3

ssshake opened this issue Oct 13, 2021 · 3 comments

Comments

@ssshake
Copy link

ssshake commented Oct 13, 2021

Hey there, really excited to have found your project. I have an e90 cluster and I'm able to get most things working using some code snippets you pasted onto the arduino forums.

I'm not experience with platform io. I have created a new env for arduino Uno.

For my shield it's an 8mhz clock. In my original INO I just had to do this:

CAN.setClockFrequency(8E6);

But in your CPP code I get this error:

src\main.cpp:30:7: error: 'class MCP_CAN' has no member named 'setClockFrequency'

I'm just not sure what to do, I think this is the only impediment I have to get this working!

@ssshake
Copy link
Author

ssshake commented Oct 13, 2021

I just noticed you are using the seeed-studio library but you had switched to a different one in your arduino posts. You were using Arduino-CAN.

Can you confirm which is correct at present?

@Marcin648
Copy link
Owner

Marcin648 commented Oct 13, 2021

Hi! I have never posted on Arduino Forum. 🙃 Seeed-studio library do not allow to change CAN clock frequency, but i tested on Arduino Nano that it's work if you change CAN_BAUD_RATE from CAN_100KBPS to CAN_200KBPS in configuration.h.
In future I probably change this library to better one. https://github.com/autowp/arduino-mcp2515 looks nice.
Thanks for interest in this project. 😃

@ssshake
Copy link
Author

ssshake commented Oct 14, 2021

Strange I don't know how I have you mixed up with someone else. Anyway very nice work, been studying your code base. I have an e90 cluster mostly working in a real dashboard too!

I can't seem to get RPMs to work but everything else seems to work fine. I will spend more time at it.

My issue is with the crystal frequency, not the can bus frequency. My shield has an 8Mhz crystal instead of 16Mhz. I'm not experience with c++ to know how to change that. I will take some time and learn. Thanks!

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

2 participants