Controlling the PSC from a microcontroller programmed in C
Pengatom
Posts: 21
Hi!
I've just started a project including a microcontroller and the Parallax Servo Controller. This mC is programmed in C, and my programming skills are not entirely steady [noparse];)[/noparse]
Earlier I've programmed BS and JS using PBASIC and java...
The first thing I want to do is testing that everything works, that is, a program in C that works like this one in java :
http://forums.parallax.com/attachment.php?attachmentid=37719
regards
Pengatom
I've just started a project including a microcontroller and the Parallax Servo Controller. This mC is programmed in C, and my programming skills are not entirely steady [noparse];)[/noparse]
Earlier I've programmed BS and JS using PBASIC and java...
The first thing I want to do is testing that everything works, that is, a program in C that works like this one in java :
http://forums.parallax.com/attachment.php?attachmentid=37719
regards
Pengatom
Comments
My intention isn't to have someone else write my entire project.
It is more of how to set up the communication bit, the format of the message to the PSC I hoped to get som help to...
regards
Pengatom
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1 + 1 = 10· |· 4 + 4 = 10· |· 5 + 5 = 10· |· 8 + 8 = 10
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
8 databits
not to use parity
interrupt enable
and baudrate 2400 (at startup anyway)
The uart has "One transmit and one receive channel (full duplex)", so I guess I have to make a connection like this then? (see attachment)
However the ports can have 3 states, In - Out - InOut
Atm·they are Tx - Out and Rx - In.
Do I need the interrupt, or should I just remove it?
regards
Pengatom
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1 + 1 = 10· |· 4 + 4 = 10· |· 5 + 5 = 10· |· 8 + 8 = 10
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I'm doing this babysteps, writing some code for talking to a terminal, and expanding it from there.
Study to exam during the day, and then an hour (or so) with programming in the evening [noparse];)[/noparse]
Thanks for the help anyway, hopefully I will get it to work soon [noparse]:)[/noparse]
regards
Pengatom
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1 + 1 = 10· |· 4 + 4 = 10· |· 5 + 5 = 10· |· 8 + 8 = 10
Post Edited (Pengatom) : 12/5/2005 8:06:34 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
the psc data line. I suggest 220 ohm between Tx and Rx line.
You find a javelin psc class here. Javelin java is easily converted to C.
http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/peripheral/servo/psc/
regards peter