onewire with uart

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
Post Reply
nui_de
Posts: 40
Joined: Fri Oct 23, 2015 3:27 pm

onewire with uart

Post by nui_de » Wed Mar 30, 2016 5:59 pm

Hi,

i like to write a onewire library using uart for communication with my onewire bus
as described here:
https://www.maximintegrated.com/en/app- ... mvp/id/214

Is it possible to set the the GPIO01(Tx) to open drain when initializing as uart or
do I need the external open-drain buffer chip?

User avatar
Roberthh
Posts: 2758
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: onewire with uart

Post by Roberthh » Thu Mar 31, 2016 4:09 pm

The ouput driver for a Pin supports open drain mode, which is independent form the seleted alternate function. by accessing the GPIO control registers directly, this could be changed after initilization of the UART. Open drain mode can be selected in the Pin class.
I tried:

Code: Select all

from machine import uart, Pin
uart = UART(0,9600)
pin= Pin("GP1", mode = Pin.ALT_OPEN_DRAIN, alt=3)
That has put the TX pin to open drain mode, still sending & receiving
Best Regards

nui_de
Posts: 40
Joined: Fri Oct 23, 2015 3:27 pm

Re: onewire with uart

Post by nui_de » Fri Apr 01, 2016 1:29 pm

Thanks Robert,

I will try that out and hopefully have a new and fast onewire library soon ;)

Post Reply