PDA

View Full Version : Sending a string using hyperterminal or Parallax serial terminal



dodger
03-20-2009, 10:50 AM
I believe the serial device i am using at the moment sends out 18 characters in a string, but the object says it can only recieve 15 characters.· I want to try to eliminate the cause of my problems and verify that the application i have is correct.·

Therefore i would like to use a terminal program to send out a string.


Is it possible to send a string using hyper term or the parallax serial term.· I can only send a byte at a time.· Since i am trying to figure out whats causing some problems i would like to send a string through a terminal program and have the microcontroller recieve it using the Extended FDSerial object.· Any suggestions?·




Thanks

Mike Green
03-20-2009, 11:24 AM
It's possible to expand the size of the I/O buffers in the FullDuplexSerial driver to any power of two up to 512. There are several other serial drivers in the Object Exchange with larger buffer sizes.

Hyperterminal may be scriptable, but I normally use the MacOS and have no idea how to script Hyperterminal under Windows. I know this can be done under the MacOS, but that wouldn't help you.

dodger
03-20-2009, 11:50 AM
Just to make sure before i start changing buffer sizes.· This data stream is composed of 18·characters correct, when I use Hyper terminal i only see the data starting at a sign or space.· Im not too sure what the memory locations are used for.

RS232 Datastream Format
mmmbsdddddbuuuuucl, where:
m Memory Location
s Sign (space or -) c Carriage Return
d Data with Decimal Point l Line Feed

u Units b Blank

Mike Green
03-20-2009, 12:17 PM
The carriage return and line feed will cause the Hyperterminal display to go to the 1st column (Carriage Return) and the next display line (Line Feed). You won't see them otherwise.

The 15 character receive buffer is used internally in FullDuplexSerial to hold characters that have appeared on the serial line, but have not been read by your program by using rxcheck or rxtime or rx. These remove one character from the input buffer (if they're "successful" ... rx hangs until "successful"). Similarly, the 15 character transmit buffer holds characters produced by your program until there's time to transmit them. A program can easily produce characters faster than they can be sent. All of the transmit routines (dec, str, tx) will hang until there's room in the transmit buffer for the characters to be transmitted.

dodger
03-20-2009, 12:49 PM
I think im making a small mistake somewhere.· When i only send one character and not a string i have good communications. As soon as i try to send a string i dont recieve any data as far as i can tell.· Could someone look over my application so far.



I currently have my transmitt connected to my recieve on the propeller. So i would expect to see an Ic on my video display.



{{ Prop Serial}}

CON
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000

VAR
· long MyStr [16]
· long Torque
OBJ
· SER·· :······ "FullDuplexSerial"
· TV··· :······ "tv_text"
· Num·· :······ "Numbers"
· Ext·· :······ "Extended_FDSerial"
PUB Main
·
· Num.init
· TV. start(12)
· TV.str(string("Start",13))
· TV.out(13)
· Ext.start (17,16,0,9600)
· Ext.SetDelimiter (",")
· repeat 30
··· Ext.rxflush
··· Ext.str(string("Ic,"))
··· Torque := Ext.RxStrTime(200,@MyStr)
······· TV.out (Torque)
··· waitcnt (clkfreq/10 + cnt)
· TV.str(string("End",13))
· Ext.stop

Mike Green
03-20-2009, 01:24 PM
TV.out outputs only a single character, not a string. You probably want to use TV.str

Chris Savage
03-20-2009, 09:42 PM
Hello,

This is a duplicate thread...the original thread is located at the following link. In the future please follow up in your original thread rather than starting a duplicate thread.

http://forums.parallax.com/showthread.php?p=793318

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering