Shop OBEX P1 Docs P2 Docs Learn Events
Stupid question, but it might be the key to a little bit bigger of an issue. — Parallax Forums

Stupid question, but it might be the key to a little bit bigger of an issue.

grindelgrindel Posts: 68
edited 2007-07-06 00:02 in Propeller 1
What is the FullDuplexSerialplus.spin equivalent of the BS2 code
SERIN 16,16468,[noparse][[/noparse]WAIT (10)]
?
or is there even one?

I am trying to converse with roborealm, where roborealm sends an <lf> and the prop would send it data.

sorry for the cross post, but here is the original issue. http://forums.parallax.com/showthread.php?p=658552

Note, FullDuplexSerialplus.spin came with the Objects lab, if you know the answer for FullDuplexSerial.spin, that will work too.

Thanks a lot,

grindel

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-05 01:13
    The Propeller and the Stamps are really very different which is part of why there isn't a direct equivalent to WAIT formatter.

    Specifically, FullDuplexSerial is running all the time after it's started and will receive whatever characters are sent regardless of what your main program is doing. If it's received a character, that character will be sitting in its 16 byte buffer, waiting to be read. The rxcheck method returns a -1 if the buffer is empty, otherwise it returns the first character in the buffer (and removes it from the buffer). For example:
    pri waitForLF
       repeat while serial.rxcheck <> 10   ' Throw away any characters until a <lf> is received
       serial.str(string("Here's data",13))  ' Now send some data in response
    
    

    Post Edited (Mike Green) : 7/5/2007 4:42:05 AM GMT
  • grindelgrindel Posts: 68
    edited 2007-07-05 23:30
    Woohoo, it works now.

    After much straining and nashing of teeth it strangely somehow works now with really nothing learned on why it didn't work in the past...

    A couple of theories:
    4800 baud was too slow for the update speed of roborealm, the last thing I changed was to go back to 9600 baud (I had been stepping down transfer speed just to see if that was the issue)

    my little 8V 375 mA transformer is just not good enough to run the prop consistently. I run it through the 511-LF33CV 3.3 V voltage regulator that comes with the PRC

    Thanks for all your help Mike.

    For the record, if anyone else has this problem, here is my code:

    CON
       
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    OBJ
       
      Debug: "FullDuplexSerialPlus"
       
    PUB RRTalk
    
      Debug.start(31, 30, 0, 9600)
      waitcnt(clkfreq*7 + cnt)                                                    
      repeat 
        waitForLF
    pri waitForLF
       repeat while Debug.rxcheck <> 10   ' Throw away any characters until a <lf> is received
       Debug.str(string("!","3",13))       ' outputs !3<cr>
    
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-06 00:02
    grindel,
    I assume by "transformer" you mean 8VDC 375ma rated power supply. That should be more than adequate for the PRC unless you're powering a lot of stuff from it. The Propeller on the PRC takes well under 100ma. You should run the 8V into the 5V regulator first if you're not doing that. It distributes the heat load (8+V - 5V and 5V - 3.3V) across two regulators.
Sign In or Register to comment.