Shop OBEX P1 Docs P2 Docs Learn Events
Need a little help getting started — Parallax Forums

Need a little help getting started

Hi, it was recommended to me that I try Forth with the P2. Forth is not mentioned on the product page under the heading Programming Tools (IDEs) but at the bottom of the page "Taqoz discussion" has a link, so if you can make the connection between Taqoz and Forth then the link takes you to a post that has a TAQOZ.zip file buried 50 posts deep in the Forth forum.

So I'm wondering if there is a place where a noob like me can get help to get started, a page perhaps with examples such as "blink.forth" or just generally controlling gpio.

Also is the zip I downloaded the best file to have or use, the zip has files that I put on an SD card and that worked nicely. It reports that I have v2.7 of Taqoz Reloaded sIDE is this the version I need.

The report seemed to suggest that I have 17 modules on the SD card is there a link on how to use a module or add other modules.

I started exploring Forth for the first time yesterday. I can now add the two values on the top of the stack, I think that's the correct way to phrase it. So I'm sure a lot of the questions I have will be answered as I learn Forth but a jump start will be appreciated.

I have attached a video if I'm heading in the wrong direction please tell me so that I can change course.

T.I.A.

Video:

Comments

  • I think it's best to start from here, and then proceed to here and here is an ultra valuable resource.

    Start small, take your time, do not let anything or anyone discourage you at this early stage. Once you get a feel of Forth and you get past your first own tiny program with success then there is no going back.
    Forth is addictive. You've been warned. Forth is also fun and very efficient so stick to the fun side of it and you'll be fine.

  • @Maciek thanks for the links I will check those out today. I am pretty sure I can handle Forth, eventually, I am just a little nervous on how it is applied with the P2. I am particularly interested in making sure that we have a record that is easy to find and follow for other complete beginners like me, for I can say no one is greener than I am. I will keep you posted.

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2023-11-28 20:20

    @Maciek & all, I am making progress like a wildfire, documentation is out there but dispersed and with varying dates. It would be great if the links were in a single post and pinned at the top of this forum. The links I am talking about are in addition to the links you gave @Maciek, which are excellent references btw, so I am keeping a list of every link I find.

    I even found the holy grail of microcontroller files I found the Forth word "blink" and even found the demo of programming my own "blink" word, which leads me to a question. The following is a listing from the P2 Datasheet page 12

    TAQOZ# begin 56 high 250 ms 56 low 250 ms key until (press any key to stop toggling)

    This works and I can make adjustments to the timing which is great but when I try the line below

    TAQOZ# 56 PIN HIGH

    it does not turn on the led, obviously I am missing something but I can't find what. The docs say that "PIN HIGH" automatically sets the direction registers so I thought it should just set the output to logic 1, any insight would help.

  • MaciekMaciek Posts: 675
    edited 2023-11-28 21:59

    Do you mind telling which P2 board you use ? That is to establish what circuitry is attached to the PIN 56 and how it's connected.
    Or when there is a change to the pin state from low to high does the led follow the pattern ? You can easily establish this when you change the timing to asymmetric values (substantially different) in your working example.

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2023-11-28 21:09

    @Maciek , I am using the P2 eval Rev B , I have an Edge Rev A but I don't have a prop plug and also a P1 in a development board that I may try at some point.

    I adjust the blink as follows

    TAQOZ# begin 56 high 1000 ms 56 low 200 ms key until (press any key to stop toggling)

    and get a low of 1 second and a high of 200 ms

    oh btw I did try 56 PIN LOW and that did not alter the state either

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2023-11-28 21:52

    This may or may not help but I moved to the next pin (57) and I can control it as below

    TAQOZ# 57 pin
    57 pin --- ok
    TAQOZ# @pin 
    @pin --- ok
    TAQOZ# low
    

    the lines above switch the led on, it seems high and low are reversed and I need to address the pin before it will work

    EDIT:
    this is fabulous lol I created my first two Forth words and it works (but not as it should really)

    : hi @pin low ;
    : lo @pin high ;
    

    Improved, just name the pin number first

    : hi pin @pin low ;
    : lo pin @pin high ;
    

    Example:

    56 hi

  • Congratulations.

    I suggest you get the P2 Eval board schematic from here keep it handy and use it, when the need arises. On page 10 of it there is the part for the LEDs and a note (bottom left right under) that explains why you are seeing the LED states reversed.

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2023-11-28 22:39

    @Maciek , well duh!! lol, at least it makes me feel better about the project now, I did plan to move on to another group of pins which will be the next step. I do have the schematic in a desktop folder I named Taqoz along with the P2 Datasheet but before today I never got beyond page 4, mix that in with Taqoz,spin2 and Forth my head is spinning, no pun intended, and is the whole point of putting the docs in one place for reference.

    Thanks for pointing out the active low thing and also for "help getting started" which was the aim of my thread.

    solved by Maciek

    I will post again soon in a different thread with a progress update

  • What I do like as a little tutorial: http://www.murphywong.net/hello/simple.htm

  • @"Christof Eb." thanks I do love tutorials and I have added tha page to my links document which is growing by the hour. There are lots of information on the difficult/advanced topics but the simple stuff is surprisingly hard to find so that is my objective to put the "simple stuff" + links into one post.

    Previously, in this very post, I wanted to simply set a pin high or low and read the value of an input. My solution above is actually not the right way to go about it in my opinion, below it is much easier

    TAQOZ#25 PIN H
    TAQOZ#25 PIN L
    TAQOZ#26 PIN R
    TAQOZ#.S
    DATA STACK (1)
    1 $0000_0000 0 ok
    The first two lines set a high followed by a low on pin 25, the third line sets pin 26 to input and places its current value on the stack which is displayed as shown in the last 3 lines.

    thanks again for the link.

Sign In or Register to comment.