RC pulsin in SX assembly ?
Rob v.d. berg
Posts: 89
Hello,
I'm thinking to use the SX ships to make some timing critical·think as RC pulsin (1-2msec) with· high resolution < 2usec·variable 0-1000/0-1500. But I have no experience with the SX/B in assembly.
Can someone give me some hints to get a idea how the assembly looks like when I want to make this. Maybe there is already assembly for reading the Radio Control pulses ?
Any help is welcome
Regards
Rob.
I'm thinking to use the SX ships to make some timing critical·think as RC pulsin (1-2msec) with· high resolution < 2usec·variable 0-1000/0-1500. But I have no experience with the SX/B in assembly.
Can someone give me some hints to get a idea how the assembly looks like when I want to make this. Maybe there is already assembly for reading the Radio Control pulses ?
Any help is welcome
Regards
Rob.
Comments
PULSIN has a resolution of 10uSeconds.
If you need more than that, it's fairly easy, but you'll have to deal with numbers that are larger than a byte.
Can you give more details ? What are you going to do with the values after to measure them ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"It's not getting what you want, it's wanting what you've got."
·
Thanks for your reply. Depending on two R/C pulses (1-2msec) i want to control the 4 (X) ruder of my submarine.
Both R/C channels are mix inside the sender, and must go to 4 servo's. Depending on the horizontal state and depth of the sub, the 4 ruders must by changed (PD algoritme). The sensors are connected to a LTC1298 AD converter (12bits) 0-5 volt = ~0-4096.
To control the servo's there are two opties:
1- by uart >> Parallax Servo Controller (2usec) variable must by 500-1000
2 -by making PWM's with atleast 2usec resolution.
I was busy to make it in the Javelin, but the resolution of the Pulsin (8,68usec) is for my to big. And the cyclus time is not fast enough.
When i look for the PulsIn SX/B and use the 1usec resolution the max puls length is 255usec ?.
Regards
Rob.
With all that you have going on, I would use a 2usec interrupt routine to handle it all.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"It's not getting what you want, it's wanting what you've got."
·
Can you give me some code idea, how a interrupt routine for the SX looks like ?
Regards
Rob.
Inside the interupt you can make the pin alternate high and low every other entry giving you a 500kHz square wave, 1us high, 1uS low.
for reading·pulses i must·check every usec the status·of the pin!, and set a counter
Rob.