Connect with us

What protocol?

Discussion in 'Microcontrollers, Programming and IoT' started by Rod Thompson, Oct 27, 2017.

Scroll to continue with content
  1. Rod Thompson

    Rod Thompson

    1
    0
    Oct 27, 2017
    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 ?
     
  2. kellys_eye

    kellys_eye

    4,276
    1,146
    Jun 25, 2010
    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.
     
  3. Pieter Kralt

    Pieter Kralt

    9
    1
    Oct 19, 2016
    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
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    10,220
    2,201
    Nov 17, 2011
    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.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-