Alternative Rs232 propeller Interface
christopher
Posts: 31
Hi,
I have built and successfully used the three transistor interface circuit for the propeller featured on this site. However, when I use the same circuit from a separate cog, I am finding that the when the circuit is connected to the PC with the pc tx driving at -10 volt it works fine but when disconnected from the PC it seems that the cog detects a low going pulse and this traps the cog as it waits for further serial data input.
Has this been experienced and does max3232 solve this problem ? Can the problem be solved with discrete transistors ?
Thank You
Chris
I have built and successfully used the three transistor interface circuit for the propeller featured on this site. However, when I use the same circuit from a separate cog, I am finding that the when the circuit is connected to the PC with the pc tx driving at -10 volt it works fine but when disconnected from the PC it seems that the cog detects a low going pulse and this traps the cog as it waits for further serial data input.
Has this been experienced and does max3232 solve this problem ? Can the problem be solved with discrete transistors ?
Thank You
Chris
Comments
Chris
At low speeds (19.2KB or less), you could start with the Simple_Serial driver which is all in Spin.
Try the attached serial driver. I added some code to the receive routine that checks at 1/4 bit time and 1/2 bit time from the leading edge of the start bit. If the serial line is high, it wasn't a start bit really and the routine waits for the next high to low transition. I haven't tried the routine, but it should work as modified.
Post Edited (Mike Green) : 1/18/2007 3:25:55 AM GMT
Many thanks for your assistance I shall implement same. Allow me to allow take advantage of your good nature. I am in fact using the simple-serial.spin at 4800 baud, but the routine awaits a start bit. I would like to implement a time out in the event that the remote pc does not deliver after a specified time. Is there such a routine or should I·adjust simple-serial to timeout and return.
You've just helped a guy in Trinidad· W.I (yeah it's warm)
Thanks,
Chris
It is possible to do the same kind of thing with the simple serial routines (make the receiver and transmitter run in a separate cog with a simple buffer), but the FullDuplexSerial object already has been written and works well.
Again
Chris
I have a stepper board set up with a motor so that I can send serial strings to it through Windows Hyperterminal and have it do things. These strings are very simple. For example, I can send it "+s" (slew) and the motor will just start spinning until I send it "z," which will stop it. Great. Now it's time to get Propeller to do it.
The board has a Serial In pin, and I have gleaned that I can try to use Simple_Serial or maybe FullDuplexSerial (overkill? I'm not rx-ing at all yet!). In this scheme, I should just make sure both boards are sharing ground and then connect the Serial In pin to some pin, say pin P1 on the Propeller Demo Board, call Simple_Serial simply, and send it the string to send. So I've tried it, and it isn't doing anything.
Any advice? Did I miss an important concept? Here's all of the code I think it should take. If anyone can straighten me out, I'd really appreciate it.
' testing simple_serial
' need to make an object to start it
' then send it the string...
'
obj boardcom: "Simple_Serial"
'
Pub start
· boardcom.start(-1,31,9600)······· '(rx pin, tx pin, rate) -1 for fake rx
'
· boardcom.str(string("+s"))········'send slew command
Alex
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
ExtSerial : "FullDuplexSerial"
Pub Test
· extserial.start(8, 7, 2, 9600) ' rxpin,txpin,mode,Baud - depends on your set up
repeat 10 ' repeat 10 times
· extserial.str(string("+s")) 'slew
· waitcnt(20_000_000 + cnt) 'wait a length of time while slewing
··extserial.str(string("z,")) ' stop I PRESUME THE COMMA IS INTENTIONAL in your example
· waitcnt(20_000_000 + cnt) 'wait stopped for a while
if CR - carriage return is required after the command -·mod the line of code this way
extserial.str(string("+s",13)) 'slew
or 10 for line feed..
Let me know how you get on..
- yeah just typed it in so corrected now
Post Edited (QuattroRS4) : 1/26/2007 4:52:31 PM GMT
I tried it, without my typo comma, and it was down a couple of ")", but got that worked out easily. No result, though, so I need to check on my mode, and if I'm set up right on the other side. Have you used this board before, by any chance?
I appreciate the help. Wish I saw it last night!
try adding CR & LF
extserial.str(string("+s",13,10)) 'slew
I had a silly interface before that required LF then CR maybe worth bearing in mind.
Did you SEND to hyper terminal from prop - to see if you are outputting OK ?
Doing that you can work out the mode that suits you best - mode 2 for me on laptop - Have also used mode 1 on other machines.
Let me know how you go...
Actually it is a ST microelectronics example 3v -5.5v type - see attached pdf.
Follow the link to the prop stick to see connections -
http://www.parallax.com/dl/docs/prod/prop/PropStick-v1.2.pdf
Post Edited (QuattroRS4) : 1/26/2007 5:19:14 PM GMT
Thanks,
Alex
Used a breadboarded prop with 232 driver as mentioned and traditional 'null modem' (3wire) serial cable - rx,tx,gnd..
Have used it without support I.C· - no problems to traditional serial port (resistors are recommended) - but find that without the driver - I have had issues with some USB to serial devices ...
Quattro
Post Edited (QuattroRS4) : 2/6/2007 1:51:45 AM GMT
Personally I would prefer to use a 232 driver - but further to your query -
I ran a trial just now for you - using a demo board - to a laptop which has a third party usb to serial device as its serial port.
connections as follows - Vss on demoboard to pin5 (gnd) on p.c serial port
P0 on demoboard through a 4.7K resistor to pin 2 on P.C serial port
On the pc start up hyperterminal - 9600,N,8,1 and flow control 'None'
Do the following with the Propeller IDE -
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
ExtSerial : "FullDuplexSerial"
Pub Test1
extserial.start(-1, 0, 2, 9600) ' (transmit only)- rxpin,txpin,mode,Baud - depends on your set up
repeat 5 ' repeat 5 times
· extserial.str(string("Hello World 'concatenating' "))
· waitcnt(100_000_000 + cnt) 'wait a length of time
extserial.str(string(13,10)) 'move to new line
repeat 5
· extserial.str(string("Hello World in a new line each time!",13,10))
· waitcnt(100_000_000 + cnt) 'wait a length of time
You should see the results in hyperterminal window.
You may have to adjust the 'Mode' to suit your needs .... mine worked in both modes 2 and 3
Let me kow..
Quattro
Post Edited (QuattroRS4) : 2/6/2007 7:57:10 PM GMT