Shop OBEX P1 Docs P2 Docs Learn Events
ICC / Propeller Beginner, cannot get terminal to work using printf examples — Parallax Forums

ICC / Propeller Beginner, cannot get terminal to work using printf examples

lurker93lurker93 Posts: 7
edited 2008-11-06 14:49 in Propeller 1
Hello everyone!
I searched for icc terminal but wasn't able to find an answer to my question.· I want to splash information on the terminal emulator on my ICC software but nothing is ever displayed.· The propeller is on Com 6 of my laptop on a usb port.
Suggestions?
Thanks,
Scott

Comments

  • simonlsimonl Posts: 866
    edited 2008-11-03 13:40
    Hi Scott,

    I don't use ICC, so can't help with specifics, but I hope the following is useful: Are you *sure* the Propeller's been programmed correctly (e.g. you've downloaded a simple LED blinker)?

    Sorry if that's teaching you to 'suck eggs'.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again wink.gif
    BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif
  • lurker93lurker93 Posts: 7
    edited 2008-11-03 13:45
    Yes, I used the blink LED program which I used to blink the LED's. In the same program after turning the led on and then off, I would fire a printf statement. Again, nothing on the terminal. Also I had no led activity on the serial board of my professional development board either. So it seems maybe I haven't told the propeller what the std out is?
    Scott
  • simonlsimonl Posts: 866
    edited 2008-11-03 13:55
    Hmmm, OK, so you definitely have a working serial connection. As I said, I'm not a user of ICC (I'm not even a C programmer!), so you're being lead by the 'blind' here!

    Have you included the stdio? (Not sure how to do that, but I guess you are?) I expect you'll need to do that, and maybe tell ICC which pins your Tx/Rx are on too...

    Beyond that, I'm not sure if I can help.

    Hope that helps though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again wink.gif
    BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif
  • lurker93lurker93 Posts: 7
    edited 2008-11-03 13:58
    Here is the code

    #include <stdio.h>
    #include <asio.h>
    #include <propeller.h>

    void BlinkLED(void);

    main()
    {
    asio_init(57600);

    while (1)
    {
    DIRA = 1 << 16;
    OUTA ^= DIRA;
    msleep(250/2);
    OUTA ^= DIRA;
    msleep(500/2);
    printf("hello world\n");
    }
    }
  • simonlsimonl Posts: 866
    edited 2008-11-03 14:03
    Are stdio.h & asio.h from ICC? The only code I found - from OBEX - has the following (albeit, not for serial comm's, but for TV_Text):

    #include <ctype.h>
    #include <stdlib.h>
    #include <string.h>
    #include <propeller.h>

    Otherwise, to my untrained eye, your code looks OK to me!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again wink.gif
    BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif
  • lurker93lurker93 Posts: 7
    edited 2008-11-03 16:24
    I don't think that is it, if I were calling a function that wasn't defined I would get a compiler error.
    Scott
  • lurker93lurker93 Posts: 7
    edited 2008-11-04 18:22
    bump help!
  • ImageCraftImageCraft Posts: 348
    edited 2008-11-04 20:22
    OK, I just tried the examples.prop\printf\hello.prj under 7.04 and it works fine. The code looks pretty similar to above. What version of the IDE are you using? Help->About tells. Presumably you also have the Project->Options->Target->""ASync IO" box checked (you must be, otherwise you will get an undefined...)

    // richard
  • lurker93lurker93 Posts: 7
    edited 2008-11-04 20:24
    Version 7.03A Built Oct. 8 2008 17:34:43
    ASync IO checked!
    Thanks,
    Scott
  • ImageCraftImageCraft Posts: 348
    edited 2008-11-04 21:10
    And you enabled the right com port on the Tools->EnvOptions->Terminal tab? 7.03A should be fine....
  • lurker93lurker93 Posts: 7
    edited 2008-11-06 13:53
    COM 6 57600
    Still not workinig...:-(
  • cimplexcimplex Posts: 11
    edited 2008-11-06 14:49
    Scott...when you set DIRA = (1 << 16), you overrode the direction bits for the serial port which are set in asio_init from the defs in <asio.h>.
    -Joe

    Try this:

    #include <stdio.h>
    #include <asio.h>
    #include <propeller.h>

    void BlinkLED(void);

    main()
    {
    asio_init(57600);

    // [noparse][[/noparse]RX] [noparse][[/noparse]TX] [noparse][[/noparse]LED]
    DIRA = (0 << 31) | (1 << 30) | (1 << 16); // --->>better coded as: DIRA |= (1 << 16);

    while (1)
    {
    OUTA ^= (1 <<16);
    msleep(250/2);
    OUTA ^= 1 <<16;
    msleep(500/2);
    printf("hello world\n");
    }
    }

    Post Edited (cimplex) : 11/8/2008 2:30:05 PM GMT
Sign In or Register to comment.