Shop OBEX P1 Docs P2 Docs Learn Events
parallax serial terminal problem — Parallax Forums

parallax serial terminal problem

jfoxjfox Posts: 21
edited 2011-01-19 12:44 in Propeller 1
Im taking another go at learning the prop and had some success with full duplex serial and a serial lcd but ive been
flummoxed by the PST ,when i first tryed the example and a few other objects it seemed it wasnt working,then i discovered it is not displaying the first two lines of my test and was waiting for my first input, after enable enter a number and it moves on to the second question ,whats going on ? Thanks Jim

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-17 13:27
    It's to fast. Waiting only one second is propably not enough time for you to switch to the PST and click the enable-button.

    Here's what I do instead:
      tmp:=-1
      repeat while tmp==-1
        term.str( string( "Programxy",$0d,"== please press key to start ==",$0d ) )
        tmp:=term.rxtime( 1000 )
      term.tx(0)
    

    Behind term there is my FullDuplexSerial object.

    This gives you as much time as you want.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-01-17 14:03
    Jim,

    If you want to use Parallax Serial Terminal.spin and not FullDuplexSerial.spin, MagIO2's wont work with PST the spin object. As MagIO2 points out you can use Parallax Serial Terminal.exe using FullDuplexSerial.spin and use his code in your terminal program.

    I resently learned there are two files named Parallax Serial Terminal in the main object folder. One is a spin file the other is an exe file. Kind of confusing.

    Parallax Serial Terminal.spin and FullDuplexSerial.spin have some methods in common but most are different. PST does not have an equivelent method to rxtime (that I could find).

    I tried your program in it worked fine (it needs a new line before "Enter rate:"). I had to press the enable button very quickly once the Prop Tool finshed loading it.

    As MagIO2 suggests, you need more time. One option is to change the first waitcnt(clkfreq + cnt) to waitcnt(clkfreq * 3 + cnt).

    Another option is to load your program to EEPROM (F11) and reset the Prop after enabling PST (the exe version).

    I haven't used Parallax Serial Terminal.spin myself (until just now) but I think I like FullDuplexSerial better.

    Don't give up on the Prop. It's a lot of fun and is a great microcontroller.

    Duane
  • jfoxjfox Posts: 21
    edited 2011-01-17 14:39
    Thank you Gentlemen
    I added the 3 sec delay and its working I guess Im slow on the clicking, how could I delay the process so it wont proceed till I hit enter,Ive been using it by putting a duplicate first question and starting by entering a number.I remember a time program by johny Mac that used pst with full duplex serial that worked for me.Thanks again ,Warning more questions to follow Jim
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-17 14:45
    Thanks for clarification Duane! Somehow I had other sources open before, which used FDS and not PST and I got confused.

    In the beginning I also used a waittime, but most time it's either to slow or it's to fast ;o) That's why I switched to the "press key method". As I use it in all programs you can see which program is loaded into EEPROM before it really starts for example after a reset. When you just changed setup of a developer board this might safe you some PINs if the old program want's to output on a PIN that's used as input in the new setup.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-01-17 14:52
    Jim,

    change
      pst.Start(115200)                                                             '
      waitcnt(clkfreq * 3 + cnt)   ' I assume this is the way it is now.
      repeat   
    
    to
      pst.Start(115200)                                                             '
      waitcnt(clkfreq / 10 + cnt)  ' wait a bit for the new cog in PST to start
      pst.CharIn
      repeat  
    
    This should wait until you've pressed a key before your main loop starts.

    Duane

    Edit: MagIO2, Do you know if there is a better way to do this with PST?
  • max72max72 Posts: 1,155
    edited 2011-01-17 22:50
    I use the charin funtion in pst and it works well.
    On the other hand BST has a terminal included, with auto connect/disconnect.
    You start the terminal, connect it to the prop, then go back to the program and hit F10. BST takes care of the rest.
    Massimo
  • jfoxjfox Posts: 21
    edited 2011-01-19 09:33
    thanks for the help I guess my problem was loading to Ram instead of eprom, Im such a skinflint I dont want to wear
    it out, The CharIn works good or adding waitcount solves it.
    have a new problem with PST,I took this from the PE labs funbook and am trying to output to pst ,but Im getting some asci cyrillic looking output. What am I screwing up now?
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-19 11:10
    You can not use that bitrate with PLL1x. The propeller simply runs to slow. Either increase the clock multiplier or decrease your serial bitrate.
  • jfoxjfox Posts: 21
    edited 2011-01-19 12:44
    Thank you,Its all so clear in retrospect. Jim
Sign In or Register to comment.