Hey,
I am not sure if this is the correct forum, or perhaps "Networking, Protocols, and Devices" since this may be a protocol issue.
I'm using an Arduino Pro Micro (https://www.sparkfun.com/products/12640) to communicate with my car's radio unit.
The protocol is called MELBUS and is detailed here - http://volvo.wot.lv/wiki/doku.php?id=melbus
Using this code - GitHub - archi/melbus: Implementation of a node for MELBUS, as used in older Volvo cars.
I am able to read data from the radio unit but the problem is that I keep on getting different readings.
For example:
The radio unit sends a broadcast to all connected devices to query the kind of device connected.
To do that, the radio unit will send this sequence: 0x07, 0x1a, 0xee
The problem is that I am receiving all kinds of variations of this:
0x07, 0x1a, 0xef
or
0x07, 0x2a, 0xee
or
0x07, 0x2b, 0xee
or
0x07, 0x2b, 0xef
As you can see, the difference is usually around 1-2 bits. (Its weird that the first byte usually doesn't get screwed up..)
Since the data seems synced (bits are in the correct place and are not missed, a byte is read successfully), I don't think it has anything to do with the clock pin and because usually there seems to be extra 1 bits I am thinking that the logic level of the data pin is too high for my arduino.
Measuring the voltage on the pins from the radio unit I get a range of 0-4.7V which should be within the range the arduino will read 0 and 1.
Am I wrong here? Should I put a pull up or pull down resistor? A capacitor maybe? A regulator maybe?
Currently I connected the arduino directly to the radio unit pins without any electronics in between.
Has anyone had a similar problem? Where extra 1 bits appeared when reading data?
(It would be very helpful if someone could also explain why this is happening and why the solution would help)
Thanks alot in advance!