flyboy013 / DEF_Sensor_Emulator_Firmware

This repository contains the compiled Arduino Due sketch for emulating a Diesel Exhaust Fluid (DEF) head.
12 stars 2 forks source link

CS on Pin 10? #5

Closed hfb3 closed 2 years ago

hfb3 commented 2 years ago

Is there any way to get the firmware compiled with CS connected to pin 9 instead of pin 10?
I have several Can-Bus V1.2 boards that DO NOT have the selection pads on the back of the board.

Harry

flyboy013 commented 2 years ago

Which platform (Due, Uno, etc) would you need it for?

hfb3 commented 2 years ago

Uno

flyboy013 commented 2 years ago

The code is currently using pin 9 for SPI CS.

#if defined(ARDUINO_AVR_LEONARDO)
  const int SPI_CS_PIN = 17;    // This is for the Seeed CanBed board using atmega32U4 chip
#else
  const int SPI_CS_PIN = 9;     // This is for UNO/ATMega using Seeed CAN shield V2.0
#endif
hfb3 commented 2 years ago

My bad. I mixed up the pins when I was looking at the specs.. I should have requested Pin 10 and not Pin 9.

const int SPI_CS_PIN = 10;

hfb3 commented 2 years ago

https://www.cytron.io/p-elecfreaks-can-bus-shield

You can clearly see the trace going to pin 10.

Thanks

flyboy013 commented 2 years ago

I have updated the code to use pin 10. The attached zip file contains the hex file to load onto the Uno. The baseline has not been updated and since your HW deviates from the recommended configuration I'm unable to provide any support. We have not tested with the HW you are using.

DEF_Sensor_Emulator_CS10.ino.standard.hex.zip

flyboy013 commented 2 years ago

Issue title updated to reflect request to use pin 10 (not 9) for CS.

hfb3 commented 2 years ago

That is fine. I will test it and post an update once done.

Thank you very much.

hfb3 commented 2 years ago

Worked like a charm.

Thanks

Harry