Shop OBEX P1 Docs P2 Docs Learn Events
beginner question: usb serial communication — Parallax Forums

beginner question: usb serial communication

allenaallena Posts: 2
edited 2010-01-06 06:08 in Propeller 1
I'm just starting to learn the propeller chip.· I have written a c++ program on windows to open a com port and write a byte to it.· Now I just need to write something on the propeller that will take that byte and do something with it.· I prefer to write in asm as I programmed in asm for many years early in my career on much older chips (6502 and up·line mostly).

I have searched the forums but maybe this is just too easy that many people don't talk about it.· On the propeller, how do I listen for incoming serial communications and send serial communications back over that line?

other notes
I·have the prop attached to my computer via the usb (com5) and I'm able to use the propeller tool successfully with the chip.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-06 05:56
    Unlike the "older" chips you may have used before, the Propeller doesn't normally have any I/O chips attached to it (like a UART). You can attach these, but normally the Propeller program just loads up a cog with a ready-made UART program. There are several of these in the Object Exchange and one of them, FullDuplexSerial.spin, comes with the Propeller Tool. This is normally intended for use by a Spin program and the interface routines to the assembly code are written in Spin. You can write your own interface routines in assembly since the UART cog program just fills a receive buffer and empties a transmit buffer once the cog is started. Another object (JDCogSerial) in the Object Exchange keeps its buffer in the cog itself. This may be easier to interface to an assembly program. Have a look at it.
  • allenaallena Posts: 2
    edited 2010-01-06 06:08
    fantastic information, thank you very much. I'll have a look at those programs as a starting point.
Sign In or Register to comment.