Maker Pro
Maker Pro

What protocol?

Rod Thompson

Oct 27, 2017
1
Joined
Oct 27, 2017
Messages
1
I have a small circuit board that is part of a larger circuit.

This small circuit board consists of an Tiny45, a resistor and 3 connection pins which link to the larger circuit.

I want to develop my own device for reading these boards using a Raspberry Pi.

Using the multimeter I was able to determine the 3 connection pins as corresponding to Vcc, GND and PB0.

How would I determine the communication protocol and access the information ? Given that there is only one connection could it only be a 1-wire ?
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
In a serial comms situation there has to be a synchronising pulse and the key to identifying the protocol is identifying where these sync pulses occur. You can then count the pulse BETWEEN the sync pulses and figure out the word length and go from there.

Given that most protocols are 'set' these days it is sometimes easy to recognise the patterns they create and many modern DSO's (digital storage oscilloscopes) have built-in decoding for them and will display the data accordingly.

Accordingly you will need to analyse the data signal using a 'scope to get a clear picture (no pun intended). You could, of course, feed it to a serial port monitor program and try various settings to see what turns up - bit of a hit and miss situation but sometimes pays off.
 

Pieter Kralt

Oct 19, 2016
9
Joined
Oct 19, 2016
Messages
9
First of all you have to realise that a raspberry pi interface is not 5V resistant. You have to go down to 3.3V if the PB0 outputs 5V signals.

If you can get no other information about this signal, the best way is using a logic analyzer to catch and store this signal. You may need two channels, one with a pull up - and one with a pull down resistor. Once stored you can try to "analyse" the signal. By comparing the channels you can find undefined outputs (tri-state) if any. Then you have to look at the bit patterns to recognise the code used. Most likely it's a type of async.

As logic analysers are not very common, search the internet for a raspberry pi program to do this job. (And hope it is fast enough.)

petrus bitbyter
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,769
Joined
Nov 17, 2011
Messages
13,769
PB0 is a multifunctional pin offering these options: MOSI/DI/SDA/AIN0/OC0A/OC1A/AREF/PCINT0
Since SPI (using MOSI) would require use of a clock signal but the interface of interest uses only PB0 I exclude SPI as a possibility.
I²C also requires separate clock and data lines and can therefore be exluded.
What's reasonably left (apart from some obscure selfmade protocol) is 1-wire as the communications format.
 
Top