Serial communication over GPIO Pin

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
jmpratt
Posts: 1
Joined: Fri Jan 19, 2018 4:29 pm

Serial communication over GPIO Pin

Post by jmpratt » Fri Jan 19, 2018 4:35 pm

Hello all,
I'm exploring the idea of implementing the SPI-12 protocol (http://www.sdi-12.org/current_specifica ... 1-2017.pdf) over a GPIO pin. It's only 1200 baud, so not super fast. Is there a module that I should start with? (onewire?) I haven't been able to find anything for communicating over GPIO pins, just controlling them.

I understand the SPI-12 has 5V logic levels. I will use a level shifter to handle that.

cefn
Posts: 230
Joined: Tue Aug 09, 2016 10:58 am

Re: Serial communication over GPIO Pin

Post by cefn » Tue Jan 23, 2018 9:54 pm

Do you mean the SDI-12 protocol as per the document you linked to. SPI is a different thing, which incidentaly has hardware support in e.g. the ESP8266.

I don't have expertise in this protocol, but it could perhaps be useful for someone to know what MCU you are using to be able to guide you. Though I haven't got into the document in much detail, I wonder if using UART or SPI support (which already exists) might be a useful place to start, as it should enable you to dispatch and receive data at a specific baud rate, so you can then figure out how to logic-shift to 5V and wire up the bus as per SDI-12.

http://docs.micropython.org/en/v1.9.3/e ... .UART.html
http://docs.micropython.org/en/v1.9.3/e ... e.SPI.html

Post Reply