DavidM
02-09-2007, 11:34 AM
Hi,
I wish to communicate with the PROPELLOR vis SERIAL RS232.
I have the DEVELOPMENT BOARD and the USB2SER adaptor.
Q1) How do I wire up the USB2SER to the Prop.
I believe I need to wire up the USB 2SER as follows, but correct me if I am wrong.
VSS on USB2SER -->VSS on PROP ( next to pin 7 )
RX on USB2SER -->Pin 7 on the Prop
TX on USB2SER -->Pin 6 on the Prop
Q2) I firstly want to send some simple commands from a TERMINAL APPLICATION , using the number 1-8 and then when the prop receives them, the LED's 16 to 23 will flash for a second accordingly
eg
Send "1", LED 16 will flash for a second.
Send '2", LED 17 will flash for a second.
and so on..
I have written some code already, I have installed the FULLDUPLEXSERIAL.SPIN code and I am using that in my code. But I am confused on how to use the commands from that code, Are there any examples, or instructions for the fullduplexserial.spin code?
If I send the number "1" via the Serial terminal application to the PROP, then that is ASCII char(31), I believe, so if I have a case statement with each of the characters 31 to 38 then I should be able to flash an appropriate LED ( i.e 16-23)
here is my code I am using..
'' DAVES SERIAL TESTER
VAR
byte vData
CON
_CLKMODE =XTAL1 +PLL16X
_XINFREQ =5_000_000
rxpin =7
txpin =6
mode =0
baudrate =9600
PUB InitOutputLEDs
dira[16..23]~~ ''Sets all pins from 8 to 23 to outputs
outa[16..23]~ ''turn off all leds
OBJ
FullDuplexSerial : "FullDuplexSerial"
PUB StartSerialTester
FullDuplexSerial.Start(rxpin, txpin, mode, baudrate)
REPEAT
vData:= FullDuplexSerial.rx
CASE vData
$31 : outa[16]~~
$32 : outa[17]~~
$33 : outa[18]~~
$34 : outa[19]~~
$35 : outa[20]~~
$36 : outa[21]~~
$37 : outa[22]~~
$38 : outa[23]~~
waitcnt(20_000_000+CNT)
outa[16..23]~
The above code does not work!, What am I doing wrong? My RX light on the USB2SER is FLASHING, but nothing on the PROP Board is?
Thanks
Dave Metus
I wish to communicate with the PROPELLOR vis SERIAL RS232.
I have the DEVELOPMENT BOARD and the USB2SER adaptor.
Q1) How do I wire up the USB2SER to the Prop.
I believe I need to wire up the USB 2SER as follows, but correct me if I am wrong.
VSS on USB2SER -->VSS on PROP ( next to pin 7 )
RX on USB2SER -->Pin 7 on the Prop
TX on USB2SER -->Pin 6 on the Prop
Q2) I firstly want to send some simple commands from a TERMINAL APPLICATION , using the number 1-8 and then when the prop receives them, the LED's 16 to 23 will flash for a second accordingly
eg
Send "1", LED 16 will flash for a second.
Send '2", LED 17 will flash for a second.
and so on..
I have written some code already, I have installed the FULLDUPLEXSERIAL.SPIN code and I am using that in my code. But I am confused on how to use the commands from that code, Are there any examples, or instructions for the fullduplexserial.spin code?
If I send the number "1" via the Serial terminal application to the PROP, then that is ASCII char(31), I believe, so if I have a case statement with each of the characters 31 to 38 then I should be able to flash an appropriate LED ( i.e 16-23)
here is my code I am using..
'' DAVES SERIAL TESTER
VAR
byte vData
CON
_CLKMODE =XTAL1 +PLL16X
_XINFREQ =5_000_000
rxpin =7
txpin =6
mode =0
baudrate =9600
PUB InitOutputLEDs
dira[16..23]~~ ''Sets all pins from 8 to 23 to outputs
outa[16..23]~ ''turn off all leds
OBJ
FullDuplexSerial : "FullDuplexSerial"
PUB StartSerialTester
FullDuplexSerial.Start(rxpin, txpin, mode, baudrate)
REPEAT
vData:= FullDuplexSerial.rx
CASE vData
$31 : outa[16]~~
$32 : outa[17]~~
$33 : outa[18]~~
$34 : outa[19]~~
$35 : outa[20]~~
$36 : outa[21]~~
$37 : outa[22]~~
$38 : outa[23]~~
waitcnt(20_000_000+CNT)
outa[16..23]~
The above code does not work!, What am I doing wrong? My RX light on the USB2SER is FLASHING, but nothing on the PROP Board is?
Thanks
Dave Metus