Serial Communications
Tim1681
Posts: 5
I've read through about 50+ threads about serial communications using the Basic Stamp BS2, but I still have a few questions. I already bought two MAX233's and they should be coming in a few days.
Let's say that I'm sending Serial Data (RS232) to my Stamp at 38400 baud. How does the MAX233 help me? Is there some sort of handshaking going on that allows the stamp to accept 38400 baud? If I'm sending data into the MAX233 at 38400 baud, wouldn't most of the data sent to the 233 be dropped because the stamp cannot read it fast enough (if I was sending data constantly)?
Basically what I'm doing is sending data from LabVIEW to my Stamp using 2 MaxStream XCite's running at 38400 baud. I can get the data to flow without problems at slower speeds (around 9600 & 4800) but when I send data at 38400 (which I know the Stamp can't handle,but speed is VERY IMPORTANT in my project) it craps out. If I send the string:
at 4800 baud, my Stamp sends the data to the LCD just fine (842:830) using the code below:
(Don't mind the 1's, they were just there because I was playing around with it)
When I send that same string at 38400 baud, my LCD displays 1:8 or 8:1. Is this string too big for the stamp to handle?!
Let's say that I'm sending Serial Data (RS232) to my Stamp at 38400 baud. How does the MAX233 help me? Is there some sort of handshaking going on that allows the stamp to accept 38400 baud? If I'm sending data into the MAX233 at 38400 baud, wouldn't most of the data sent to the 233 be dropped because the stamp cannot read it fast enough (if I was sending data constantly)?
Basically what I'm doing is sending data from LabVIEW to my Stamp using 2 MaxStream XCite's running at 38400 baud. I can get the data to flow without problems at slower speeds (around 9600 & 4800) but when I send data at 38400 (which I know the Stamp can't handle,but speed is VERY IMPORTANT in my project) it craps out. If I send the string:
!1084210830
at 4800 baud, my Stamp sends the data to the LCD just fine (842:830) using the code below:
SERIN 16, 6, [noparse][[/noparse]WAIT ("!"), SKIP 1, DEC4 rud, SKIP 1, DEC4 ele] 'get command and value SEROUT LCDPin, 32, [noparse][[/noparse]DEC rud, ":", DEC ele]
(Don't mind the 1's, they were just there because I was playing around with it)
When I send that same string at 38400 baud, my LCD displays 1:8 or 8:1. Is this string too big for the stamp to handle?!
Comments
The MAX233 only translates voltage levels. It does nothing to the actual bits of data or their timing.
You may need to use something like an SX or a Propeller processor to get the Baud you need (38400 Baud). The propeller can easily handle 230KBaud, but is programmed in Spin and its assembly language rather than Basic.