Duinomite MINI, MEGA and eMEGA back in stock

DuinoMite-Mega

Duinomite-MINI, MEGA, eMEGA boards were made specially to run BASIC on PIC32 processors, but are well packed with features boards, so people were using them not only with BASIC interpreter but also programming them in C.

There were not high runners, so at one point we were selling just few per month and when the blank boards were out of stock we had hesitated if to run them again or not, with the time lot of people signed for notification when back in stock so we decided to run small batch of all these three and re-stock.

Now we got them back in stock.

MPIDE Arduino like IDE for PIC32-Pinguino and Duinomite boards

Image

With this tutorial video below we will show you how to setup MPIDE Arduino like IDE to work with PIC32-PINGUINO, PIC32-PINGUINO-OTG, PIC32-PINGUINO-MICRO, DUINOMITE, DUINOMITE-MINI, DUINOMITE-MEGA, DUINOMITE-eMEGA.

Here is video tutorial how to install MPIDE and add support for Pinguino and Duinomite boards:

MPIDE installation is also described in our Wiki

Why to use MPIDE?

It’s an alternative to Pinguino IDE and Duinomite Basic. You have one more option to use these boards.

Pinguino IDE  ( pinguino.cc ) was made as parallel project to Arduino but for PIC microcontrollers, instead of Java it uses Python for the IDE, with the latest Oracle – Google lawsuit we still wonder if Java was the best choice for Arduino IDE, but nevertheless Arduino was made earlier and managed to attract huge community. Pinguino community is still small and the demo codes for Pinguino are not so many as for Arduino.

Microchip and Digilent financed the release of MPIDE which is pure Arduino IDE fork and thus more familiar for the Arduino community to use. As MPIDE already have good PIC32 support it was very easy to add support for PIC32-Pinguino and Duinomite there.

Why to use MPIDE and C for Duinomite?

Duinomite boards are low cost but powerful boards initially made specially for project named Maximite.
Two years ago we found interesting project which makes Basic computer with just PIC32 processor.
I started with Apple ][ so it was very nostalgic to see BASIC computer made with embedded processor and to control GPIOs and resources in BASIC.

At that time Maximite was advertised as “open source” project, i.e. firmware sources were available for download. The hardware schematic also was present in JPEG format.

As hardware engineers we immediately spotted some weakness in the Maximite hardware design – the author being mostly software engineer omitted lot of hardware features PIC32 have.

While PIC32 have ultra low power modes, hardware SPI, I2C, UARTs, parallel interfaces which could work with MHz clock speed, for some weird reason the Maximite author decided to implement them by bit-banging purely in software – cripple-ing these interfaces to very low speeds only. Low power modes were not implemented at all.

So we decided to improve the hardware – this is how we made our board with low power design, hardware UARTs and SPIs, UEXT and Arduino connectors so Arduino shields like Gameduino etc could be placed on top of the board and so on.

We completed our hardware design and we proudly offered the Maximite author to check it and tell us his opinion … but he told us that he is not interested and demanded us to choose different name than Maximite. It was a quite surprising open source project author to refuse contribution. So we named our board Duinomite (Maximite is also explosive so we wanted to show where our board roots are).

Being mostly Hardware company we couldn’t implement the software our self, so we contacted Ken Seggler who at this time made port of Maximite for ChipKit board with same PIC32 processor. He was unemployed at that time and he accepted to make the port and even to implement our new ideas we had about low power sleep modes, the new hardware UART and SPI, SETUP command for general board setup, Gameduino commands, we discussed on public forum how to implement editor inside the BASIC and label-less commands etc.

Unfortunately this move really pissed off the Maximite author. He saw the Maximite BASIC port to our board as direct competition as now our hardware had more features than his own.

He closed the Maximite Basic source, then wrote one nasty page about Duinomite on his web presenting him as victim of the big bad company who steal his work and removed his name out of it.
From day one Duinomite Basic fork is on GitHub and anyone can check how true these blames are – Maximite author’s name have been always on our Duinomite Basic fork and display on startup . We had to fork his BASIC just because he refused to support our hardware.

Meantime Ken found full time job and couldn’t contribute to the project anymore, the Maximite author released new version of Maixmite Basic with label-less commands, build-in editor and his new Maximite hardware has … Arduino connectors  (surprise surprise 🙂 ), so after all he has listened to us and took our contributions silently back !

Duinomite software left at that stage as no one was interested to duplicate Maximite Basic work and to run in parallel two same language implementations. The Maximite author had one problem though – while Duinomite quality build hardware cost just EUR 20 the Maximite less capable hardware in kit form cost was something like x3 times more and obviously people were buying Duinomite hardware, so to increase his followers he made Duinomite support and offered HEX compiled version of his Maximite BASIC for Duinomite – actually doing what we originally asked him for to do!

As far for the Duinomite BASIC fork – none of the younger and capable developers is interested in BASIC. Most of Maximite / Duinomite BASIC users are 40+ years and just users but not contributors / developers, so Duinomite BASIC development is pretty much dead.

Although Duinomite boards are still high seller, I guess 99% of people buy them and use them as regular PIC32 development board and use C instead of Basic judging from the tech supports questions we get.

Now with MPIDE Arduino like IDE people who are familiar with Arduino can develop on Duinomite too.

Weekend Programming Challenge Issue-18 – Console Text Editor

Image

Problem: create simple text editor for VT100 terminal

Many of us remember Borland’s Turbo Pascal V3.0 which in 39K had compiler, linker, run-time library and minimal WordStar type text editor.

BAS-INT is freeware tiny Basic interpreter with the bare minimum for BASIC scripting language. It works with external files only and is with Basic Stamp like syntax.

The Challenge today is to write minimal console editor which to complement BAS-INT and to perform some very basic commands:

List – list the program in memory with numbers
Delete N(-M) – deletes line N or N to M from memory
Insert N – inserts line on number N
Run – runs the BASIC program in memory (this code is already available)

if one wants to make it even more advanced he may make also the
Edit N – prints the content of line N and allow it to be edited

Remember this is console application and you have just serial in and serial out, no fancy graphics and windows in this editor.

The BAS-INT template is uploaded on GitHub https://github.com/OLIMEX/WPC/tree/master/ISSUE-18/BAS-INT

The rules:

You can code the solution in any programming language (well obviously as you have to integrate BAS-INT which is written in C this any language for this problem must be C) during the weekend and have to submit it to info@olimex.com latest on Sunday July 21th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

DuinoMite is now on GitHub

DuinoMite software development was suffering from missing version control since we started it. There are 4 developers who contributed to the project but there was quite lack of coordination as we put all stuff on Ken’s shoulders.

Ken’s release from February 16th, 2012 was with few minor bugs on the UART configurations, but being busy he had no time to fix these. This weekend I had some free time after we finish the iMX233-OLinuXino design and took a look at the sources and fixed few port definition and UART initialization mistakes.

Now the source is on GitHub https://github.com/OLIMEX/DuinoMite

I put there also the latest Hardware CAD files and from now on the latest revisions will be there.

DuinoMite DM-BASIC now have CAN support

Good News! Frank Voorburg implemented CAN support BASIC commands for DuinoMite http://www.kenseglerdesigns.com/cms/forums/viewtopic.php?f=4&t=259

Running StickOS BASIC on DuinoMite-Mega

Image
StickOS is BASIC interpreter which runs on Microchip PIC32 and Freescale MCF52XX microcontrollers. Recently in release 1.92 support for DuinoMite-Mega was implemented so I did a test drive this weekend.

To install StickOS on DuinoMite is very easy, you should go in bootloader mode and start DuinoMite bootloader then to load this HEX: http://www.cpustick.com/downloads/StickOS.PIC32.DuinoMite-Mega.v1.92d.elf.hex and then if you are on WIndows you need this INF file for the USB VID/PID which StickOS uses: http://www.cpustick.com/cpustick.inf

when you program the HEX code and press reset new COM port will be created you can use your terminal program of choice to connect to this port and you will see:

Welcome to StickOS for Microchip PIC32MX7-F512H DuinoMite-Mega v1.92d!
Copyright (c) 2008-2012; all rights reserved.
http://www.cpustick.com
support@cpustick.com
(checksum 0xe2e6)
>

StickOS pre-tokenize BASIC command and do syntax check while you enter your code

This is good as it speeds the execution of the code later also it prevent you to write code with syntax errors.

For instance if you want to write:

>10 non-existing command
^ – error

you will receive this error message and nothing will be stored to line 10

pre-tokenizing the source allow later the interpreter to switch the statements with single byte  comparison instead the multiply byte comparison which MM/DM BASIC does and this allow speed increase, another speed increase feature is that StickOS uses just the real PIC32 peripherials and do not make bit-banging as MM BASIC does, this result it x4 times faster execution:

10 dim a
20 configure timer 1 for 1 s
30 on timer 1 do print a
40 for a = 1 to 200000
50 next

prints 112518 BASIC instructions per second

what I missing in StickOS is:

– no VGA and PS2 keyboard support

– no SD card file system

– print command is very simplified

– not open source, although there is mechanism to add new commands by skeleton source which links the core basic as pre-compiled object code

It’s very easy to go back to MM/DM BASIC by simply entering bootloader mode and re-loading the HEX file for MM/DM BASIC.

If you want to give it try to StickOS BASIC you can first learn the commands by reviewing these PDFs:

Quickstart guide

http://www.cpustick.com/downloads/quickref.v1.90.pdf

and user manual

http://www.cpustick.com/downloads/stickos.v1.90.pdf

HACKING DuinoMite BASIC

Image

There is FIRMWARE WISHLIST on Ken Segler Designs forum and I post there a lot with requests for this or that command to be add 🙂

As the DM-BASIC code is over 30 000 lines I never looked at it in detail, just if wanted to see how some command works I was looking at the specific code which implements it.

Overall I though it’s difficult and confusing to touch in so big code as I could easily mess up something with the other commands.

Iggy from KSD forum did some commands recently for me and when he submited them to Ken to include in the mainstream code I was amazed how simple was to add command to DM-BASIC.

For instance he implemented function DM.VMEM which returns the first address of the video RAM as Nick requested on TBS forum, the code insertion was:

in graphics.h there is one line to add:

// Ingmar
{ “DM.VMEM”, T_FNA | T_NBR, 0, fun_vmem },

this row define the name of the new statement: “DM.VMEM” then define it as FUNCTION returning NUMBER and will call fun_vmem() to get it’s value

and in graphics.c there is this code snip to add:

/////////////////////////////////////////////
// Returns lower 16 bits of video buffer.
// This assumes the upper 16 bits always start 0xa000, maybe we should return all 32 bits?
/////////////////////////////////////////////
void fun_vmem(void) {
int vmem = (int)VA;

vmem &= 0x0000ffff;
fret = (float)vmem;
}

so with adding 5 lines of code we already have new DM.VMEM function which returns the address of the Video buffer!

WOW! I didn’t expect it to be SO easy!

now let’s see how he implemented SHIFTOUT:

first define it in external.h
// Ingmar
{ “SHIFTOUT”, T_CMD, 0, cmd_shiftout },

this time this is COMMAND i.e. do not return value and the code is at cmd_shiftout()

and the code is put in external.c

///////////////////////////////////////////////
// This is invoked as a command (ie, shiftout(Dpin, Clkpin, Mode, OutStr, NumBits) )
// Remember that the string returned in outstr will have the length in byte 0, outstr[0]

#define uDly(a) {WriteCoreTimer(0); while(ReadCoreTimer() < a);}

void cmd_shiftout(void) {
int dpin, cpin, mode, nbits;
int ix, iy; // loop counter
int cnt; // number of bytes to output.
unsigned char mybyte;

char * outstr;

const int BDLY = 3; // Determines clocking rate. # of CoreTimer cycles.

getargs(&cmdline, 9, “,”); // Get the arguments, we should have five, comma seperated.

if (argc < 9) error(“Invalid syntax”); // Test number of arguments given.

dpin = getinteger(argv[0]); // Data pin
cpin = getinteger(argv[2]); // Clock pin
mode = getinteger(argv[4]); // Mode
outstr = getstring(argv[6]); // String to clock out,treated as an array of bytes.
nbits = getinteger(argv[8]); // Number of bits to clock out

if (nbits < 1 || nbits > (outstr[0] * 8)) error(“Too many/few bits”);

if (dpin < 0 || dpin > NBRPINS || cpin < 0 || cpin > NBRPINS) error(“Invalid pin number”);
if (ExtCurrentConfig[dpin] >= EXT_COM_RESERVED || ExtCurrentConfig[cpin] >= EXT_COM_RESERVED) error(“Pin is allocated to a communications function”);

// At this point we should have a valid number of arguments and some possibly valid IO pins.

cnt = (nbits – 1) / 8; // Tells us who many complete bytes to loop over.
cnt++; // at least one byte even if it is a partial byte.

ExtSet(cpin,0); // CLK pin low
uDly(BDLY);

if (mode == 0) { // shift bits out LSB first starting at the END of the string.

for (ix=0; ix<nbits; ix++) { // loop through all bits
iy = ix / 8; // byte offset

mybyte = outstr[outstr[0]-iy]; // current byte being output

if (mybyte & (1 << (ix & 0x07))) {
ExtSet(dpin,1); // output a 1
} else {
ExtSet(dpin,0);
}

uDly(BDLY);
ExtSet(cpin,1); // CLK high
uDly(BDLY);
ExtSet(cpin,0); // CLK low
uDly(BDLY);

} // next bit

} else { // shift bits out MSB first starting at the BEGINNING of the string.

for (ix=0; ix<nbits; ix++) { // loop through all bits
iy = (ix / 8) + 1; // byte offset

mybyte = outstr[iy]; // current byte being output

if (mybyte & (128 >> (ix & 0x07))) {
ExtSet(dpin,1); // output a 1
} else {
ExtSet(dpin,0);
}

uDly(BDLY);
ExtSet(cpin,1); // CLK high
uDly(BDLY);
ExtSet(cpin,0); // CLK low
uDly(BDLY);

} // next bit
}

}

/**********************************************/

the code above is well commented and do not need my comments, again it was very simple to add!

Now let’s hack a bit! I wanted to make my own command to prove the concept!

If you want to do the same:

First you have to obtain the tools to compile DM sources from Microchip web

Download MPLAB 8.80 (166MB) and PIC C32 compiler v1.11b (73 MB) and install them

Then download DM-BASIC latest sources from Olimex Web page http://www.olimex.com/dev/

Unpack them in working directory and try the project. Note I had to setup the C32 locations manually and to change search path for Olimex.h to build the project successfully. The HEX is compiled and located in OUTPUT directory and named OLIMEX.HEX, use the Bootloader tool to burn in DuinoMite.

I compiled the source first and downloaded to DuinoMite. Everything works OK!

OK then let me try to add HELLO command which writes “Hello World” on the screen

I add in misc.h this line which defines my command:

{ “HELLO”, T_CMD, 0, cmd_hello },

and in misc.c the code to be executed when HELLO is met in BASIC:

void cmd_hello(void) {

MMPrintString(“Hello world!\r\n”);
}

Now let’s compile everything and bootload and try!

Image
it works!

So using this approach you can define ANYTHING you want to have in DM but you miss it, only you should have some basic C knowledge, then to be not afraid of learning new stuff and hacking.

I will personally try to implement next: RCTIME command which will measure capacitance on the GPIO pin in the next days and post the result.

This way you can build your own version of DM-BASIC which to add specific functionallity which is not possible to be done otherwise in pure BASIC. Do not forget DM-BASIC is open source project with GPL 3.0 licensee so whatever you do do not forget to make your sources also available, so the community can benefit from your contribution and the project move forward!

Happy hacking!

Previous Older Entries