Shop OBEX P1 Docs P2 Docs Learn Events
Full Duplex Serial comunication help — Parallax Forums

Full Duplex Serial comunication help

dardar Posts: 15
edited 2012-12-28 06:35 in Propeller 1
Hi i'm working now to make a full duplex serial comunication with a gprs module.

I'm working with the object "FullDuplexSerial".

how can i to make carryreturn to go to new line?

thanks

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2012-12-27 08:14
    You need to have a look into the ASCII-table (wiki/google) what's behind a carriage-return (or have a look in the specs of your GPRS-module).

    Then you simply send it byte-wise, or you add it to the end of the string:

    fds.tx( 13 )
    or
    fds.str( string( "gprs_command",13 ) )

    Sometimes devices expect a carriage-return plus a linefeed. This would then be 10, 13. Just call another tx or add the 10 to the string.
  • dardar Posts: 15
    edited 2012-12-27 09:17
    thanks! i was looking for a function to do that.

    And do you know how i can do the communication with two pins (2 and 3) and watch what i'm send and read in the parallax terminal?
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-12-27 10:40
    You can have multiple instances of an object:
    OBJ
      gprs:  "FullDuplexSerial"
      debug: "FullDuplexSerial"
    
    So, one you'd start with connection to pins 2&3, and the other one with connection to pins 30&31.

    In the loop in which you read gprs you can immediately send the value to debug. Wherever you send something to gprs, you'd simply do the same call with debug.

    If you run out of COGs you can switch to the serial object which allows to have 4 serial connections using one COG. (The duplication of FullDuplexSerial of course need one COG per instance.)
  • dardar Posts: 15
    edited 2012-12-28 06:35
    Ok thanks i will try it!!
Sign In or Register to comment.