Multi UART question by newb.
natpie
Posts: 35
The SX EOL announcement has finally got me started in the world of propeller. Im starting on my first project. The goal is to communicate with two other completed projects via asynchronous serial. This will be bridged to an Ethernet to serial adapter. I am using a multi serial com object from the exchange obex.parallax.com/objects/340/ but am running into problems.
here is my test code.
everything seems to work okay until i use a UART.str or UART.strln. The program completly stops until it receves a character. So. When I boot this Prop it pauses after the tv displays booted. When I connect to it via serial and type 22 characters it gets to the tv string okay this thing is online. In my termianl I get one character of my This is an oput test string for each key I type.
now the if Index++ > 256 seems to run on the first pass. Again each time I type a character one character from the He did this work? string apears. also the TV.Out(iEthernet) line seems to only work once every 30 or 5 characters. With the UART.Str removed it works just like it should.
So what am I doing that is hanging me up? Am I using this object correctly? Is there a bug in the Object? Any suggestions would be greatly appreciated.
here is my test code.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 RCApin = 14 '1st pin for RCA DAC OBJ Num : "Numbers" TV : "TV_Terminal" UART : "pcFullDuplexSerial4FC" VAR byte Index byte iEthernet PUB Main | Temp Num.Init UART.Init UART.AddPort(0, 0, 1, UART#PINNOTUSED, UART#PINNOTUSED, UART#DEFAULTTHRESHOLD, UART#NOECHO, UART#BAUD2400) UART.AddPort(1, 2, 3, UART#PINNOTUSED, UART#PINNOTUSED, UART#DEFAULTTHRESHOLD, UART#NOECHO, UART#BAUD2400) UART.AddPort(2, 6, 5, UART#PINNOTUSED, UART#PINNOTUSED, UART#DEFAULTTHRESHOLD, UART#NOECHO, UART#BAUD9600) TV.Start(14) TV.Str(string("Booted")) UART.Start UART.str(0, string("!rti" , 13)) UART.strln(2, string("This is an output test")) Index := 0 TV.Str(string("Okay this thing is online")) TV.Out(13) repeat iEthernet := UART.rxcheck(2) if iEthernet <> FALSE TV.Out(iEthernet) if Index++ > 254 UART.Str(2, string("Hey did this work?"))
everything seems to work okay until i use a UART.str or UART.strln. The program completly stops until it receves a character. So. When I boot this Prop it pauses after the tv displays booted. When I connect to it via serial and type 22 characters it gets to the tv string okay this thing is online. In my termianl I get one character of my This is an oput test string for each key I type.
now the if Index++ > 256 seems to run on the first pass. Again each time I type a character one character from the He did this work? string apears. also the TV.Out(iEthernet) line seems to only work once every 30 or 5 characters. With the UART.Str removed it works just like it should.
So what am I doing that is hanging me up? Am I using this object correctly? Is there a bug in the Object? Any suggestions would be greatly appreciated.
Comments