I am using a SparkfunOBD-UART board to connect to a Mega. My software sketch runs fine getting data via CAN-BUS but only if I power the Sparkfun board by a toggle, off then on If I don't do this the Sparkfun cannot seem to connect to the CAN and no data is RXd.
This is repeatable and seems independent of the ARduino so it is probably something in the protocol of the Sparkfun .. Any ideas as although I could make the power up sequence be such that it all work this happens.s it seems a poor engineering solution as I don't know why this happens.
I am using a SparkfunOBD-UART board to connect to a Mega.
A link would be good.
My software sketch
Sharing it would be good.
but only if I power the Sparkfun board by a toggle, off then on
I haven't a clue how a "toggle, off then on" can provide power. An explanation would be good.
PaulS:
I am using a SparkfunOBD-UART board to connect to a Mega.
A link would be good.
My software sketch
Sharing it would be good.
but only if I power the Sparkfun board by a toggle, off then on
I haven't a clue how a "toggle, off then on" can provide power. An explanation would be good.
The CAN UART board made by Sparkfun when using it with a CAN hi/Lo input via the DB-9 connector needs 12 volts to run. ( This is often from the car's 12 volt battery ) This 12 volts is what I toggle . If it is ON I switch off the 12 volts and then back on again. If OFF alrerady and i switch it on the sketch ruins fine and gets the CAN data. I have checked other sketches and it is not a function of the sketch just something to do with using the ARduino and the Sparkfun board. Unlike most hardware that runs with an Arduino the Sparkfun board does not get any power from the Arduino just needs the 12 volts. Possible it could have just been connected to the +5 on the Arduino but Sparkfun did not plan it that way.
The fact that the same problem occurs with different sketches eliminates the Arduino but the post was put here as some of the Arduino uses might have also used a Sparkfun UART-OBD11 board.
I hope this explains the situation better.
Possible it could have just been connected to the +5 on the Arduino but Sparkfun did not plan it that way.
But, you could, with a transistor and a couple of resistors. The Arduino could toggle the pin that the gate is connected to, to cycle the power to the shield.