Shop OBEX P1 Docs P2 Docs Learn Events
FullDuplexSerial Strange — Parallax Forums

FullDuplexSerial Strange

XetarXetar Posts: 10
edited 2010-10-22 02:06 in Propeller 1
The following code continuously blinks an LED on pin 14 even with a ground resistor tied to pin 11

PUB Main| data, d

' Serial.Start(31,30,%0101,9600)
Serial.Start(11,10,%0000,9600)

Serial.str(string("TEST"))
Serial.rxflush

dira[14] := 1

repeat

If Serial.rxcheck > -1
Serial.str(string("GOT IT"))
!outa[14]
else
Serial.str(string("?"))

waitcnt((clkfreq / 2) + cnt)

Serial.Stop

repeat

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-21 08:57
    I'm not sure what you're asking. Please be clearer in the future.

    I assume you've got a pulldown resistor on your receive pin and you're wondering why FDS seems to continue receiving values.

    You've got FDS configured to receive in "normal" mode where the start bit of the data is a zero, the data bits are "true", and the stop bit(s) is a one.

    With a pulldown resistor, FDS always sees a zero value on the receive pin and it always sees a start bit when it looks for one. All the data bits that follow are also zeros and FDS doesn't check for a valid (1) stop bit when it's supposed to be there, so it assumes it has a character which is $00 and plunks that into its buffer, then goes to look for another start bit.

    Change your pulldown to a pullup (to +3.3V ... Vdd) and FDS will stop seeing characters where there aren't any.
  • XetarXetar Posts: 10
    edited 2010-10-21 09:04
    Ok i'm new to serial communication at this low of a level, so please bear with my dumb questions here:

    1. I thought the serial line was suppose to hold at 0 volts, and jump up for brief amounts of time to indicate data?

    2. What is FDS?
  • DaveJensonDaveJenson Posts: 375
    edited 2010-10-21 10:31
    Xetar wrote: »
    <snip>
    2. What is FDS?

    FDS = FullDuplexSerial
  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-21 10:41
    The normal serial line (logic level) idles at high and goes to zero as needed for the start bit and zero data bits.

    There is an inverted mode which is occasionally used, particularly if you're going to use a logic to RS232 driver which inverts the signal.

    RS232 uses -3V to -15V for idle (1) and +3V to +15V for active (0). Look at the Wikipedia article on RS232 for details and pictures.

    FDS is the buffered serial driver that's included with the Propeller Tool in its object library. It's also downloadable from the Propeller Object Exchange (OBEX).
  • XetarXetar Posts: 10
    edited 2010-10-21 11:30
    Well apparently the Computer 9-pin RS-232 i'm dealing with is the other way. When i hook up my chip to 9 pin on the computer, the pin for my recieve goes 0v, and when i hit a key on the computer to send something, it pulses up to about 5v for the transmission. You can see it on the ocilliscope.

    However since the chip is apparently expecting hi, with dips in the signal, it is just constantly seeing data.

    If I set my mode to %0010 then my transmissions from the chip to the computer work fine.

    But i can't figure out a setup to allow the prop chip to hear the computer's signal.
  • SapiehaSapieha Posts: 2,964
    edited 2010-10-21 11:35
    Hi Xetar.

    What type of logic converter You use on Propeller side?




    Xetar wrote: »
    Well apparently the Computer 9-pin RS-232 i'm dealing with is the other way. When i hook up my chip to 9 pin on the computer, the pin for my recieve goes 0v, and when i hit a key on the computer to send something, it pulses up to about 5v for the transmission. You can see it on the ocilliscope.

    However since the chip is apparently expecting hi, with dips in the signal, it is just constantly seeing data.

    If I set my mode to %0010 then my transmissions from the chip to the computer work fine.

    But i can't figure out a setup to allow the prop chip to hear the computer's signal.
  • XetarXetar Posts: 10
    edited 2010-10-21 11:37
    Just the FullDuplexSerial object
  • SapiehaSapieha Posts: 2,964
    edited 2010-10-21 11:41
    Hi Xetar.


    I mean
    > Hardware between Propeller and DB9 on PC side.

    You need signal converter as PC's DB9 use voltages between +-5 - +-15V
    and that You need convert on Propeller side to Logic voltages that Propeller use ----> 3.3V - OV

    Xetar wrote: »
    Just the FullDuplexSerial object
  • XetarXetar Posts: 10
    edited 2010-10-21 11:42
    Oh, didn't know that. You wouldn't have a couple part numbers by chance would you?
  • SapiehaSapieha Posts: 2,964
    edited 2010-10-21 11:45
    Hi Xetar.

    Not directly BUT look on this thread Post on SerPlug.

    http://forums.parallax.com/showthread.php?t=123551

    Xetar wrote: »
    Oh, didn't know that. You wouldn't have a couple part numbers by chance would you?
  • XetarXetar Posts: 10
    edited 2010-10-21 14:01
    I looked through the thread and I might have just missed it. Can you do this with 2 read relays? one for the inbound and one for the outbound?
  • SapiehaSapieha Posts: 2,964
    edited 2010-10-21 15:30
    Hi Xetar.


    SerPlug

    Look on first picture.
    As You can see on it to that needs more as only simple Relay



    Xetar wrote: »
    I looked through the thread and I might have just missed it. Can you do this with 2 read relays? one for the inbound and one for the outbound?
  • plenty_otooleplenty_otoole Posts: 2
    edited 2010-10-22 02:06
    Xetar wrote: »
    I looked through the thread and I might have just missed it. Can you do this with 2 read relays? one for the inbound and one for the outbound?

    Theoretically speaking, yeah, I suppose you could. But why bother?

    Do the job right the first time. There are three different ways shown at the link. I think there's a fourth somewhere in the documentation that uses only resistors. If you don't have UK spec parts (see the list at the link) use 2N3904 and 2N3906 in place of what's listed.

    http://dave.fraildream.net/micro/periph/232-ttl.html
Sign In or Register to comment.