Shop OBEX P1 Docs P2 Docs Learn Events
Serial Terminal Protocol? — Parallax Forums

Serial Terminal Protocol?

Kirk FraserKirk Fraser Posts: 364
edited 2012-02-28 04:09 in Propeller 1
I'm trying to substitute free opensource Smalltalk Cuis 3.3 http://www.jvuletich.org/Cuis/Index.html (also requires a VM to execute) for the Parallax Serial Terminal so I can write programs, eventually a GUI, to communicate with a Propeller. I've filed in the SerialPort object from Squeak and running it causes the Prop Plug LED to light briefly like the Serial Terminal. However I can't yet receive text from the Propeller like the Serial Terminal can. I know the Serial Terminal operates at 115200 baud and Cuis appears to send ok. What other protocol is required to get communication? For example, parity, stop bits, flow control such as none, xon-xoff, or hardware handshaking?

If anyone knows Squeak Smalltalk, would FFI be a better choice and if so, how to use it?

Thanks.

Comments

  • SRLMSRLM Posts: 5,045
    edited 2012-02-27 08:32
    Baud is not neccesarily 115200, it is whatever you set it at. No flow control, no parity, 8 data bits, no CTS or RTS (unless you decide to add those, but it's not standard). Note that regardless of what you're doing on the computer, when you are sending data from the Propeller through the propplug it will light up. So if you're not getting any flashes that means your spin code is wrong.

    Please post your code too.
  • Kirk FraserKirk Fraser Posts: 364
    edited 2012-02-27 09:17
    No stop bits? Here's my Smalltalk code.
    port := SerialPort new. 
    port baudRate: 115200.
    port openPort: 'COM4'.
    port nextPutAll: '>01100'.
    port nextPutAll: '>'.
    port nextPutAll: '0'.
    port nextPutAll: '1'.
    port nextPutAll: '1'.
    port nextPutAll: '0'.
    port nextPutAll: '0'.
    port readString. 
    port close.
    

    The spin code is mainly the standard FullDuplexSerial object being sent a few strings, which works with the Serial Terminal I don't know what you mean about not getting flashes. I get them when I type into the Serial Terminal and also when running the above Smalltalk code. On the way from the Propeller through the Prop Plug I assumed it was so fast the last flash covered it. If that's not correct what is?
  • SRLMSRLM Posts: 5,045
    edited 2012-02-28 00:22
    I've reached the end of my Smalltalk knowledge: none...

    I would test as follows:
    1. Develop code to send a repeating string (every 1 second or so) from the Propeller through the serial port.
    2. Use the Parallax serial terminal to receive and display the strings.
    3. Once that works, disconnect the Parallax Serial terminal and try to debug your Smalltalk code

    The Propplug has two LEDs: a blue one and a red one, IIRC. One is attached to the TX pin, and one is attached to the RX pin. When you download a program to the Propeller one of them will flash for a long time, and the other one will flash intermittently. The one that is flashing intermittently is the one that you want to watch for when sending data to the computer.

    It might help if you post all your code (Spin and complete Smalltalk)
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-02-28 04:09
    Pst workswith Dtr off. The propplug uses this fact to keep the prop from resettig when the proptool download completes and the pst is loaded. This could be your problem that the prop is being reset.
Sign In or Register to comment.