Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Saving space in the firmware Post ReplyPost New Topic
<< Prev Page of 3 Next >>
Author
Message << Prev Topic | Next Topic >>
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2402
Posted: 06 August 2018 at 12:22am | IP Logged Quote Geoffg

I agree with all that has been said in this thread on this subject.

As Rob pointed out there are quite a few places where space savings can be found and I hunt them down when a bug fix or two needs some more flash. However, each only returns a few hundreds of bytes which are good for bug fixes but not enough for major new features.

Another option is to crank up the compiler optimisation. At this time the speed critical areas are optimised for speed and the rest is optimised for space saving. If I optimised the whole lot for space saving we would have plenty of free flash but with a big reduction in speed (about 30% slower).

Making the interpreter modular or employing CFunctions has often been suggested as a solution. For example, making special devices into externally loadable "modules". This sounds good but for various technical reasons it is not practical. CFunctions in particular are fraught with difficulties. They run just as fast as built in functions but compiler and other issues means that they are only good for some jobs. For example, the DISTANCE function could be made into a CFunction but not the IR function.

The question remains... what would you do with this extra flash if you had it? Support for some extra LCD panels and GUI controls would be nice but not critical.

A great solution would be for Microchip to make the MX470 in a 28-pin SDIP package but I have been told that the die is too big to fit. I think that we were lucky to have the MX170 in a SDIP, previously we only had the MX150 in such a package and with half the flash it was an enormous squeeze getting a cut down MMBasic to fit.

Geoff

Edited by Geoffg on 06 August 2018 at 12:25am



Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2340
Posted: 06 August 2018 at 12:28am | IP Logged Quote matherp

I don't understand the motivation behind this thread. AFAIK the only reason to remove functionality would be to substitute something new and more generally useful and as Geoff has commented there is absolutely no consensus on what this might be.

There are 3 current limitations:
first: the number of commands and functions (each must be less than 128). This is not to do with available memory but with the way the internals of MMBasic work. It could be overcome with a major re-write but this just makes the language bigger and more complex to master.
second: the available flash memory which is shared between the MMBasic language and the user program
third: the available RAM. MMBasic uses a small amount of this but the majority is already available for user variables. The available RAM also limits the size of a program that can be edited or uploaded.

The second limitation specifically affects the MM2 due to the limited flash memory available. Removing functionality would not change the size of a program that could be edited or uploaded but would only increase the size/number of routines that could be pre-loaded into the library as either Basic or C functions or subroutines.

So........
what is the objective of saving space in the firmware as posited in the thread title? Nothing Geoff can do can make the 28-pin DIP MM2 into a MM+ with, for example, GUI support. There are lots of options for higher power Micromites with more memory but none of them available in DIP packages which I sense is the real crux of the issue behind the thread.


Back to Top View matherp's Profile Search for other posts by matherp
 
viscomjim
Guru
Guru


Joined: 08 January 2014
Location: United States
Online Status: Offline
Posts: 830
Posted: 06 August 2018 at 12:58am | IP Logged Quote viscomjim

I would use the extra space to store data and variables if it could work beyond the 2k limit. Could possibly eliminate the use of external memory device in some applications.
Back to Top View viscomjim's Profile Search for other posts by viscomjim
 
robert.rozee
Guru
Guru


Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 1311
Posted: 06 August 2018 at 3:04am | IP Logged Quote robert.rozee

Geoffg wrote:
The question remains... what would you do with this extra flash if you had it?


personally (and this is just my opinion), i'd beef up the built-in editor a bit more (including mouse cursor positioning via X10 escape sequences), and expand the MEMORY command so that it can list all current variables, their type, how many bytes of RAM each consumes, and length for strings.

and perhaps trap a few more syntax errors, like DIM mdow(7) AS STRING LENGTH 3 = ("SUN","MON","TUE","WED","THR","FRI","SAT") that has tripped up so many of us. oh, and add ATAN as an alias for ATN :-)


technically, at some point microchip will be in the position to shrink the die size for the MX170 and MX470 through moving them to smaller lithographic nodes, and hence also reducing cost. at that point i could see doubling flash being on the cards, but only if they decide (from a marketing perspective) that they want to carry on with DIP packaging. bear in mind that a 512k flash MX170F512 already exists in: 64 pin QFN package, 64 and 100 pin TQFP, and perhaps most interestingly a 100 pin TFBGA that measures only 7mm x 7mm - that is small enough to sit on top of an SDIP package.

so if anyone wanted to, they could today build a 28-pin MX170 with 512k of flash, albeit as a TFBGA sitting atop a 0.3" wide PCB carrier with attached pins.


cheers,
rob :-)


Edited by robert.rozee on 06 August 2018 at 3:05am
Back to Top View robert.rozee's Profile Search for other posts by robert.rozee
 
Phil23
Guru
Guru


Joined: 27 March 2016
Location: Australia
Online Status: Offline
Posts: 1510
Posted: 06 August 2018 at 8:24am | IP Logged Quote Phil23

robert.rozee wrote:
i believe DISTANCE has already gone that way

Yeah, now that you mention it I was aware of a few being mentioned in the release notes.

Quote:
a while ago geoff mentioned in a forum post that one key point for an inbuilt function is that it be something that can not easilly be otherwise accomplished in basic. going beyond this, one of the 'selling points' of the micromite, from the start, has been a simple out-of-the-box experience for the beginner. as such, support for certain 'core' devices was built in by geoff: DS18B20, keypad, HD44780-based LCD modules, servos. all these were cheap peripherals, that could easily be hooked up on a breadboard, and then accessed with just a few basic statements.


An for precisely that reason as many as possible should stay in the mainstream version. All those being in-built were of a huge benefit in my early days.

It would only suit now for me to use a cut down Lite version
now, IF I was having a RAM issue.


Cheers

Phil.
Back to Top View Phil23's Profile Search for other posts by Phil23
 
lizby
Senior Member
Senior Member


Joined: 17 May 2016
Location: United States
Online Status: Offline
Posts: 224
Posted: 11 October 2018 at 10:30am | IP Logged Quote lizby

CaptainBoing wrote:
My dev' cycle might seem a little convoluted but it works really well for me: everything is written and maintained in the editor (Notepad++) Ctrl-A, Ctrl-C, F10 on the Mite (via putty or USB Terminal), a right click to paste everything, Ctrl-Z and that is it. It is a fast cycle and I reduce field reliance to an editor and a terminal prog.


Can you explain this in a little more detail--in particular, the setup of putty and how the F10 key works--I read that it stands for AUTOSAVE, but when at the ">" prompt, if I hit F10, "OY" is printed. Right click then stalled after a few lines.
Back to Top View lizby's Profile Search for other posts by lizby
 
CaptainBoing
Guru
Guru
Avatar

Joined: 07 September 2016
Location: United Kingdom
Online Status: Offline
Posts: 626
Posted: 11 October 2018 at 4:38pm | IP Logged Quote CaptainBoing

here you go, I exported by workbench session for you. If you pop the attached file in
C:\Program Files\ExtraPuTTY\Bin\Sessions (or whereever you store your putty sessions) you'll have all
the settings I use

2018-10-11_163839_lizby.zip

hth
Back to Top View CaptainBoing's Profile Search for other posts by CaptainBoing
 
panky
Guru
Guru
Avatar

Joined: 02 October 2012
Location: Australia
Online Status: Offline
Posts: 549
Posted: 11 October 2018 at 7:14pm | IP Logged Quote panky

I agree with Peter's observations here. If you are running out of space on an MM2, move up to an MM+, it's really not all that much bigger in terms of board space. If you are frightened of the smd, there are numerous sources of pre-built boards that are not all that much more expensive than buying the bits and doing it yourself - and you get all the wonderful features of GUI.

Personally, all my projects are based om MM+ using LCD displays and GUI display elements. I would really, REALLY like to have even more GUI functionality such as touchable DISPLAYBOX, a way to assign an area as GUI so I can do non GUI inside this space but treat it as a GUI CTRLVAL.

I do use 170's but basically as dumb front ends to a MM+ display controlling back end.

Wonderfull, wonderfull job Geoff, in creating the amazing MM environment, it fills my days (when SWMBO doesn't have jobs lined for me 😂😂) with enjoyment and the challenge of building and programming my "toys" ( as she calls them)!!

Thanks,
panky.


__________________
DonTSM1,Duinomite,CGCMM1,CGCMM2,2xDimitech,3xWWuMites,MicksMuP,Grogster1A,4xPeterMuM+,Zonker DIP-600,3xCGuKits,CGuBoard2,SnadPic100,SCBP64 & Exp100,PMMZ144,PMMZ100 .. and loving it![:D
Back to Top View panky's Profile Search for other posts by panky
 
Volhout
Regular Member
Regular Member


Joined: 05 March 2018
Location: Netherlands
Online Status: Offline
Posts: 65
Posted: 11 October 2018 at 7:49pm | IP Logged Quote Volhout

All,

As this thread diverts into a wishlist for the 170, I have to show my support for
the mouse functioning in the build in editor.
I generally do not use a microsoft environment, so I am bound to using the build in editor. And I am not able to count on hands and feet how many times I intuitively clicked in the PUTTY screen and started editing somewhere else in the code.

Or CTR-Z to undo changes.

Volhout


__________________
If nothing goes right ... turn left
Back to Top View Volhout's Profile Search for other posts by Volhout
 
lizby
Senior Member
Senior Member


Joined: 17 May 2016
Location: United States
Online Status: Offline
Posts: 224
Posted: 12 October 2018 at 1:22am | IP Logged Quote lizby

CaptainBoing wrote:
here you go, I exported by workbench session for you. If you pop the attached file in
C:\Program Files\ExtraPuTTY\Bin\Sessions (or whereever you store your putty sessions) you'll have all
the settings I use

2018-10-11_163839_lizby.zip

hth

Thank you for this, but I don't know where my putty sessions are stored. I have run putty from a folder other than "Program Files". There is no "ExtraPutty" folder in that directory or in "Program Files".

I downloaded the latest Putty version (.70), and it is in "Program Files". It found my sessions, but I still don't know of a folder where they are located (not in "Program Files\Putty"). The FAQ says they are in the registry, so I ran regedit and could see them there, but still no clue as to where to put the session file you sent. Any ideas?
Back to Top View lizby's Profile Search for other posts by lizby
 
CaptainBoing
Guru
Guru
Avatar

Joined: 07 September 2016
Location: United Kingdom
Online Status: Offline
Posts: 626
Posted: 12 October 2018 at 1:40am | IP Logged Quote CaptainBoing

ExtraPutty is just a version of Putty with some extras in it (like xModem etc)

go into putty, look through your sessions for one with a distinctive name then do a search on your C drive for it - that will find where putty is storing your sessions on your PC - or maybe your version is different from the version of Putty I use (I like config files and not hiding the data in the registry).

Failing that, here is the keyboard config from the session - I am hoping this will set your F keys correctly




Edited by CaptainBoing on 12 October 2018 at 2:38am
Back to Top View CaptainBoing's Profile Search for other posts by CaptainBoing
 
lizby
Senior Member
Senior Member


Joined: 17 May 2016
Location: United States
Online Status: Offline
Posts: 224
Posted: 14 October 2018 at 4:44am | IP Logged Quote lizby

I think I'm close now. With right-click after F10 gives me AUTOSAVE, the first 50 (of 777) lines or so look good, then things get garbled with much missing, then the end looks good.

Ctrl-z give me "Error: line is too long".

RUN gives me an error which indicates that a routine in the middle of the code is missing.

Could be a flow-control error--mine is set for XON/XOFF. This is with an Explore-64. Baud rate is 115200.




Edited by lizby on 14 October 2018 at 4:49am
Back to Top View lizby's Profile Search for other posts by lizby
 


<< Prev Page of 3 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1719 seconds.
Privacy Policy     Process times : 0, 0.02, 0, 0.16