Problem with a simple serial application
Jabberwock
Posts: 2
Greetings,
Please bear with me, as I have no experience with controllers whatsoever - in fact, if I succeed with this program, I will not touch low-level stuff for a long time...
I am trying to write a simple program for Brilldea's excellent LED Painter. The creator of the LED Painter has provided me with the drivers which allow me to control the board - it all works very well.
However, I do not wish to go the DMX route - I would like to control the board directly with the Prop Plug. I thought that it would be relatively simple - just get the data and adjuct the LEDs accordingly... Unfortunately, it did not go that well... I cannot even establish a proper serial communication. For example, I try to test FullDuplexSerial procedures (with a Pure Data and with a simple VB app):
Serial.start(31, 30, 1, 9600)
repeat
test := Serial.rx
if test <> 0
Serial.tx (test)
The values I get back are certainly not what I send out - in fact, they are quite random, even if I send the same value all the time... What am I doing wrong?
Please bear with me, as I have no experience with controllers whatsoever - in fact, if I succeed with this program, I will not touch low-level stuff for a long time...
I am trying to write a simple program for Brilldea's excellent LED Painter. The creator of the LED Painter has provided me with the drivers which allow me to control the board - it all works very well.
However, I do not wish to go the DMX route - I would like to control the board directly with the Prop Plug. I thought that it would be relatively simple - just get the data and adjuct the LEDs accordingly... Unfortunately, it did not go that well... I cannot even establish a proper serial communication. For example, I try to test FullDuplexSerial procedures (with a Pure Data and with a simple VB app):
Serial.start(31, 30, 1, 9600)
repeat
test := Serial.rx
if test <> 0
Serial.tx (test)
The values I get back are certainly not what I send out - in fact, they are quite random, even if I send the same value all the time... What am I doing wrong?
Comments
the third parameter in serial.start is the mode
with value "1" you inverted the rx-pin
try it with ,ode 0
code]
Serial.start(31, 30, 0, 9600)
[noparse][[/noparse]/code]
and be sure that you have the same baudrate in your VB-App
another hint:
you have to set these constants
as without them the propeller runs in internal oscillator mode, which has NO accurate frequency
best regards
Stefan