Shop OBEX P1 Docs P2 Docs Learn Events
FullDuplexSerial Question ... — Parallax Forums

FullDuplexSerial Question ...

JMLStamp2pJMLStamp2p Posts: 259
edited 2008-02-27 13:59 in Propeller 1
Hello all,
I have a transmitter attached to my Prop with Pin 0
being the outpin pin for my transmitter. I am using the command :
data.start(1,0,0,9600) the Third parameter being the
invert rx command. At the moment I am
Using a 1K Pull-up resistor on my Tx line and my line is being held high at 2.72 volts instead of 3.3v
When I try and change that parameter to "2" open drain / Source Tx
with a 1k pull-up my line idles high, drops low for the start bit but after the data it stays low. I am confused about the third parameter of FullDuplexSerial
Can someone give me the correct command for the Line to Idle high, pull low for the start bit transistion and then go back high after the data is sent ?
JMLStamp2p

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-26 21:32
    Normal mode (non-inverted) is that the idle state is logic high (1). The start bit is logic low (0). The stop bit is logic high (1) and should remain high. Inverted mode is that the idle state is logic low (0). The start bit is logic high (1). The stop bit is logic low (0) and should remain low. The data bits are logically inverted (a data value of 0 is logic high and a data value of 1 is logic low).
    Open drain/source on transmit means that the idle state of the line, the stop bits, and any data bits that are the same as the stop bit are high impedance (open drain/source) and their voltage is set by a pullup resistor. The other state (start bit and any data bits that are the same) is actively driven. In your case, you should use a mode value of %0100 which is the same as $4 or 4. You put "2" by mistake.

    '' mode bit 0 = invert rx
    '' mode bit 1 = invert tx
    '' mode bit 2 = open-drain/source tx
    '' mode bit 3 = ignore tx echo on rx
  • JMLStamp2pJMLStamp2p Posts: 259
    edited 2008-02-26 23:01
    Thanks again, Mike
    JMLStamp2p
  • JMLStamp2pJMLStamp2p Posts: 259
    edited 2008-02-27 13:59
    Mike,
    I'd like to thank you for your continued help. I now have my Tranciever recieving the data that I am sending and showing up correctly on my LCD. I thought about what you said concerning the flow of my program and would like your opinion.

    My objectives:
    1) Recieve method running in a seperate Cog.
    2) Keypad method running in a seperate Cog.
    3) A method that monitors inputs from "3" limit switch's.
    4) A Transmit method that transmits "Countdown" Global varibles out the port.
    5) To have one program that can run in both Props, Transmitter & Reciever.
    6) 2 - seperte serial ports, one for the LCD setup at 19200 baud and one for the Tranciever
    setup at 9600 baud.
    Basic setup for Flow Below, please let me know if I am approaching it right.
    VAR:
    Long TValue_1, TValue_2, TValue_3, Stack_1 [noparse][[/noparse] 20], Stack_2 [noparse][[/noparse] 20]

    OBJ:
    data_Tran: "Extended_FDSerial"
    data_LCD: "Extended_FDSerial"
    delay: "Clock"
    num: Numbers

    PUB Main | Value

    cognew(Recieve(Num_of_chars, @ datain_1), @Stack_1)
    cognew(Keypad(Num_of_chars_K, @datain_2), @Stack_2)
    Clear_LCD
    Check_Limits
    Transmit_timer_values
    I'm trying to learn the approach of writing a program by logical steps that accomplish a certain task. I realize that I may not need a seperate cog for these task but would like to make the project as efficient as possible.
    Thanks,
    JMLStamp2p
Sign In or Register to comment.