Edge detection
I know that some of the pins can be set up in a way that it detects a change in the Voltage level, and then it does some specific code. I am using an SX52 protoboard and I want to assign one pin to detect a voltage level change, of course I want this to be done in SX/B.
In my project, the robot, when it goes into a charging mode, "... this pin is high(5V)". I will have that pin connected to a pin on the SX52 protoboard, so when the protoboard detects the pin at 5V, it will know that it is made the connection between the robot charge surface, and the charger. At this time I want to have the SX52 protoboard wait until it detects the voltage of 0, which means it has been charged up, now I will have some code to make it do something.
I guess the questions are, 1) Can this be done in SX/B? Since I did not see any commands that I recognized to achieve this. 2) Can this be done without using an isr? I am using serin/serout extensively, so I do not want to mess things up in area. As a side note, the SX52 protoboard is a slave to the Prop protoboard; I have them connected up at 230400 BAUD with no problems what so ever. I may, at this time, try to boost up the BAUD rate, to see at what point this all starts to fall apart.
Any advice on this will be appreciated.
Thanks
Ray
In my project, the robot, when it goes into a charging mode, "... this pin is high(5V)". I will have that pin connected to a pin on the SX52 protoboard, so when the protoboard detects the pin at 5V, it will know that it is made the connection between the robot charge surface, and the charger. At this time I want to have the SX52 protoboard wait until it detects the voltage of 0, which means it has been charged up, now I will have some code to make it do something.
I guess the questions are, 1) Can this be done in SX/B? Since I did not see any commands that I recognized to achieve this. 2) Can this be done without using an isr? I am using serin/serout extensively, so I do not want to mess things up in area. As a side note, the SX52 protoboard is a slave to the Prop protoboard; I have them connected up at 230400 BAUD with no problems what so ever. I may, at this time, try to boost up the BAUD rate, to see at what point this all starts to fall apart.
Any advice on this will be appreciated.
Thanks
Ray
Comments
Firstly, why can't you just check the pin state with "IF pinx = 1 THEN" ???
Do you really NEED an interrupt ?
You can use the WKPND_B register to see if an edge occured on one of the RB pins. This register gets set when the pin changes state. Even if the state change is just a very fast pulse (that you would miss if you just polled the pin state).
More details please...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
Thanks
Ray