FullDuplexSerial.spin problems
Jared5755
Posts: 26
I'm trying to make a simple "Hello World" program using a serial connection to a PC.· Nothing is being outputted to the PC.
Here's the hardware setup:
I know my PC's com port is working because I tested it using another device.· I've also tried all the different values for "mode" in the fullduplexserial command.· Also, I've tried baud=9600, but nothing works.
Thanks for any help.
Here's the hardware setup:
- Propeller Proto Board
- RS232 Level Shifter Board
- Bray's Terminal (9600 baud, 8 data bits, no parity, 1 stop bit, no handshaking)
I know my PC's com port is working because I tested it using another device.· I've also tried all the different values for "mode" in the fullduplexserial command.· Also, I've tried baud=9600, but nothing works.
Thanks for any help.
CON rxpin=6 txpin=7 mode=3 baudrate=-9600 OBJ serial : "FullDuplexSerial" PUB Main serial.start(rxpin, txpin, mode, baudrate) repeat serial.str(string(" Hello World")) waitcnt(3_000_000 + cnt)
Comments
By default the prop runs off it's internal RCFAST oscillator at 12Mhz or so.
The poor serial object needs to know the clock frequency to set the baud rate and it hasn't been told.
I made a similar mistake very early on in my prop programming.
*Peter*
Keep in mind rxpin and txpin.
I expect that serve you.
Hello to everyone again.
The main issues in the OP's program seemed to be mode = 3 and baud = -9600.
Peter is right, that you need a crystal setting to be able to sync. RCFAST however is fine for other situations and CLKFREQ is set to 12_000_000 implicitely. However this it not exact! You would generally see some characters transferred , but some will be garbled.
There is no explanation that the OP's program only works with mode=4. This would need a pullup at the transmission line, which would be overridden by driving the line @3volts. But the hardware at the transmit line can be more complex of course...
Which mode should I use for PropRPM?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
Post Edited (william chan) : 3/4/2008 1:23:17 AM GMT
I also have the same problem with the PropRPM board, ie. only setting the mode to 4 can bi-directional communication with the PC work.
If I set it to mode 1, only data from Prop to PC works, data from PC to Prop does not get through.
Why is that?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
I would recommend you try 0 (%0000) for your mode. This should work for the majority of setups that use a rs232 shifter or ftdi chip.