Marcin648 / e90-dashboard-ets2

GNU General Public License v3.0
22 stars 10 forks source link

Set clock fequency #3

Open ssshake opened 3 years ago

ssshake commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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!