Shop OBEX P1 Docs P2 Docs Learn Events
serial-communicatins with simple-ide — Parallax Forums

serial-communicatins with simple-ide

nomadnomad Posts: 276
edited 2014-11-04 05:20 in Learn with BlocklyProp
serial-communicatins with simple-ide

hi

in the moment i working with a
propeller professional development-board (PPDB)
my first experiments with serial-com.
base: serialcom from the ppdb with rs232-converter-cable to usb to my linux box
with spin is the communication ok
yesterday controlling 2 servos with simpleide OK

now with c:
after much improvements compile is ok
but the test with linux is not ok
no communications ppdb should send: "$1:2:3:4:"

now what make i wrong, is the code correct:
sending a string to linux
please can somebody help me.
thanks for your help , hints and tricks...
regards
nomad


/code:
/**********************************************************************/
Blank Simple Project.c
http://learn.parallax.com/propeller-c-tutorials


dd. 02.11.2014
name: serialcom1.c
- base : the same HW Config as Spin
- pin 27 = tx yellow transmit
pin 28 = rx green receive
- baud: 9600
- RS232-Converter-USB-Kabel on V3 with /dev/ttyUSB0

- no realy demos here (lcd and xbee)
- compile failures....
- with only fdserial.h included compile ok
ref:
notes:
einbau von simpletext.h
serial.h
fdserial.h
*************************************************************************/
//#include "simpletools.h" // Include simple tools
//#include "simpletext.h"
//#include "serial.h"


#include "fdserial.h"

// rx = pin 28
// tx = pin 27

fdserial *term; // should terminal

int main() // Main function
{
// Add startup code here.
term = fdserial_open(28, 27, 0, 9600);

while(1)
{
// Add main loop code here.
writeStr(term,"$:1:2:3:4:");
//writeChar(term, CR );
dprint(term,"$1:2:3:4:");
}
}
/***************************************************************************/

Comments

  • ValeTValeT Posts: 308
    edited 2014-11-02 06:26
    nomad wrote: »
    serial-communicatins with simple-ide

    hi

    in the moment i working with a
    propeller professional development-board (PPDB)
    my first experiments with serial-com.
    base: serialcom from the ppdb with rs232-converter-cable to usb to my linux box
    with spin is the communication ok
    yesterday controlling 2 servos with simpleide OK

    now with c:
    after much improvements compile is ok
    but the test with linux is not ok
    no communications ppdb should send: "$1:2:3:4:"

    now what make i wrong, is the code correct:
    sending a string to linux
    please can somebody help me.
    thanks for your help , hints and tricks...
    regards
    nomad


    /code:
    /**********************************************************************/
    Blank Simple Project.c
    http://learn.parallax.com/propeller-c-tutorials


    dd. 02.11.2014
    name: serialcom1.c
    - base : the same HW Config as Spin
    - pin 27 = tx yellow transmit
    pin 28 = rx green receive
    - baud: 9600
    - RS232-Converter-USB-Kabel on V3 with /dev/ttyUSB0

    - no realy demos here (lcd and xbee)
    - compile failures....
    - with only fdserial.h included compile ok
    ref:
    notes:
    einbau von simpletext.h
    serial.h
    fdserial.h
    *************************************************************************/
    //#include "simpletools.h" // Include simple tools
    //#include "simpletext.h"
    //#include "serial.h"


    #include "fdserial.h"

    // rx = pin 28
    // tx = pin 27

    fdserial *term; // should terminal

    int main() // Main function
    {
    // Add startup code here.
    term = fdserial_open(28, 27, 0, 9600);

    while(1)
    {
    // Add main loop code here.
    writeStr(term,"$:1:2:3:4:");
    //writeChar(term, CR );
    dprint(term,"$1:2:3:4:");
    }
    }
    /***************************************************************************/

    At the beginning of int main(), add the following code. I don't know if that will fix it, but it is something worth trying.
    [COLOR=#945277][FONT=Consolas][B]simpleterm_close[/B][/FONT][/COLOR][COLOR=#333333][FONT=Consolas]();
    [/FONT][/COLOR]
    

    Also, you need to change the baud rate to 115200.

    Best of luck,
    ValeT
  • nomadnomad Posts: 276
    edited 2014-11-03 00:18
    hi ValeT
    thanks for your help
    today i testing this and make eventualy a reply
    regards nomad
  • nomadnomad Posts: 276
    edited 2014-11-03 01:37
    hi ValeT
    your hints are OK
    its running , i work with fdserial.h then fdserial_close(term) is ok, baudrate 115200 ok
    thanks for your fast help
    regards
    nomad
  • ValeTValeT Posts: 308
    edited 2014-11-04 05:20
    nomad wrote: »
    hi ValeT
    your hints are OK
    its running , i work with fdserial.h then fdserial_close(term) is ok, baudrate 115200 ok
    thanks for your fast help
    regards
    nomad

    Glad I can help :)!
Sign In or Register to comment.