Shop OBEX P1 Docs P2 Docs Learn Events
Help with serial I/O — Parallax Forums

Help with serial I/O

SamMishalSamMishal Posts: 468
edited 2009-05-31 15:32 in Propeller 1
Hi all,

Has any one managed to communicate the propeller using the FullDuplexSerial.spin object with
any thing other than the ParallaxSerialTerminal.exe????? If so what settings??

I have a program that uses the object·and commuinicates with the SerialTerminal.exe no problem.
I am just sending text.


However when I wrote a program with RobotBASIC to receive from the same propeller program, it does not work.


With·FullDuplexSerial.spin you can set the baud rate and the Tx and RX pins but not
the NumBits ,Parity ,StopBits , Hand shaking Protocol.....what are these set to????

I am interested to hear from any one who has communicated the Prop using the above spin object
to anything other than the exe above.......and what did you do to make it work???


If the FullDuplexeSerial.Spin does not work with other things.....then is there a spin object I can use
to do so.........???


Please help!!



Samuel







Post Edited (SamMishal) : 5/31/2009 7:06:13 AM GMT

Comments

  • JonnyMacJonnyMac Posts: 9,195
    edited 2009-05-31 04:47
    I've used FullDuplexSerial to "talk" with an SX chip and to other terminal programs. The object is fine; you must not be applying it correctly with RobotBasic.

    FDS using 8N1 -- pretty common stuff. Perhaps R/B is doing something with DTR which is resetting the Propeller.
  • SamMishalSamMishal Posts: 468
    edited 2009-05-31 05:35
    Hi Jonny,



    THANKS A LOT.........that was exactly the problem......DTR is also the Reset button and RB

    puts it low to start with and that is resetting the Prop.....and I had the program in ram only

    so obviously no program to run.....



    I fixed the problem by using different pins to do the Tx and Rx and it works like a dream........



    Fantastic........



    But it would have been convenient to use the same serial as the programmer port.....but it is better

    this way anyway since I have to use it the way it would normally be used with other devices......

    Also I can use the ParallaxSerialTerminal also at the same time to do debugging ......I think this works out

    quite fine.



    I love it.....I can now write my RobotBASIC program to do serial Io with the Prop just like I did for the

    Bs2. I will be writing about all this soon.......showing a program that sends numbers from RB to

    spin and then back to RB with display on both sides......Just like in the BS2.



    Thanks again...............



    Samuel
  • JonnyMacJonnyMac Posts: 9,195
    edited 2009-05-31 05:45
    I know nothing about RobotBASIC but downloaded it and had a demo working -- on the Propeller programming port -- inside of five minutes. See attached to see if it helps at all.

    If RobotBASIC is going to force a reset you may not be able to do a RAM only test; the TX and RX pins have nothing to do with reset, that connects to another pin.

    Post Edited (JonnyMac) : 5/31/2009 5:51:54 AM GMT
  • SamMishalSamMishal Posts: 468
    edited 2009-05-31 06:40
    Hi Jonny,



    So did you do this test in Ram or in Rom??



    I see you used the 31 and 30 pins....so that means you were able to use the

    programming port......so did it work for you because you burnt the program to Rom????



    I am sure it is to do with what you said about DTR .....RB sets it to low to start with

    when it connects to the Com port.....and that will of course reset the Prop.....but then

    it seems that if the program is in Rom then it will work any way.......



    I am going to try this now.....



    I am sooooooooo glad that you picked RB·and wrote a program like you did in no time at all.

    Are you sure you never used RB before?????? Did you figure out all the commands from the help file??

    That makes me sooo happy that someone (albeit·an expert)·can do that......



    I am now able to send and receive data but I am using P25 and P26 connected to a second Com port

    on the PC to avoid the programming Com port......But it is nice to see that it can be done with the programming

    Port if the program is in Rom....(I think I am going to try).....



    Thanks much



    Sam




    Post Edited (SamMishal) : 5/31/2009 2:15:52 PM GMT
  • SamMishalSamMishal Posts: 468
    edited 2009-05-31 06:59
    THANKS Jonny,
    You are a great guy to do all this work on my behalf....THANKS!!!!!
    It is exactly what you said. When I burnt the program to ROM....it worked
    PERFECTLY with the P31 and P30 i.e. programming Com port.
    So If I had to I can use the same com port as the Prop Plug and I do not have
    to use another com port at all.....only disadvantage is:
    1- I have to burn to rom
    2- I cannot use the ParallaxSerialTerminal.exe to do debugging at the same time
    3- I cannot start the RB program until after the IDE has finished with programming the prop
    So in reality I am better off to use another com port with pins other than 30 and 31
    BUT...it is nice to know that it can be done but with caveat 1 above.......nice to know
    that it can be done IF someone cannot create a second com port.
    GREAT.....stuff

    THANKS again
    Samuel
    P.S. I am still amazed that you could write a program like the one you did in RB having
    never used it before.........you must be an expert.........and even though that is another topic
    but it is people like you who prove that REAL programmers can program in ANY LANGUAGE
    and they can do it well......

    Post Edited (SamMishal) : 5/31/2009 7:12:52 AM GMT
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-05-31 11:49
    The first thing I had to do was pull up the reset pin and put a jumper in, it can be a bit of a nusience sometimes but great for proving if it is the DTR thing. Same thing happened to me on Arduinos, auto boot cute for constant prog tweeks, if it gets a chance to run.
  • ratronicratronic Posts: 1,451
    edited 2009-05-31 13:41
    @ SamMishal , I would like to thank you for writing this fantastic software (RobotBasic)! ·I am definatley a beginner, but I am using it to interface the PC's joystick to the PC's serial port via a Parallax 320.92mhz transmitter·to a Propeller based bot. I think this stuff is just great!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it, if it ain't broke·
    D Rat


    Dave Ratcliff· N6YEE
  • SamMishalSamMishal Posts: 468
    edited 2009-05-31 14:00
    Ratronics,
    ·
    Thank YOU for being such an Evil Genius and using RobotBASIC with
    such dexterity, illustrating that in the hands of REAL programmers
    RobotBASIC can be yet one more tool in their built.

    Most people·whine about this or that language being better than this or that
    but that is just like insisting on using a 10 iron to play an entire game of golf
    from the T to the hole........
    ·
    Horses for courses I say.....and RB is definitely one of the horses out there........
    And under a good jockey like people in this forum it can even carry you to the finish line
    better than some thoroughbreds........I personally prefer a quarter horse...because
    I cannot afford a full one....tongue.gif

    ·
    So the real thanks should go to you Ratronics for being a REAL PROGRAMMER.
    ·
    Samuel

    Post Edited (SamMishal) : 5/31/2009 2:06:21 PM GMT
  • JonnyMacJonnyMac Posts: 9,195
    edited 2009-05-31 14:31
    @Sam:

    Yes, I have been programming for a while (since 1978). I simply found an R/B example that did serial comms and followed suit -- nothing magical. When dealing with serial programs I always dump them into the EEPROM to avoid the possibility of a DTR reset problem.

    BTW, since you write you may want to change the phrase "burn ROM" to "rewrite the EEPROM" as that's actually what is happening. The Propeller's program ROM is masked and cannot be "burned."

    Glad you got everything working -- should provide for some interesting projects.
  • SamMishalSamMishal Posts: 468
    edited 2009-05-31 14:49
    JonnyMac said...

    ·since you write you may want to change the phrase "burn ROM" to "rewrite the EEPROM" as that's actually what is happening.
    Just a hang over from the good old days when we did actually do that ....we used 12 volts to "burn" them and
    of course not in cricuit, you then had to put it back in the circuit and then find out that it was wrong so you had to
    throw it away and start with a new one.......EProms then came on the market ....still 12 volts etc. But being able to
    reuse it after a few hours under an ultraviolet was SUCH a heavenly ability..........

    When EEProms came along they still needed higher voltage and initially could not be programmed in circuit but what
    a concept, you can just wire a couple of jumpers to make it an incircuit in a way........heavenly..........

    People nowadays just do not know the "pleasures" we used to have............I am sure they are glad about that....

    Since 1978...hmm My first programming was done on a Ti59 ( http://en.wikipedia.org/wiki/TI-59) when I was 16 then
    on the PDP11 a couple of years later....good old days.............·15 years agosmurf.gif


    Sam

    Post Edited (SamMishal) : 5/31/2009 3:41:04 PM GMT
  • JonnyMacJonnyMac Posts: 9,195
    edited 2009-05-31 15:05
    I started with a COSMAC Elf (kit, gift from my uncle), then the TRS-80, but really became hooked with the Timex-Sinclar 1000 -- especially as I could connect hardware to the expansion port for all kinds of fun. When the BASIC Stamp cam along my embedded control projects became a lot cleaner and I've been using it ever since.

    FWIW, my column (originally started by Scott Edwards) in Nuts & Volts has be changed from "Stamp Applications" to "The Spin Zone - Adventures in Propeller Programming" so I will probably have a Propeller/RB experiment at some point down the road.
  • SamMishalSamMishal Posts: 468
    edited 2009-05-31 15:32
    JonnyMac said...
    I started with a COSMAC Elf (kit, gift from my uncle), then the TRS-80, but really became hooked with the Timex-Sinclar 1000 -- especially as I could connect hardware to the expansion port for all kinds of fun. When the BASIC Stamp cam along my embedded control projects became a lot cleaner and I've been using it ever since.

    FWIW, my column (originally started by Scott Edwards) in Nuts & Volts has be changed from "Stamp Applications" to "The Spin Zone - Adventures in Propeller Programming" so I will probably have a Propeller/RB experiment at some point down the road.
    My first personal was the Apple II........what a great machine it was......I used to be a civil engineer then and I used it
    to solve concrete design formulas. Even though I had to·program the formulas and algorithms from scratch it was still
    faster to do so than having to wait for the Mainframe output. The partners in the firm I worked for were all bowled over.
    ·
    A computer on some junior engineer’s desk .........what a concept.......
    ·
    Regarding the articles.........I would be eternally grateful...........
    ·
    RB can do Internet Communications........maybe something that involves this ability............see this PDF
    http://www.robotbasic.org/resources/RobotBASIC_Networking.pdf
    ·
    The programs in this·zip may also be of interest.....they do instrumentation Bi-directional sending and receiving
    over the internet and also can even do chat....I actually used the chat to chat with a friend·from Australia to the USA.
    http://www.robotbasic.org/resources/TCP_Demo.zip
    ·
    The programs in this zip were used to control a robot (simulated) from the USA to Australia and to send snap shots
    (screen shots) of the robot's environment...
    http://www.robotbasic.org/resources/TCP_Robot.zip
    ·
    Just some ideas.......I would love to see RobotBASIC being used with the Propeller to do the above stuff using
    a real robot with a propeller and a Wifi (but serial radio is good too, or bluetooth) connection to control a real
    robot with some interesting AI being carried out by RB.
    ·
    What ratronic is doing is definitely worthy of an article too......I wish he would write it.....Servo is always interested
    in good stuff like that.
    ·
    Samuel

    Post Edited (SamMishal) : 5/31/2009 3:50:12 PM GMT
Sign In or Register to comment.