Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 14:31 27 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Micromite MMBasic V5.2 Beta 1

     Page 2 of 3    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 12:55pm 14 May 2016
Copy link to clipboard 
Print this post

  robert.rozee said   i've whipped up a small delphi program that does the following:

1. scans through the 'Source' directory tree for all *.h files
2. searches these .h files for lines containing
-> a. an opening curly bracket, "{", and,
-> b. a closing curly bracket, "}", and,
-> c. one or more of T_INV, T_NA, T_CMD, T_OPER, T_FUN, T_FNA

this is the result:
2016-05-14_163311_tokens.zip

does this look like the complete list? is there anything else that should be included or excluded?

cheers,
rob :-)

No Rob, that is not the complete list of keywords. Due to the way that the interpreter works there are a lot of additional keywords that are detected "on the fly". For example Integer as in DIM INTEGER nbr.

Geoff
Geoff Graham - http://geoffg.net
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 01:00pm 14 May 2016
Copy link to clipboard 
Print this post

  redrok said  I really would like to use External Vref for use with Diode type Temperature sensing.

That is still on my todo list. This release was primarily to fix a number of bugs and I ran out of time to look at some of the more complicated things (like this).

Geoff
Geoff Graham - http://geoffg.net
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 01:10pm 14 May 2016
Copy link to clipboard 
Print this post

  Justplayin said   5.2 seems to have significantly less RAM available... Anyway to get some of that back?

Hmm, it went here:
  Quote  Increased the internal stack space used by MMBasic. This allows much more complex expressions which previously caused an "Expression is too complex" error.

I am not sure what to do about this

For a start I never thought that someone would be using all the RAM. The other problem is that this is not something that can be changed "on the fly" with an option.

Can you change your program? Most people run out of RAM because they are using string arrays which default to 256 bytes per element. If you used the LENGTH option you can reduce that considerably.

Otherwise you might have to stick with 5.1 for this particular application.

GeoffEdited by Geoffg 2016-05-15
Geoff Graham - http://geoffg.net
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 02:09pm 14 May 2016
Copy link to clipboard 
Print this post

  piclover said  Again a "Error: Not enabled" during an I2C command issued after a RTC command got issued on an open I2C channel... Are you sure you fixed that bug ?

Ah, I fixed it for RTC GETTIME in V5.1 but forgot about RTC SETTIME (which is what you must be using). I will fix both in the next beta.

  piclover said  This version also doesn't seem to allow pull up/down for FIN/PIN/CIN pins (and my trick of not resetting the pull up/down flag on SETPIN FIN/PIN/CIN invocation doesn't seem to be implemented either).

Sorry, I should have mentioned that. On investigation the syntax got too messy and because the fix is a 1 cent resistor I decided to not proceed.

  piclover said  Any way to get the sources so that I could patch those and use them for more tests ?

I have emailed them to you.

Geoff

Geoff Graham - http://geoffg.net
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2288
Posted: 02:11pm 14 May 2016
Copy link to clipboard 
Print this post

  Geoffg said  
No Rob, that is not the complete list of keywords. Due to the way that the interpreter works there are a lot of additional keywords that are detected "on the fly". For example Integer as in DIM INTEGER nbr.

Geoff


i've added a second pass that searches for "checkstring" in the .C files. this seems to turn up (hopefully!) all the qualifier keywords, such as INTEGER, RED, OFF, AIN, C16.

2016-05-14_235958_tokens2.zip

is this them all? or at least almost all! if so, i'll do a little more processing on the results to create a simple list without duplicates. if there are a few stragglers that are left out these can be added in manually.


cheers,
rob :-)
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 02:34pm 14 May 2016
Copy link to clipboard 
Print this post

Yes Rob, you seem to have them all.
Geoff Graham - http://geoffg.net
 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 309
Posted: 02:58pm 14 May 2016
Copy link to clipboard 
Print this post

  Geoffg said  
Can you change your program? Most people run out of RAM because they are using string arrays which default to 256 bytes per element. If you used the LENGTH option you can reduce that considerably.


That exactly what I have done (before seeing your reply) and managed to find enough memory to stop the crashing. I had previously added the LENGTH option to a much larger array, but didn't bother with a couple of the small arrays.

I had already resorted to poking bytes in the memory space of the variable arrays to maximize memory usage. Eight bytes per integer array element to store single byte values was really wasting the memory.

Now I need to update the program docs from "arbitrary size limitation" to "limited by available memory"

Thanks,
Curtis

I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 03:18pm 14 May 2016
Copy link to clipboard 
Print this post

On using an external voltage reference:
  matherp said  I published a simple CFunction to do this in this thread.

That seems to do the job perfectly Peter. I will add it to the CFunction distribution with the firmware.

Geoff
Geoff Graham - http://geoffg.net
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 04:57pm 14 May 2016
Copy link to clipboard 
Print this post

  robert.rozee said  
i've added a second pass that searches for "checkstring" in the .C files. this seems to turn up (hopefully!) all the qualifier keywords, such as INTEGER, RED, OFF, AIN, C16.
:-)


Looking at your resulting file, it looks like anything in quotes is a keyword with one or two exceptions - mainly error messages.
That will be easy to extract and will make it easier for me to keep the syntax files up-to-date.

One list for MX170 and one list for MX470 would be nice.

Jim

VK7JH
MMedit   MMBasic Help
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 05:19pm 14 May 2016
Copy link to clipboard 
Print this post

  twofingers said  

I hope this is a false alarm! I'm on it ...

Uploading FontTweak.exe to Virus Total --> seems to be safe!

Regards
Michael



About 20% of the program I write are flagged by one or two AV programs.
It is a pain but I haven't been able to prevent it.

Qihoo-360 and Avira seem to be the worst at the moment.
Nortons is always a problem.

The only way is to get the AV company to white-list it. This has to be done for every version so would take up a lot of time. Time I am not willing to spend.

Jim

VK7JH
MMedit   MMBasic Help
 
piclover
Senior Member

Joined: 14/06/2015
Location: France
Posts: 134
Posted: 10:53pm 14 May 2016
Copy link to clipboard 
Print this post

  Geoffg said  
  piclover said  Again a "Error: Not enabled" during an I2C command issued after a RTC command got issued on an open I2C channel... Are you sure you fixed that bug ?

Ah, I fixed it for RTC GETTIME in V5.1 but forgot about RTC SETTIME (which is what you must be using).[/quote]RTC GETTIME was already working fine in v5.1 in this respect... However RTC SETTIME/SETREG were affected by that bug, like I described in my post (and gave the number of the culprit code line in the sources).

  Geoffg said  
  piclover said  This version also doesn't seem to allow pull up/down for FIN/PIN/CIN pins (and my trick of not resetting the pull up/down flag on SETPIN FIN/PIN/CIN invocation doesn't seem to be implemented either).

Sorry, I should have mentioned that. On investigation the syntax got too messy and because the fix is a 1 cent resistor I decided to not proceed.[/quote]What about using the trick I described (not resetting the pull up/down bits when SETPIN PIN/FIN/CIN is invoked, allowing to set the pull up/down resistor in a previous SETPIN DIN, PULL[UP|DOWN] instruction) ? It's described in the last post on this page: http://www.thebackshed.com/forum/forum_posts.asp?TID=8514&PN=2&TPN=9
The "cost" is not just a resistor: it's also more space eaten up on the printed circuit board, a more complex routing, etc...

[quote=Geoffg][sources]
I have emailed them to you.


Thanks a lot !
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2288
Posted: 02:04am 15 May 2016
Copy link to clipboard 
Print this post

  TassyJim said  Looking at your resulting file, it looks like anything in quotes is a keyword with one or two exceptions - mainly error messages.
That will be easy to extract and will make it easier for me to keep the syntax files up-to-date.


tinkered a bit more, the output is now comma delimited (CSV) and can be loaded into a spreadsheet. also included is a compiled .exe, which should be placed in a directory off MicromiteSource. run this from a command prompt, with the output piped with >. when loading the CSV file into a spreadsheet, specify all columns as text.

2016-05-15_114344_tokens3.zip

it does seem to miss out the lcd types for the MX170, as these seem to be handled differently to other modifiers - i've only been running this on the 5.1 sources, so 5.2 may be different. the output consists of three blocks of data:
1. scan for tokens (grouped by source .h file)
2. list of sorted tokens
3. scan for modifiers (grouped by source .c file)


and as a useful outcome, the output has led me to spot a small oversight in the micromite manual. the function rnd(number) should really be listed as rnd[([number])], since all three variations work the same:
print rnd(number)
print rnd()
print rnd

question/suggestion for geoff: would it be useful for rnd(number) to produce a floatingpoint result that is scaled to be in the range >=0 to <number? and should rnd() be legal? it seems to not be consistent with the syntax of other functions.


cheers,
rob :-)
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 11:53am 15 May 2016
Copy link to clipboard 
Print this post

Rob, The syntax for RND is the same as Microsoft BASIC. Bill was a little inconsistent when it came to this but I followed his syntax because there are a lot of old text based BASIC games on the net that used RND.

From what I remember RND(nbr) originally used 'nbr' as the seed but that was later replaced with RANDOMIZE. Microsoft BASIC ignores 'nbr' but your idea would be a good use for it.

Geoff
Geoff Graham - http://geoffg.net
 
piclover
Senior Member

Joined: 14/06/2015
Location: France
Posts: 134
Posted: 11:36pm 15 May 2016
Copy link to clipboard 
Print this post

I found a new quirk in v5.2 beta 1:

When powered up, the MX170 PWM channel 1 is not properly initialized and any attempt to enable it on program start results in a non-functional PWM (the pin stays at logic level 1).
The workaround is to reset the channel (with PWM 1,STOP) *before* attempting to use it.
Note that this quirk only happens on power up (AUTOSAVEd programs will run fine when ran without powering down, for example).
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 02:18am 16 May 2016
Copy link to clipboard 
Print this post

That is strange because the PWM channel is closed, effectively the same as stopping the PWM, before a program is run (in ClearExternalIO()).

I will have to setup a test.

Geoff
Geoff Graham - http://geoffg.net
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 05:25am 17 May 2016
Copy link to clipboard 
Print this post

I gave run to 5.2b1 and it looks like it is still unstable. I am getting strange behaviour from boards otherwise perfectly working with 5.1A, some OPTION ERROR CONTINUE generates an error as unrecognised word, and a few other smaller things which I can't remember right now.

One suggestion as well. It would be much more natural if TRACE LIST gives the list in its execution order. Right now it gives the list reversed - the first element is the last executed line. It is difficult to follow the logic this way.

http://rittle.org

--------------
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 11:00am 18 May 2016
Copy link to clipboard 
Print this post

Something for the manual that I was stumped on for a while regards the examples of Functions.

FUNCTION Phils(InputVal) AS FLOAT

Vs

FUNCTION Phils(InputVal As INTEGER) As FLOAT
When OPTION DEFAULT NONE is set.

Couldn't quite get my head around it for a while, despite repeatedly going over page 42.

A newcomer understanding issue undoubted, but an additional example would be good.

Thanks

Phil.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 03:22pm 18 May 2016
Copy link to clipboard 
Print this post

Good point Phil, thanks.
Geoff Graham - http://geoffg.net
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2288
Posted: 04:57am 22 May 2016
Copy link to clipboard 
Print this post

believe i've found a bug in the editor for version 5.1 (micromiteII). if you cut out a block of text and paste it back in further up in your code, the editor seems to loose track of where the last few lines of the listing is - you can not access them until save/exit and re-editing. this may well be a known bug.

note, the above relates to version 5.1 and has not been tested with 5.2

have tried editing code using the 5.2 editor (again micromiteII), but found the editor decidedly flakey i'm afraid. one of the problems seems to be that it gets extended key codes from teraterm mixed up; this could be that characters are being randomly dropped somewhere. i gave up when the micromite became comatose and needed reflashing.


cheers,
rob :-)Edited by robert.rozee 2016-05-23
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2288
Posted: 06:01am 22 May 2016
Copy link to clipboard 
Print this post

geoff:
have just checked to see if the problem with the last lines of a program becoming inaccessible is still in 5.2 beta 1. the issue still seems to be there.

method: create something in the editor more than a page long, say 40 lines. scroll to the top (so there is code below the bottom of the screen), scroll down 10 lines, mark and cut out a few lines (f4, f4). no need to paste it back in. now try scrolling down to the end of the code. sometimes (but not always!) things go wrong, cursor jumps to end of status line. characters can be typed in still, and are recorded.

there is also a problem when a basic program has space characters at the end. this confuses the editor when loading the program again (i presume the save routine is perhaps supposed to removing trailing spaces from lines?)

i've yet to be able to duplicate the comatose state i experienced earlier on.


cheers,
rob :-)
 
     Page 2 of 3    
Print this page
© JAQ Software 2024