Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 14:44 17 May 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 PlugIn Feature

     Page 1 of 4    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 05:49pm 12 Sep 2014
Copy link to clipboard 
Print this post

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: Australia
Posts: 2870
Posted: 06:09pm 12 Sep 2014
Copy link to clipboard 
Print this post

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 Zealand
Posts: 9080
Posted: 06:15pm 12 Sep 2014
Copy link to clipboard 
Print this post

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). Edited by Grogster 2014-09-14
Smoke makes things work. When the smoke gets out, it stops!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 06:34pm 12 Sep 2014
Copy link to clipboard 
Print this post

  Grogster said   I thought that you had to understand MIPS to be able to do this kind of thing?

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: Australia
Posts: 5923
Posted: 07:22pm 12 Sep 2014
Copy link to clipboard 
Print this post

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   MMBasic Help
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 07:59pm 12 Sep 2014
Copy link to clipboard 
Print this post

  TassyJim said  I assume that as you reserve some memory for C code, we won't be seeing Plugins for the 150 chips?

Precisely.

Geoff
Geoff Graham - http://geoffg.net
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 08:32pm 12 Sep 2014
Copy link to clipboard 
Print this post

This cant be ..... Yea thanks Geoff , test it tonight.
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 09:01pm 12 Sep 2014
Copy link to clipboard 
Print this post

Ups i cant call mmbasic functions ?
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 09:41pm 12 Sep 2014
Copy link to clipboard 
Print this post

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 . . . .)
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9080
Posted: 10:09pm 12 Sep 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 3677
Posted: 10:24pm 12 Sep 2014
Copy link to clipboard 
Print this post

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?

JohnEdited by JohnS 2014-09-14
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1139
Posted: 12:47am 13 Sep 2014
Copy link to clipboard 
Print this post

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
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2870
Posted: 03:15am 13 Sep 2014
Copy link to clipboard 
Print this post

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 States
Posts: 925
Posted: 03:56am 13 Sep 2014
Copy link to clipboard 
Print this post

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!!!!!!Edited by viscomjim 2014-09-14
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3677
Posted: 04:04am 13 Sep 2014
Copy link to clipboard 
Print this post

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?

JohnEdited by JohnS 2014-09-14
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 04:14am 13 Sep 2014
Copy link to clipboard 
Print this post

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
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2870
Posted: 04:17am 13 Sep 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 3677
Posted: 04:34am 13 Sep 2014
Copy link to clipboard 
Print this post

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 Zealand
Posts: 2294
Posted: 04:47am 13 Sep 2014
Copy link to clipboard 
Print this post

  JohnS said  
I'm puzzled. Must be doing something wrong but can't figure what.
John


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 Kingdom
Posts: 3677
Posted: 06:09am 13 Sep 2014
Copy link to clipboard 
Print this post

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...

JohnEdited by JohnS 2014-09-14
 
     Page 1 of 4    
Print this page
© JAQ Software 2024