Shop OBEX P1 Docs P2 Docs Learn Events
FullDuplex Serial — Parallax Forums

FullDuplex Serial

HaroldHarold Posts: 8
edited 2006-10-18 15:02 in Propeller 1
I have wired a bluetooth chip to my propellor board and I am trying to use it to send and receive data between it and my PC.· I can send data from the propellor and receive it fine on the PC.· But when I send data from the PC and try to reroute it back to the PC i get jibberish.· Any ideas.· Thanks in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-17 20:59
    You will have to provide much more information about what you've done so far including information about the Bluetooth interface, its connections and what your program looks like, particularly where the serial communication is initialized and the part that deals with the actual communication. Without more information, all we can do is say "I don't know. It ought to work".
  • HaroldHarold Posts: 8
    edited 2006-10-17 21:21
    I am using the propeller demo board.· I have P4 wired to xmit and P5 wired to rcv and power and ground.·· The bluetooth device I am using is the BlueSMiRF http://www.sparkfun.com/commerce/product_info.php?products_id=582.· My init code for the serial object is
    · sp.start(4,5,1,9600)
    · sp.start(4,5,9600)·

    depending if I use the Simple or Full object.

    I can send strings and bytes to the PC without a problem.· I put in a very simple loop

    · byte Tag

    · repeat
    ··· Tag := sp.rx·· ' or rxcheck when using the full object
    ····sp.tx(Tag)

    to echo chars sent from the PC to the propeller back to the PC.· The chars always come back as jibberish.·

    I have used this same device with a PIC 16F877A, wired the same way and didn't have any problems.·

    thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-17 21:36
    I can see why the FullDuplexSerial object doesn't work. You have the receive end on the Propeller working with an inverted signal (the mode parameter is "1" when it should be "0"). The Simple_Serial object ought to work.
  • El PaisaEl Paisa Posts: 375
    edited 2006-10-18 03:05
    Mike,

    I am running a Seetron SG12032 that requires a inverted tx.

    I am using mode=%0010
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-18 03:09
    El Paisa,
    You're running a Seetron which does require the inverted tx, not a Bluetooth adapter which doesn't.
    How's the Seetron display working?
    Mike
  • El PaisaEl Paisa Posts: 375
    edited 2006-10-18 11:52
    Mike,

    Is working fine.
  • HaroldHarold Posts: 8
    edited 2006-10-18 14:43
    Mike,

    Thank you very much.· It works beautifully now for FullDuplex.

    Thanks again.

    Harold kimball
  • NewzedNewzed Posts: 2,503
    edited 2006-10-18 14:49
    Mike, since I am running the OS system with the simulation object, would Full Duplex give me anything I don't have now?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-18 15:02
    The FullDuplexSerial object provides these advantages over the Simple_Serial (or similar) routines in SPIN:

    1) Speed. SPIN can handle 19.2KB for sure, maybe a little faster. Assembly can handle well in excess of 1MB

    2) Full-Duplex. SPIN routines are half-duplex (one direction at a time). You could use two cogs in SPIN to get full duplex.

    3) Buffered. The assembly routines provide full-duplex buffered (16 bytes each direction) serial I/O and run in their own cog in parallel with other operations. The SPIN routines are part of the main processing thread unless moved into their own cog.

    4) The assembly routines have a few minor features (see the description of the mode value) that the SPIN routines don't have.
Sign In or Register to comment.