Shop OBEX P1 Docs P2 Docs Learn Events
Multiple Serial I/O needs — Parallax Forums

Multiple Serial I/O needs

MpbmanMpbman Posts: 2
edited 2009-11-15 15:40 in Propeller 1
Sorry if this is too BASIC...

I designed a widget a few years back using a BS2 which decoded switch presses and generated ASCII out which I converted to RS232 to drive my devices... At the time I used a BS2P40 and had 16 switch contacts in and 7 RS232 out... I want to use the Propeller for a new version with greater I/O capabilities...

I bought a starter kit two years ago, but have only looked through the manual recently, but did not see anything with respect to serial I/O available on P0-P29... Is it possible? My goal is to have 16 switch closures, three pins accepting serial data commands in and 11 pins sending serial data formatted according to the 19 inputs... I have some baud rate flexibility and buffering is not a huge issue...

Any suggestions?

Comments

  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-11-15 15:25
    Mpbman,

    See the 4-port serial driver at obex.parallax.com/objects/340/.
    Use 4 sets of these drivers on separate chip pins, for sixteen (4 X 4). Do you understand?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH

    Post Edited (James Michael Huselton) : 11/15/2009 3:30:20 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-15 15:26
    The Stamps have built-in statements to provide things like serial I/O. The Propeller is fast enough to provide the same functionality and more by means of software that gets incorporated into your program. There are library routines, many of which are provided along with the Propeller Tool and many which are available for download from the Propeller Object Exchange (obex.parallax.com). These provide what you're looking for. There's even a "BS2 Library" in the Object Exchange (obex.parallax.com/objects/30/) that specifically provides a lot of the functionality of the Stamps in one object including serial input and output. The "Full Duplex Serial" object which comes with the Propeller Tool provides a high speed (115KBps) buffered full duplex I/O driver.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-15 15:39
    It's possible to use I/O pins 28-31 for normal I/O, but they're used for specific purposes during the initialization following a reset. You will need some external logic to allow for this shared use. Pins 30 and 31 are used for serial I/O, looking for a possible attached PC. Pins 28 and 29 are used to access an I2C EEPROM that's normally used to hold the program to be executed.

    I suggest you plan to handle the switch closures using a scanned matrix rather than one per I/O pin. That will allow for further expansion since 16 switches will require only 8 I/O pins (4 x 4). Using a diode per switch will allow you to detect and properly handle multiple switch closures.
  • MpbmanMpbman Posts: 2
    edited 2009-11-15 15:40
    Thank you gentlemen! I thought it was too simple a request for the Propeller to be unable to handle it...

    I appreciate your input and I can now delve into designing the hardware around it before I start working on the code...

    Thank you again!
Sign In or Register to comment.