Looks I may have lost my other post on the new SourceForge site/changeover? If it reappears when switching back to the new site, then this will look like a double post.
Try a NRZ scheme of encoding a signal, Wiki or Google that. Another way is adding a clock to that, which is called Manchester encoding. In the NRZ scheme the high state is achieved by putting a pullup resistor, (or internal pullup?) on the data pin. A one's state is acheived by making the data an input 'dir GPIO.x in'. A zero's state is achieved by making the data pin an output 'dir GPIO.x out', and then 'Set GPIO.x Off'
You could have all your slaves sitting in a loop checking to see when GPIO.x goes low for a period that is longer than a two byte transmission (i.e. Synch pulse). Master code would send synch pulse, slave address, dummy termination byte, then goto RCV_Pulse and wait for synch pulse back from slave, then goto RCV_Pulse for slave data, RCV_Pulse slave termination byte, then start all over again.
Get that working, then maybe add interrupt code to wake up from sleep and do something then go back to sleep.
Note: A Slave needs to send a second termination byte that would flag other slaves to ignore the case when a slave sends a synch pulse, then a data byte that matches another slaves address!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Isn't there a way to just have them all on the same line and when "xxx" comes down the wire they all get it but only the one that is looking for "xxx" sends out it's a/d readings on a seperate send line( seperate rx and tx pins on pic) ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to put several pics on the same lines and have them tx when they get a unique rx each, what would be the code to do this? on 12 series pics
Looks I may have lost my other post on the new SourceForge site/changeover? If it reappears when switching back to the new site, then this will look like a double post.
Try a NRZ scheme of encoding a signal, Wiki or Google that. Another way is adding a clock to that, which is called Manchester encoding. In the NRZ scheme the high state is achieved by putting a pullup resistor, (or internal pullup?) on the data pin. A one's state is acheived by making the data an input 'dir GPIO.x in'. A zero's state is achieved by making the data pin an output 'dir GPIO.x out', and then 'Set GPIO.x Off'
You could have all your slaves sitting in a loop checking to see when GPIO.x goes low for a period that is longer than a two byte transmission (i.e. Synch pulse). Master code would send synch pulse, slave address, dummy termination byte, then goto RCV_Pulse and wait for synch pulse back from slave, then goto RCV_Pulse for slave data, RCV_Pulse slave termination byte, then start all over again.
Get that working, then maybe add interrupt code to wake up from sleep and do something then go back to sleep.
Note: A Slave needs to send a second termination byte that would flag other slaves to ignore the case when a slave sends a synch pulse, then a data byte that matches another slaves address!!
Isn't there a way to just have them all on the same line and when "xxx" comes down the wire they all get it but only the one that is looking for "xxx" sends out it's a/d readings on a seperate send line( seperate rx and tx pins on pic) ?
Does anybody know of a way?