![]() |
Forum Index : Microcontroller and PC projects : Micromite PlugIn Feature
Page 1 of 4 ![]() ![]() |
|||||
Author | Message | ||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3272 |
Following a conversation in the thread simplest 32MX150 ICSP I have been experimenting with providing a "plugin" feature for MMBasic. A plugin is a C or assembler program that can be loaded into MMBasic by a BASIC program. Because the module is written in a compiled or assembled language it can run much faster than a BASIC program and can more easily access the more exotic hardware features of the PIC32 microcontroller. I have a document describing how to write plugins with an example program. This can be downloaded from: geoffg.net/Downloads/Micromite/MMBasic_PlugIn.zip And a beta version of Micromite MMBasic (which supports a plugin) for the MX170 chips can be downloaded from here: geoffg.net/Downloads/Micromite/Micromite V4.6 Beta 1.zip This version is essentially the same as V4.5D with the addition of the PLUGIN command so no manual is provided. I am interested in any comments (good or bad) and especially if a technically adept programmer or two could experiment with the facility (Peter? John?). Thanks, Geoff Geoff Graham - http://geoffg.net |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2946 |
Wow Geoff, I think this can open up a whole suite of great opportunities here. I cant wait to see what people come up with. keep up the good work Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9502 |
I thought that you had to understand MIPS(and not many people can) to be able to do this kind of thing? That was with the MaxiMite though - is the MicroMite different in that regard? I figured as they are both "PIC32"... EDIT: Just read the info in the ZIP - You do have to understand MIPS(or C). ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3272 |
Using the technique described you only have to know C which is easier than MIPS assembler (although still difficult). The clue was given to me by JohnS and Peter (G8JCF) who pointed me to the plugins for ByPic Basic web page. The Micromite uses essentially the same technique. This feature could be extended to to the Maximite although it is best suited to the things that Micromites are used for. Geoff Geoff Graham - http://geoffg.net |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6224 |
This might finally get me doing something useful in C. I assume that as you reserve some memory for C code, we won't be seeing Plugins for the 150 chips? In the meantime, I should be able to produce a Windows utility to create the plugin data statements. Jim VK7JH MMedit |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3272 |
Precisely. Geoff Geoff Graham - http://geoffg.net |
||||
plasma Guru ![]() Joined: 08/04/2012 Location: GermanyPosts: 437 |
This cant be ..... Yea thanks Geoff , test it tonight. |
||||
plasma Guru ![]() Joined: 08/04/2012 Location: GermanyPosts: 437 |
Ups i cant call mmbasic functions ? |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2927 |
Brilliant timing - I wrote my first C program two nights ago for a PIC24F purely because the MicroMite wasn't fast enough. I am still recovering from the 'C' experience - hated it!!! Took all day just to set up and understand the IDE and how to 'structure' a program. Anyway, got an LED flashing after 14 hours, then took another 3 hours to emulate a PS2 keyboard. The PLUGIN feature will be VERY useful. I won't be able to try it yet as I have to go out today; but I will let you know how it goes . . . . (back to the C tutorials . . . .) |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9502 |
If you are getting "C" sick, don't forget to take your "C" sickness pills. ![]() ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4004 |
Geoff, I flashed it into a 28-pin MX170 and don't get anything on the console uart (pins 11 & 12). I was expecting a > prompt. Anyone else tried it? John |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1533 |
A few days ago I still thought it would be nice to have something like that for the MAXIMITE. It reminds me of the old C64. They used the "USR" command and POKEs for assembler plugins. One of the secrets of the popularity of the C64, I guess. Great and useful idea! Thanks @Geoff! Michael causality ≠ correlation ≠ coincidence |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2946 |
Hi John, It worked ok for me. I ran Geoffs sample and received Hello World Helmp World Now i dont speak 'C' but it appears that the Plugin finds the fourth and fifth characters in A$ and adds 1 to them. I was able to change the routine to add 2 to each character and change which characters changed.. What all this really means s beyond me but I am sure its more important than manipulating a strings contents. Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
This seems like a brilliant idea. I personally have not ever dealt with C but, if I am reading this correctly, it seems like this could be a great way to write "libraries" for all sorts of devices and functions and pick and choose which "modules" you want to incorporate. The speed factor is also very appealing. This sounds like the uMite could be a contender with other things out there. Time to learn me some C. I hope my old brain can handle this... Thanks Geoff!!!!!! |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4004 |
Mick, That's not what I got. I programmed a MX170 28-pin and get no prompt. I've tried it 3 times, putting back the previous version of MMBasic. (Which works OK.) Thus I cannot test the plugin feature. I can't test ANY feature of the beta MX170 28-pin MMBasic 4.6. I'm using pins 11&12 as the serial console, is that right? It works that way for the same chip programmed with 4.5(er, C or D). Has it changed or what? Did you use a 28-pin MX170? John |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2927 |
Two questions at this stage: 1> How are the Plugin Data numbers generated? i.e. once you have written your C code in MPLabX, what do you then do? 2> Can only one Plugin be incorporated into MMBasic? Thanks . . . . WW |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2946 |
Yes John, That is the chip, i only have 28 pinners.. I had a working 4.5d then pickitted a new firmware and it sprang up with 4.6beta 1 You are using the 28 pin firmware not the 44 pin.? Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4004 |
Yes, the 28-pin version. I'm puzzled. Must be doing something wrong but can't figure what. John |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2405 |
are you using a pickit3, your own software, or peter's software to do the programming? rob:-) |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4004 |
I've thought just the same and sadly I think that's the problem - I'm using my software. I can't use my PICkit3 currently as mplab's IPE doesn't support the MX170 (shocked me) as I have a slightly outdated version. It's a pig to (re)install it because Mchp don't follow any of the usual (very straightforward) Linux ways so I'm going to go bug-hunting rather than fight Mchp install oddities unless I really can't figure it. (I used a VM to fight Mchp stuff off and have every desire not to ever use their rubbish again.) I won't be using xc32 etc anyway, I'll just use normal gcc (same as I have done with ByVac's Basic for its plugins), so all I need is a flashed MX170. It's got to be a bug in my code, and needs fixing anyway, once I find it... John |
||||
Page 1 of 4 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |