Shop OBEX P1 Docs P2 Docs Learn Events
UART VP trouble — Parallax Forums

UART VP trouble

RsadeikaRsadeika Posts: 3,837
edited 2007-03-28 13:35 in General Discussion
I have tried the three or so examples of the UART in an interrupt, and none of them seem to work correctly. When I run the programs·I get streaming garbage characters on the screen. I am using Hyperterminal, which shows streaming garbage characters. I also used TeraTerm, which does not stream garbage characters, but shows one line of such.

My setup, I am using the SX52 protoboard, and a DB9 breakout board, which has three wires, common GND, Td, Rd. The cable between the board, and the PC is a straight through cable.

Using the setup I just described, I tested it with the use of SEROUT command, I had to use the N or ON options to make it work. So, the setup works with those options in place. I also used the setup with the propeller, using fullduplexserial, and the option choice turned out to be 2 (open-drain/source tx)·or 3 (ignore tx echo on rx), to make it work. I remember reading in the notes of one of the program examples that the TRUE mode is being implemented. So, if that is the case how does one go about modifying the
program(s) to have some these different mode selections, or is that necessary. Is this a hardware problem, or a software problem, or both.

Thanks

Ray

Comments

  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-28 13:35
    It has to do with how you sample or place bits on the RX and TX lines. The Al Williams book (available as a PDF) covers this in detail.

    In your RX VP you probably have a line like this:

    MOVB     C, RX
    



    You need to change it to:

    MOVB     C, /RX
    



    Likewise for transmit, you have to change

    MOVB     TX, txLo.6
    



    to

    MOVB     TX, /txLo.6
    



    When you connect straight through you need to send in inverted (N) mode (because you're not using a hardware inverter). And do make sure you've got a 22K resistor between the DB-9.3 pin and your RX input on the SX.

    Post Edited (JonnyMac) : 3/28/2007 2:12:23 PM GMT
Sign In or Register to comment.