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: AustraliaPosts: 152 |
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: AustraliaPosts: 1101 |
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 KingdomPosts: 3802 |
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: ThailandPosts: 2209 |
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 KingdomPosts: 3802 |
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: CanadaPosts: 1109 |
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? Visit Vegipete's *Mite Library for cool programs. |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3802 |
CHANGES.TXT or RELEASE.TXT kind of thing. John |
||||
kiiid Guru Joined: 11/05/2013 Location: United KingdomPosts: 671 |
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. 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. http://rittle.org -------------- |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
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. 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: AustraliaPosts: 1101 |
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: AustraliaPosts: 3194 |
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 StatesPosts: 147 |
Thanks for the heads up about regarding the MODULE to LIBRARY change, Geoff. |
||||
Juri74 Senior Member Joined: 06/02/2012 Location: ItalyPosts: 162 |
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 |
||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
Sound like a usefull extension Juri74 Nick |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
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.. Microblocks. Build with logic. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
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 StatesPosts: 147 |
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 |