Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:36 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 : MMBasic 4.4 Beta 6

     Page 2 of 2    
Author Message
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 02:28am 28 Jun 2013
Copy link to clipboard 
Print this post

For low power applications such as data logging, the following system could be used:

1 use an external timer to power-up the Maximite with a pulse long enough to get AUTORUN.bas started.
2 In the first few instructions, set a pin which has the job of holding the power on, allowing the program to run it's course.
3 When the program has done its job, unset the pin, removing the power.
4 Wait, with only the external timer running ( a few microamps) until the cycle repeats.

This idea would be a little more complicated if you had to control something, like hold a relay on, while asleep.

David
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 03:08am 28 Jun 2013
Copy link to clipboard 
Print this post

Geoff,

Would it be possible to have the MODULE LOAD command available as a command line operative and by extension, any subroutines or functions defined therein acessable as command line operatives?

This would allow anyone to " extend " MMBasic to their hearts delight and for their own specific purpose while still allowing you to control the core interpreter?

As an example, a HELP command ( implimented as a defined subroutine ) to open a random access file, seek to the appropriate area, extract the command help info, display it etc. etc.

I appreciate it would slow things down generally, but would satisfy many of the reqests you get for " additional commands " that you have rightly pointed out in the past that may be specific to a particular persons needs and thus better as a defined sub or function.

Again, I don't know how feasible this would be but I imagine if your command line parsing routine could scan through the area that MODULE LOAD uses for any additional code and execute it immediately.

The NEW command or an explicit MODULE UNLOAD would disable the newly defined "commands".

For you comments and consideration.
Regards, Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 05:28am 28 Jun 2013
Copy link to clipboard 
Print this post

I'm leaving Geoff to decide on how doable the various ideas are, but I think HALT is an odd choice of word as the system wouldn't have halted. Maybe WAIT. Maybe EVENTWAIT or something else.

"simply re-initialise" - as if!!

John
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 05:53am 28 Jun 2013
Copy link to clipboard 
Print this post

The HALT comes from assembly language instructions used in PC's (x86) and also for instance the Z80. I suspect others had the same instruction.

x86 HLT instruction
Z80 Halt instruction

As you can see from the description of those instructions it is 'going into idle/suspend' and only respond to interrupts.
Instead of halting the CPU as is done from assembly language, HALT in basic would 'suspend' the basic interpreter.

Microblocks. Build with logic.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 07:50am 28 Jun 2013
Copy link to clipboard 
Print this post

Yeah, I figured that was why you chose it but it simply isn't right for this situation I reckon. Also sounds like it gives Geoff a pain to do yet achieves almost nothing.

Using HALT could easily make a new user think the system has halted which it very definitely will not have done.

Maybe YIELD would be better, if it's done at all.

John
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1082
Posted: 08:13am 28 Jun 2013
Copy link to clipboard 
Print this post

If you don't like an empty DO : LOOP then use the following:

HALT:
GOTO HALT

It's standard enough in C to write WHILE(1); to 'hang' the processor and let interrupts do their thing. And MMBasic may still be quite busy in the background even in the empty loop. I don't see a need for a HALT command.

About the MMBasic beta zip file - could it include a small text file to remind forgetful people like myself what the firmware update procedure is?Edited by vegipete 2013-06-29
Visit Vegipete's *Mite Library for cool programs.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 08:39am 28 Jun 2013
Copy link to clipboard 
Print this post

CHANGES.TXT or RELEASE.TXT kind of thing.

John
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 01:03pm 28 Jun 2013
Copy link to clipboard 
Print this post

  JohnS said   "simply re-initialise" - as if!!
John


What do you mean? If Geoff says he won't make it, it won't be made? Wrong! Besides, he only said he had left it for now because it looked like too much trouble at the start. So, don't write it off too quickly.


  crez said   For low power applications such as data logging, the following system could be used:

1 use an external timer to power-up the Maximite with a pulse long enough to get AUTORUN.bas started.
2 In the first few instructions, set a pin which has the job of holding the power on, allowing the program to run it's course.
3 When the program has done its job, unset the pin, removing the power.
4 Wait, with only the external timer running ( a few microamps) until the cycle repeats.

This idea would be a little more complicated if you had to control something, like hold a relay on, while asleep.

David


This has a good seed in it actually. And with the PWRON input in the 4105 module, it is half done and only the "off" feature will be needed outside, which might well be just a single transistor. I will publish a circuit for it.
But that is not a complete solution to the low-power dilemma.

Edited by kiiid 2013-06-29
http://rittle.org

--------------
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 09:23pm 29 Jun 2013
Copy link to clipboard 
Print this post

  Juri74 said   hello! i think i found a bug.. please try this little program
Mode 4
Dim a(10000)

graphics will corrupt if you go under the bottom of the screen and let it scroll up!

You do find the curly ones Juri!! I will fix it in the final version. It is hard to recover cleanly from that sort of error so the video might have some strange colours but at least you will be able to save your program.


  panky said  Would it be possible to have the MODULE LOAD command available as a command line operative and by extension, any subroutines or functions defined therein acessable as command line operatives?

Yes, in fact it should have been possible in the first place. This is something else that I will fix in the final version.

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

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 12:49am 30 Jun 2013
Copy link to clipboard 
Print this post

Geoff,

Thanks for the MODULE LOAD response - I already have some plans to use this.

Cheers, Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 06:58pm 30 Jun 2013
Copy link to clipboard 
Print this post

A quick "heads up" for anyone using the beta test versions...

In the final release I plan to rename the MODULE command to the LIBRARY command as that better represents what the command does (ie, it loads a library of subroutines and functions).

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

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 05:11am 01 Jul 2013
Copy link to clipboard 
Print this post

Thanks for the heads up about regarding the MODULE to LIBRARY change, Geoff.
 
Juri74

Senior Member

Joined: 06/02/2012
Location: Italy
Posts: 162
Posted: 11:20am 01 Jul 2013
Copy link to clipboard 
Print this post

  Geoffg said  You do find the curly ones Juri!! I will fix it in the final version. It is hard to recover cleanly from that sort of error so the video might have some strange colours but at least you will be able to save your program.


i found it by mistake, but i was fascinated by the "early pc looking" style of screen, of course was possible to save program and recover the screen by issuing a "mode 1" command..

may i ask a last minute addon (of course if it is fast&easy to do) could be possible to have a command to put the sprite data on screen? like "SPRITE ON n,x,y" but simply paste the sprite data on screen without activate the sprite itself, some like "SPRITE PASTE n,x,y" then the sprite will be drawn on screen and become a part of the screen itself

Juri
Edited by Juri74 2013-07-02
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 11:33am 01 Jul 2013
Copy link to clipboard 
Print this post

Sound like a usefull extension Juri74

Nick
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 08:54pm 03 Jul 2013
Copy link to clipboard 
Print this post

Geoff is supporting a 2nd I2C bus within the possibilities?

Currently MM pin 12 and 13 (I2C1 peripheral in the PIC32) are used and i wonder if using the pins that are connected to the RTC (I2C2 peripheral in the PIC32) can also be used.

The reason is that i would like to be able to put one I2C in slave mode and the other in Master.
It would be no problem if the one that is connected to the RTC can only be a Master.

I would like to avoid using one I2C and constantly switch between Master and Slave mode, potentially missing a communication from a slave on time. Essential that the master can send commands while waiting for data.
Events that the master needs to respond to are very infrequent with some slaves (but important), and more frequent with others. Polling is not really a solution. When the mcu is also a slave then all the other can initiate a communication to the 'master'.

It is very typical in feed-forward systems. The master just gives a command like 'start process' and does not need any feed-back to check upon its progress or correctness. The slave module will do that as it has its own intelligence. When the slave has a situation that the master needs to know it has to communicate this to the master, but can not wait for the master to poll it first.
Only solution now possible would be using an interrupt line but that means lots and lots of extra wiring. Using a single interrupt line would be possible but then the master has to poll all the slaves to know which one fired the interrupt.

Possible applications for this are numerous. Especially in control applications. Monitoring, solar, heating, logging, lighting, etc..
Edited by TZAdvantage 2013-07-05
Microblocks. Build with logic.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 03:55am 04 Jul 2013
Copy link to clipboard 
Print this post

  TZAdvantage said   Geoff is supporting a 2nd I2C bus within the possibilities?

No, sorry but I don't have any such plans. This is a case of where you will have to download the source and add it yourself.

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

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 08:23am 09 Jul 2013
Copy link to clipboard 
Print this post

Geoff,

I just wanted to thank you again for the module load/unload and use of subs in interrupt routines. Those two additions made a huge difference for me. I have a working interrupt driven wireless webserver running on a UBW32 and RN-VX wifly module.

A module is used to hardware reset the wifly and then configure for the intended purpose. Using wifly firmware 4.10c allows me to also use the wifly as an simple access point.

Thanks again.
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024