Shop OBEX P1 Docs P2 Docs Learn Events
Pan bus — Parallax Forums

Pan bus

Cole LoganCole Logan Posts: 196
edited 2009-04-09 21:09 in Propeller 1
I have been working on my own little project for a little while· Its a Propeller area network. I had origanlly planed on using this for a home automation project that I had. But it has seens become a lot bigger then that.

The·idea of the bus is using two line for communication and one line for addressing.
                   
                       3.3v
Master Prop   TX  ______|__________RX  Slave Prop
 
                       3.3v
              RX  ______|__________TX
 
              ADD _________________ADD

The master pulls the Addrress line high when it wants to start talking to another slave. It then sends a byte containg the addess to the slave prop. The slave that has the address then responds by sending the address back to the master.·The master then pulls the address line back low. Then sends and recieves·any commands·and or data·with the slave. When it is done talking to the slave it sends 255.

So far I have tested the system with 1 master·up to 3 slaves.·My original test program was just to blink LED a set amount of times. I then add the ability to have it have one of the props do some math on the data passed·to it and then send the result back. That program is on the first attachment.

I then started to wondering if I could use it to control a TV that way I could get around the problem of not having enough memory to do a whole lot once you were driving a TV. I now have the slave running the TV driver and graphics driver with the abilitly to acces all the fuctions of the graphics driver. Though I still need to do some code shrinking because I only have enough room for a few pix.· This is in my secound attachment.

There are still a few things that I need to do. One of the big things is to add the abiltiy for the master to recognize that the slave is missing. and I want to make the slave recognize that the master has messed up and or is no longer present.

So tell me a what you guys think of it. Also if you have any way to improve it let me know.

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2009-04-09 20:11
    You could periodically send a ping command to each adress. The slave has to answer that within a given timeframe. If the master does not recieve the answer the slave has been disconnected / switched off / whatever. If the slave does not receive a ping within a timeframe it knows the master has gone.
  • Cole LoganCole Logan Posts: 196
    edited 2009-04-09 20:19
    That doesn't seem to bad at all I'll have to work on that tonight. One of the problems that I have had is when I was prototyping I would leave·one of the boards·running but update the other board.·Every once in a while it would hang because the master had already started to communicate with the slave. And it couldn't recognize that the slave wasn't responding. So have a simple time out routine would work pretty good.
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-04-09 20:46
    There are versions of the FullDuplexSerial which allow to specify a timeout for receiving. This should help in that case.
  • Cole LoganCole Logan Posts: 196
    edited 2009-04-09 21:09
    The fullduplex that I'm using has this and when I first started working on this project I tried using it but wasn't sure if the problems I was having was with it or the rest of my code. So I pulled it out but now that I know the code works I think I will add it back in.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1986 Chevy EL Camino·· No prop yet

    1984 Suzukie GS1100GK No prop yet
Sign In or Register to comment.