Shop OBEX P1 Docs P2 Docs Learn Events
Serial communications to propeller chip — Parallax Forums

Serial communications to propeller chip

amarth6amarth6 Posts: 1
edited 2010-04-20 03:46 in Propeller 1
hey guys, I really need help with this. I am working in a school project. I need to get serial data from a UART to a propeller so that I can get the data I need from that serial string of data.

I would get about 48 bits of data out (preamble, id, data, end) and I need to make the propeller do a task depending on what data I get. However, I am not sure how I can interace a propeller chip with a uart to get that serial information out and do something with it.

Thank you and I would really appreciate your help.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-18 16:42
    It depends on the UART and what kind of voltage levels it produces / expects. Some UARTs are powered by 3.3V and produce 3.3V logic levels. Some UARTs are powered by 5V and produce 5V logic levels. Some UARTs have an RS232 interface and produce RS232 voltage levels (from about +15V to -15V, sometimes less). If you have a 3.3V or 5V logic level signal, you should be fine with just a 1K to 2.2K resistor between the Propeller I/O pins and the UART. If you have an RS232 signal, you'll need an RS232 to 3.3V translator like the MAX3232. Look at the schematics of the Propeller Professional Development Board for an example of a MAX3232.

    For software, look at the FullDuplexSerial object from the Propeller Object Exchange. This also comes along with the Propeller Tool when you install it. It provides a full duplex serial channel up to about 230KBaud when you're using the Propeller's normal 80MHz system clock. If you browse through the Object Exchange, you'll find several other serial objects with different features.

    The FullDuplexSerial object will provide you with a "get a character" and an "is there a character" routine. You'll have to do all the programming to figure out what to do with the characters. It shouldn't be hard.
  • jmspaggijmspaggi Posts: 629
    edited 2010-04-20 00:57
    Hi Mike,

    What should we use for the Propeller? +3? Or +5? Or are both of them correct?

    I ordered a Propeller Professional Development Board and I want my Propeller to talk to my Javelin.

    The javelin uses TTL level signals (0 and 5V). So can I just connect it directly to the Propeller?

    Also, will the Propeller's frequenze have impact on the communication? If I use it at 5Mhz instead of 80Mhz, or if I use it at 100Mhz, will the FullDuplexSerial object or others ajust? Or it will not work anymore?

    Thanks,

    JM
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-04-20 03:46
    If you are interfacing TTL 0/5V to the Propeller 0/3V, the standard way to do this is with a series 1k resistor. You might need to adjust the polarity in software.

    Re baud rates, these are all standardised, so you can start slow and work up. The clock frequency of the micro does not matter. 1200 baud is a safe place to start, especially as bytes are slow enough you can put a led on the port and watch each byte go through. Then you can increase the speed. If you have cables more than a few metres long you might start getting problems faster than 38400.

    Baud rates will be one of:
    110, 300,600,1200,2400,4800,9600,19200, 38400, 57600, 115200 and even faster if you like.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
Sign In or Register to comment.