Shop OBEX P1 Docs P2 Docs Learn Events
Multi UART question by newb. — Parallax Forums

Multi UART question by newb.

natpienatpie Posts: 35
edited 2009-08-14 17:28 in Propeller 1
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.
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

  • TimmooreTimmoore Posts: 1,031
    edited 2009-08-14 17:20
    I think the problem is the NOECHO, this is saying that every char you send is echoed back so the transmit code is waiting for a char. If you dont have that then you will see the effect you are seeing. try changing NOECHO to NOMODE
  • natpienatpie Posts: 35
    edited 2009-08-14 17:28
    Timmoore said...
    I think the problem is the NOECHO, this is saying that every char you send is echoed back so the transmit code is waiting for a char. If you dont have that then you will see the effect you are seeing. try changing NOECHO to NOMODE
    Great suggestion.·· I'll try that when I get home.·· I specificly do need the no echo for one of the ports, but I didn't even think it would hang to program.·· I definatly don't need it for the terminal.·· Thank you very much.····
Sign In or Register to comment.