hello
I am trying to communicate between a PIC12F1280 and an STM32F411 using OneWire .
I chose OneWire cos the PIC has few I/O pins .
I just wanted to Know if this is possible before dedicating the time for it .
So far I can see 2 issues :
1 , The One wire component is designed to be the host and dose not have any ROM identifier .
for this can do skip rom since there will be only 2 devices ?
2, Both of the MCU will be Host ( Master ) can they still communicate ?
Do we have a OneWire slave component in flowcode ?
OneWire Com between 2 MCU's
-
- Posts: 170
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 7:23 pm
- Has thanked: 51 times
- Been thanked: 22 times
-
- Valued Contributor
- Posts: 180
- Joined: Wed Dec 02, 2020 7:28 pm
- Has thanked: 73 times
- Been thanked: 63 times
Re: OneWire Com between 2 MCU's
You need one host and a slave, two hosts can”t communicate using one-wire. Given that one-wire is very timing critical I would suggest looking at alternate options. If you have a second free pin software serial springs to mind.
-
- Valued Contributor
- Posts: 1133
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 114 times
- Been thanked: 596 times
Re: OneWire Com between 2 MCU's
The timing is fairly 'loose' for 1-wire (see https://en.wikipedia.org/wiki/1-Wire) It would be surely possible to implement a 'slave' component (or just protocol)
The master sends a low pulse (reset) to start comms - after which slaves reply b holding the bus low. The pulses need to be within 'limits' (<15us for 1 and >60us for 0) which should be easily achievable on an MCU?
But yes - serial, i2c etc would be easier?
Martin
The master sends a low pulse (reset) to start comms - after which slaves reply b holding the bus low. The pulses need to be within 'limits' (<15us for 1 and >60us for 0) which should be easily achievable on an MCU?
But yes - serial, i2c etc would be easier?
Martin
-
- Valued Contributor
- Posts: 180
- Joined: Wed Dec 02, 2020 7:28 pm
- Has thanked: 73 times
- Been thanked: 63 times
Re: OneWire Com between 2 MCU's
Have you used one-wire devices with PIC controllers? With the official ones you’ll be hard pushed to use them with a PIC that isn’t running at least 4MHz and even then you might have timing issues. (I still have stock of hundreds of 1-wire devices from the time DalSemi produced them, haven’t used them for the last 5 years because of the timing issues)The timing is fairly 'loose' for 1-wire
-
- Valued Contributor
- Posts: 1133
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 114 times
- Been thanked: 596 times
Re: OneWire Com between 2 MCU's
Not with PIC no.... Something running at a reasonable speed (32MHz - 8MHz instruction rate) should be okay though?
The wikipedia page made it look so easy too - though generating the '1' pulse would be the sticking point on a slow MCU - the slave only has to check that the line is still low at about 30us?
I got some of the 1024 bit eeproms working nicely with an Arduino recently (and some iButtons - which just seem to be a unique id tag)
Martin
The wikipedia page made it look so easy too - though generating the '1' pulse would be the sticking point on a slow MCU - the slave only has to check that the line is still low at about 30us?
I got some of the 1024 bit eeproms working nicely with an Arduino recently (and some iButtons - which just seem to be a unique id tag)
Martin
Re: OneWire Com between 2 MCU's
Hello again
Well good thing I asked before trying , I think a One wire slave would be a good addition to flowcode 10
maybe I should post a request on Feature Request for this .
I stand to correction but I think
As in almost all comm protocols timing is important, although 1 wire dose not have a specific baud rate
it relays on timing to distinguish from 1 to 0 , timing is in us so I guess it wont be possible with an MPU running at low frequency
.
.
Thanks for your help I will look for an Alternative .
Well good thing I asked before trying , I think a One wire slave would be a good addition to flowcode 10
maybe I should post a request on Feature Request for this .
I stand to correction but I think
As in almost all comm protocols timing is important, although 1 wire dose not have a specific baud rate
it relays on timing to distinguish from 1 to 0 , timing is in us so I guess it wont be possible with an MPU running at low frequency
.
.
Thanks for your help I will look for an Alternative .
Last edited by Alan_37 on Mon Jun 17, 2024 4:05 pm, edited 1 time in total.
-
- Valued Contributor
- Posts: 180
- Joined: Wed Dec 02, 2020 7:28 pm
- Has thanked: 73 times
- Been thanked: 63 times
Re: OneWire Com between 2 MCU's
Atmel chips run at high instruction rates compared to most 8 bit PICs. Trust me, getting the sample point timing right is a challenge.mnfisher wrote: ↑Mon Jun 17, 2024 3:23 pmNot with PIC no.... Something running at a reasonable speed (32MHz - 8MHz instruction rate) should be okay though?
The wikipedia page made it look so easy too - though generating the '1' pulse would be the sticking point on a slow MCU - the slave only has to check that the line is still low at about 30us?
I got some of the 1024 bit eeproms working nicely with an Arduino recently (and some iButtons - which just seem to be a unique id tag)
Martin