Reading the state of a BS2 pin from SX
BobH
Posts: 33
Pretty new to the SX chip and I'm stymied by a problem that should be pretty easy. All I want to do is have an SX pin monitor the state of a BS2 pin. No interrupts needed or anything complicated I just need to be able to determine if the BS2·pin is high or low.
Been trying but can't seem to get it to work. Any help would be appreciated. Using SX/B and a SX28 chip
Thanks
Bob
Been trying but can't seem to get it to work. Any help would be appreciated. Using SX/B and a SX28 chip
Thanks
Bob
Comments
1. Monitor the voltage in such a way that when the pin goes high, it places the 5v on a line into the SX, and the SX detects this.
2. Create some form of comms protocol between the SX - BS2, so that when the BS2 pin goes high it sets a status flag. Transmit the value of the flag to the SX from the BS2.
3. Use some form of sensor set-up, such as an led and a photodetector. When the BS2 pin goes high, the led lights up, and the detector registers this. Other sensors could be used, but the idea is the same.
If you are trying to monitor an input to the BS2 you could tie the BS2 and SX inputs together and hope that have the same logic thresholds.· It may be better for the BS2 to read its input pin, and then put the result out on another pin that is tied to the SX.
Dave
I'm trying to use the SX chip to run two servos on pins RB1 and RB2. No problem with that code.
Now I'm just trying to have the BS2 send a signal to turn on and off the servo routine. Using an active high (or an actove low) switch connected to RC7 works but as soon as I use the BS2 as the switch it doesn't work. They are on seperate power supplies but the grounds are tied.
I'm sure I'm missing something very simple here but it's driving me crazy. A code snippet and/or a wiring diagram would be very much appreciated.
Thank you for your time.
Bob
Nate
Post Edited (Nate) : 7/17/2006 3:25:55 PM GMT
It sounds like the SX is working correctly, since it works OK with a switch driving the input pin. The problem must with the BS2. You should verify that the BS2 is driving the output pin correctly by checking it with a voltmeter or put an LED with a series resistor on the output pin.
Dave
I'm very new to the SX chip but slowly working it out.
Thanks for the help.
Bob
We probably could have had it figured out in a couple minutes.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"Remember, you are unique, just like everyone else." Unknown.
·