Shop OBEX P1 Docs P2 Docs Learn Events
Hydra Basic — Parallax Forums

Hydra Basic

Brian_BBrian_B Posts: 842
edited 2007-02-16 02:34 in Propeller 1
Hi,
·I'll get the ball rolling , has anybody had any luck getting the basic that shipped with the hydra to do anything besides say "ok" ? If you read the side of the box it looks like its suppose to work .

Thanks , Brian

Post Edited (Brian Beckius) : 1/18/2007 4:23:58 PM GMT
1509 x 1006 - 251K
«13

Comments

  • AndreLAndreL Posts: 1,004
    edited 2007-01-18 20:31
    The basic works 100%, do you have a keyboard plugged in correctly? Are you typing programs into it? There is a document on the commands of the basic in the propeller book that shows everything in detail, but its a standard implementation of tiny basic, works fine. What exactly are you trying to do?

    Andre'
  • Brian_BBrian_B Posts: 842
    edited 2007-01-18 20:40
    Andre,



    If I enter this progam
    10 INPUT"ARE YOU HAVING FUN" A
    20 IF A = Y THEN PRINT"YEAH!!"

    and then run it ,you get a syntax error.
    Then if you list it you get ,
    20 IF A= YTHENPRINT"YEAH!!"





    Thank's Brian

    Post Edited (Brian Beckius) : 1/19/2007 4:13:47 AM GMT
  • AndreLAndreL Posts: 1,004
    edited 2007-01-19 03:11
    Well, that code has a syntax error, the "A" sitting out in space, you must put a comma or semi-colon, also make sure to put space between quotes and keywords.

    Andre'
  • Brian_BBrian_B Posts: 842
    edited 2007-01-19 03:18
    Andre'
    like this ?

    10 INPUT " ARE YOU HAVING FUN " ; A
    20 IF A = Y THEN PRINT " YEAH!! "

    Brian
  • Brian_BBrian_B Posts: 842
    edited 2007-01-19 03:38
    Andre'
    I really what to see this basic work , I'll try to test and relay as much as I can to you . the code I gave you is right out of the user book , We probaly would have had alot less confusion if we resolve the code issue 2 weeks ago when I first asked you about it , but lets move on smile.gif

    Thanks Brian






    Post Edited (Brian Beckius) : 1/19/2007 4:17:32 AM GMT
  • AndreLAndreL Posts: 1,004
    edited 2007-01-19 04:06
    This program will work perfectly, the problem is the "then" statement, the parser doesn't seem to like it on line 30 for some reason, it might be on the last build, he broke something to fit something else, but you don't need it. so try this program:

    10 y=9999
    20 INPUT "ARE YOU HAVING FUN" A
    30 IF A = Y PRINT "YEAH!!"

    And remember the input is NUMERIC, not a character, so enter 9999 or another number to get the "yeah"

    Ok, its been a while, so a couple things, first the blending input and print is ugly, so instead of doing this:

    20 input "are you having fun" a

    do this

    20 print "are you having fun"
    25 input a

    Everything else should work fine out of the document on it. You just have to watch out for some of the parser weirdness here and there, it was hard to mash the interpreter into asm and make it fit, so sometimes something steps on something.

    Anyway, try that, and just keep the code simple and not tricky and it will handle it ok. Use lots of white space. Try that, and post back if it works for you. And remember there are no strings just integers.

    Andre'
  • Brian_BBrian_B Posts: 842
    edited 2007-01-19 04:11
    Andre'
    BINGO, i'll try to keep you up to date on any other bugs .

    Thanks , Brian
  • AndreLAndreL Posts: 1,004
    edited 2007-01-19 04:35
    Ahh good. And of course, the source is all there, so you can tweak it and add functions to it. But, for the most part eveything works, just a few things are weird with the parser. The author has been VERY busy, I am bugging him about making a 2.0 version with support for my graphics engine, so lets hope he gets that going. But, try some bench marks on it with basic math and loops and compare it to spin, forth, the basic-spin interpreter and ours and see which is faster !

    Andre'
  • Brian_BBrian_B Posts: 842
    edited 2007-01-19 17:03
    Andre',
    looks like·these functions don't work either (·peek ,poke ,abs & rnd) ,I'm weeding threw the code , If I spot something I'll let you know . Could you check on it also .

    Thank's Brian


    ·Update: I got abs & rnd to work , still messing with peek & poke
    ·····
    ·· trying to run this code:

    10 POKE ( 20 , 200 )
    20· A = PEEK (200 )
    30 PRINT A

    · I Get a error on line 10

    Also - I can get it to save to the hyperterminal , but I can't get it to load back to the hydra

    Post Edited (Brian Beckius) : 1/19/2007 7:58:12 PM GMT
  • AndreLAndreL Posts: 1,004
    edited 2007-01-19 22:51
    The peek and poke stuff only works partially since there isn't a good model of the memory map currently, that is , what exactly are we peeking and poking. So I think robert got them working, but they don't mean much since we don't know the memory map.

    Andre'
  • Brian_BBrian_B Posts: 842
    edited 2007-01-19 23:04
    Andre'
    I can live without peek and poke for awhile ,I'm working on putting a sd socket on a experiment card , but it would be nice if we could get that hyperterminal working . I can get it to download to the hyperterminal , but can't get it to upload (I'm following the instructions that came with the basic , except i can't find the file load in hyperterminal , is it suppose to say file send ?)

    Thanks , Brian
  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 02:04
    Brian, I'll be happy to help the best that I can here.
    Hydra Tiny Basic (HTB) was a fun project and was one of my last minute projects to get out the door before the hydra CD became locked for publication.

    HTB was personally important for me to get included into the Hydra release for a few reasons and I'm grateful for Andre` to work it in.
    1) I really wanted everyone to have something interactive to play with.
    2) I wanted to see what the ASM code was capable of. Speed, wise and task wise.
    3) I wanted to give people a few different examples of interfacing between SPIN and ASM.
    4) I wanted to show off Hydra's abilities
    Hydra Tiny Basic seemed to be a natural choice. I'm sure you will forgive any anomalies that might be present.

    With that said. Let's roll up our sleeves and see if we can squash any bugs you come up with!


    As you have found, there is no THEN construct. Never was. This is in keeping with the original Small basic (Palo Alto) syntax. If I put a "THEN" in the docs then please cross that out and blame it on a long night coding.

    As Andre` points out, the input statement is numeric input only. You can play tricks with it though. The INPUT parser actually calls the calculator to process the input. So you can input variable names as part of the input as well as complex expressions.

    Last I tested, the loading and saving of data via hyperterm worked. That is actually how I tested HTB. I have a small library of code that I had saved and then loaded over and over to test.

    I don't remember if after the last revision I ran a full regression test though....
    Let me clear my work plate of things and I'll try the load function again.

    As far as PEEK and POKE goes, that should work but it was one of the first features I added. Again, let me review those and I'll get back to you. The params to POKE seem to be reversed, at least at first glance.

    Bob
    Robert Woodring
    ·
  • Brian_BBrian_B Posts: 842
    edited 2007-01-20 02:29
    Bob,
    Thank's for looking into this , peek and poke I believe open a huge door in what can be done with basic , does peek & poke work on the cog memory or the main memory ? are we using hex or decimal values . I got peek to return a value ,but poke just gives me a error , I'm working on a way to save onto a sd card . For now I would like to use the hyperterminal . I can save just fine . when I go to load - I type load "hello" on hydra , I pull down send text file in the hyperterminal and nothing happens.

    Thanks, Brian
  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 02:54
    PEEK and POKE work on HUB memory. I looked at the docs I sent Andre` and the description for POKE was confusing even for me now that I review it. I checked the program code and the proper syntax for POKE is..

    POKE address, value

    Be careful where you poke. The screen drivers have control of a large area of HUB memory and poking a value then trying to read it back may not work as expected if the address is in that area.

    The LOAD statement does not take a "NAME" parameter. This might actually cause it to hang. At first glance, I don't see where I try to validate the syntax too much as I expected to then "Load a new program". I think I only tested from a cold boot of the Hydra unit.·Make sure you have done a NEW before the load to make sure any previous program is wiped from memory.

    Try typing LOAD without any other parameters.

    I'm away from home at the moment and don't have access to my Hydra unit to test this myself.
    If you have a moment, please try the corrected syntax and let me know the results.

    Thanks!
    Bob
  • Brian_BBrian_B Posts: 842
    edited 2007-01-20 03:13
    Bob,

    ·Tried it, it just hanges .

    Thanks Brian

    P.S·Bob if you want to check it·out and get back to me next week ,that will be just fine smilewinkgrin.gif
  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 03:20
    I should note that·LOAD will "hang" waiting for a properly formatted file to be sent.

    Properly formatted means a file that was stored by hyperterm after using the SAVE statement from HTB.



    LOAD looks for special control chars in the file and a plain text file will not work.





    -Bob
  • Brian_BBrian_B Posts: 842
    edited 2007-01-20 03:26
    Bob,

    ·What I'm doing is saving to hyperterminal, selecting whats on the screen , pasting· it to notepad & saving it as a text file·, then to load it ,I select it & click send text file .



    Thanks , Brian



  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 03:29
    hmmm, sounds right.

    I wish I thought to take my Hydra with me.

    ·
  • Brian_BBrian_B Posts: 842
    edited 2007-01-20 03:38
    Bob,
    Is it possable that I have configured somthing wrong in the hyperterminal for sending ?

    Brian
  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 03:47
    did you remember to set the "Always Work" checkbox? If so, then I think you are ok!
  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 03:48
    if you can recieve a program to HT then your settings SB correct to send one.
  • Brian_BBrian_B Posts: 842
    edited 2007-01-20 03:54
    man . .... I had the work only part of the time check box checked . . , Still don't work smile.gif

    Brian
  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 04:10
    Called home and had someone test this for me.

    HT set to 2400 baud, 8 bata bits, parity none, stop bits 1, hardware flow.

    Started hydra, started the connection on HT. If the "call" starts out connected then disconnect the call. If HT is using the correct comm port, the hydra should RESET on the disconnect. If not, the wrong comm port is in use.

    You can click back and forth between call and hangup and the Hydra should reset each time if the correct comm port is in use.

    In connect mode,
    on the hydra, type LOAD <ENTER> with <ENTER> being the enter key..
    in HT, click on the transfer menu then send text file menu. Selct the file to send, click on open.
    The file should then be sent and the Hydra should return to the OK prompt.

    If not. Please post the text file you are trying to send.


    -Bob
  • Brian_BBrian_B Posts: 842
    edited 2007-01-20 04:20
    Bob,

    ·Are you suppose to use - send file or -send text file , if you choose send file you have to choose a protocall . Heres that file.



    Brian
  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 04:27
    Let me send it along to the home front for a test.

    get right back to you.


    PS: When you hang up the HT call, does it reset the Hydra?
  • Brian_BBrian_B Posts: 842
    edited 2007-01-20 04:31
    yes it does
  • PocketLintPocketLint Posts: 31
    edited 2007-01-20 04:35
    You should be able to start HT and the Hydra
    type LOAD <ENTER> on the hydra and in HT type an @ and regain control of the Hydra.

    The @ at the start of a line is the terminator of the send process.

    I just had the home front test this and your program it both worked as expected.

    Now I will say, I'm not sure what version is loaded on the project card that the home front is using. I'm not sure if I saved the last version to the flash card or not.


    I will have to test this more when I get home this next week. Sorry for the delay.

    -Bob
  • Brian_BBrian_B Posts: 842
    edited 2007-01-20 04:41
    Bob,
    I typed a @ , still just hanges.

    Thanks for all your help, Brian
  • PocketLintPocketLint Posts: 31
    edited 2007-01-21 03:58
    Well, Got home and loaded the version from the CD and I'm still not able to recreate the issue you are reporting.

    Could you give me as much info as apposible about your setup and method of testing?
    HT version number and all the settings. All the steps in the order you perform them ect..

    I know we went over them but the devil must be in the details.

    Thanks,
    Bob
  • Brian_BBrian_B Posts: 842
    edited 2007-01-21 04:19
    Bob ,

    Heres some screen shoots.

    Brian
Sign In or Register to comment.