photomankc
New Member
Hello all,
I'm a recent newb to the PICAXE world coming from the Arduino/Parallax Prop background. Part of the design for a robot I'm working involved using the PICAXE to handle some of my sensor work so the main controller can spend time doing high level work not dinking with polling sensors. One place I wanted to use it was monitoring about 8 IR proximity sensors and then allowing the main processor to querry the state via serial so rather than 8 lines it could use just two. My long term plan was to use I2C but I bought the 18M2 before I understood they can't do I2C slave mode. Anyway I wanted to see if I could make lemonade anyway with the 18M2 while I wait for the 20X2.
The idea is that it has 4 lines that act like a standard priority encoder so it outputs 0-7 binary on three lines plus an Attention line that indicates some input is active. In addition I want it to stream out data over a serial output when any sensor is tripped. This means you can get the full binary value not just the single highest bit and just 1 pin is really needed as long as you can live with the timing of serial. I have that working and I've used just about all the pins now. One pin is used to select either a 20ms or 50ms debounce cycle so I think I have one more left over besides the programming tx/rx pins.
For now, I have been using the sertxd to send the stream over the programming tx pin. Works fine. However, as I understand it that is inverted from the normal serial signal that most other devices would expect so that's not the ideal way to do go I think. I guess I can use that one last pin for the high speed serial setup but I was kind of hoping to think of a way to use that pin to allow for making it more programmable (debounce delay, debounce cycles, ect). I see a few places where I can use this for a number of tasks like buttons, PIR sensors, bump switches, and others so I'd like to keep it flexible.
As it stands now:
B.0 - B.7 are Inputs
C.0 - C.2 are the Priority Encoder outputs (0-7)
C.7 is the Attention output
C.5 is the 20/50ms selection input
C.3-C.4 are the programming pins
C.6 is open
So in summery:
Is the output from sertxd always inverted, can I change that in other than a hardware solution?
Even if not I think it may be worth it to add a hardware inverter because I could then keep the other open pin for use as a background serial recieve with hserin to allow programming it a bit and maybe also go from streaming the serial value to only sending it when requested.
Hope I didn't ramble too much here.
I'm a recent newb to the PICAXE world coming from the Arduino/Parallax Prop background. Part of the design for a robot I'm working involved using the PICAXE to handle some of my sensor work so the main controller can spend time doing high level work not dinking with polling sensors. One place I wanted to use it was monitoring about 8 IR proximity sensors and then allowing the main processor to querry the state via serial so rather than 8 lines it could use just two. My long term plan was to use I2C but I bought the 18M2 before I understood they can't do I2C slave mode. Anyway I wanted to see if I could make lemonade anyway with the 18M2 while I wait for the 20X2.
The idea is that it has 4 lines that act like a standard priority encoder so it outputs 0-7 binary on three lines plus an Attention line that indicates some input is active. In addition I want it to stream out data over a serial output when any sensor is tripped. This means you can get the full binary value not just the single highest bit and just 1 pin is really needed as long as you can live with the timing of serial. I have that working and I've used just about all the pins now. One pin is used to select either a 20ms or 50ms debounce cycle so I think I have one more left over besides the programming tx/rx pins.
For now, I have been using the sertxd to send the stream over the programming tx pin. Works fine. However, as I understand it that is inverted from the normal serial signal that most other devices would expect so that's not the ideal way to do go I think. I guess I can use that one last pin for the high speed serial setup but I was kind of hoping to think of a way to use that pin to allow for making it more programmable (debounce delay, debounce cycles, ect). I see a few places where I can use this for a number of tasks like buttons, PIR sensors, bump switches, and others so I'd like to keep it flexible.
As it stands now:
B.0 - B.7 are Inputs
C.0 - C.2 are the Priority Encoder outputs (0-7)
C.7 is the Attention output
C.5 is the 20/50ms selection input
C.3-C.4 are the programming pins
C.6 is open
So in summery:
Is the output from sertxd always inverted, can I change that in other than a hardware solution?
Even if not I think it may be worth it to add a hardware inverter because I could then keep the other open pin for use as a background serial recieve with hserin to allow programming it a bit and maybe also go from streaming the serial value to only sending it when requested.
Hope I didn't ramble too much here.