Which functionality of the Duinomite hardware to support under MPIDE?

Started by KeesZagers, June 26, 2014, 11:34:41 AM

Previous topic - Next topic

KeesZagers

MPIDE implemented on Duinomite Mega and Arduino I/O working perfectly digital in, digital out, analog in no problem. Also PIN_LED1 controls the yellow LED. UEXT communication not tested yet, but will probably work also. So far the good news.

What is missing?

1. The green LED (except during upload)
2. The USER button (except during upload)
3. Sound output
4. VGA
5. Keyboard
6. SD card
7. CANbus
8. Ethernet

IMO items 1, 2 and 3 should be easily be implemented defining some extra pins.

Items 4 and 5 don't have a high priority, but it would be nice to have at least vga.println() and keyboard.read() commands available.

Item 6 is essential to make Duinomite hardware usefull. The MPIDE library SD exists. How can we make this available for Duinomite.

Item 7 is my speciality and I like to update the PIC32 hardware folder with a CAN library.

Item 8 should be some addition to the PIC32 hardware folder also. The Ethernet Basics are already available.

I'm wondering who is willing to help Olimex and me to make the Duinomite platform successfull again with MPIDE.

Please respond ....

Kees

KeesZagers

Implemented items 1, 2 and 3. Made them also available as keywords and added some demo sketches under the created Duinomite section. All files are in the ZIP file which can be downloaded here:

www.si-kwadraat.nl/olimex/changes07072014.zip

I also did some study to the Ethernet implementation for eMEGA. Installed the TCP/IP demo and this works quite nice, however not easy to combine with MPIDE. Did also the download of the MAX32 Chipkit Network Shield libraries. As far as I can see the ethernet libraries can be used, only the physical driver should be replaced. When I replaced the initialsation of the physical interface by doing nothing I could compile everything without any errors. So I believe when I replace the lines by the initialising routine of physical interface it should work. Can anyone tell me where to find that initialisation routine?

Kees

KeesZagers

I don't get the impression that a lot of people are using the MPIDE environment yet for the Olimex PIC32 hardware products.
During my (too less) free time, I did some extra experiments with the Duinomite implementation. I have a test program now, which checks the CANbus connection and PS2 keyboard connection. These tests are working and I will make some libraries for these interfaces.
What I need for my Duinomite applications is also the SDcard. I did already a lot of experiments on the MPIDE default SD library, but the way they implemented the initialisation of the SDcard does not work on the Duinomite. They tried to initialise the SDcard by using standard digital I/O and not the SPI interface. This probably goes wrong in the timing. I looked into the DMBasic sources and saw that in there also the initialisation is done through a low speed (400 kHz) SPI connection. I have the intention to see if I can do such an init also with MPIDE, but I was wondering if maybe someone already has a solution for that.

JohnS

Please don't be discouraged.  Sooner or later someone else is likely to be interested.

Many tools allow board-specific init and often that code can return a value to indicate whether the tool should or should not do certain more kinds of init.  Maybe this is a way to solve this?

John

KeesZagers

Thanks for the encouragement (however I would have preferred you had given me the solution :-)

I hope I only have to rewrite the init routine and the real FAT drivers will work.

JohnS

I'm not using MPIDE so kind of hard for me to give a solution!

John

KeesZagers

I stopped the development of the MPIDE project a few months ago, because of other priorities. I was wondering if people are actually working with this environment right now? Who is interested in libraries for the SD card and the Ethernet interface on the eMEGA?

mobluse

I would like to start with MPIDE if I can get it to work with Duinomite-Mini.

I would like the composite video and VGA to work and the keyboard. That is, this Arduino code should work:

#include <font4x6.h>
#include <TVout.h>
#include <PS2Keyboard.h>
#include <EEPROM.h>

It's from https://halfbyteblog.wordpress.com/2014/07/05/half-byte-tiny-basic-is-now-available/ and https://halfbyteblog.wordpress.com/2014/11/26/its-here-half-byte-tiny-basic-2-for-arduino-and-compatibles-3/

I suppose the idea with MPIDE is that one should be able to run Arduino (AVR) code on Duinomite (PIC32), and vice versa. Then one could port DMBASIC to MPIDE and continue development and not have to deal with two bootloaders.
iCE40HX8K-EVB w/ iCE40-IO, DuinoMite-Mini, DuinoMite w/ DuinoMite-IO, Olimexino-32U4

JohnS

It looks like a big step backwards from DMBasic.  I wonder why you'd want MPIDE so badly that you'd do that?

If you stick with DMBasic you don't need another bootloader.

If you wanted not to use DMBasic or indeed any Basic but C/C++/Arduino code then maybe MPIDE offers you something.  But you seem to want DMBasic so ... I'm lost what you're really trying to do?

If you just want to continue DMBasic then why go MPIDE at all?

John

mobluse

Quote from: JohnS on February 07, 2015, 01:50:16 AM
It looks like a big step backwards from DMBasic.  I wonder why you'd want MPIDE so badly that you'd do that?

If you stick with DMBasic you don't need another bootloader.

If you wanted not to use DMBasic or indeed any Basic but C/C++/Arduino code then maybe MPIDE offers you something.  But you seem to want DMBasic so ... I'm lost what you're really trying to do?

If you just want to continue DMBasic then why go MPIDE at all?
I think I will mainly use MPIDE if that works, but I would use DMBASIC sometimes if that is converted to an MPIDE project. It would be useful for educational purposes to teach using both compiled and interpreted languages on Duinomite. I think it should be possible to develop programs such as TinyBASIC or DMBASIC with screen, keyboard and mouse support in MPIDE using Arduino-compatible libraries. I use Linux on both x86 and Raspberry Pi and MPIDE is available for both. Another alternative might be to load MPIDE programs using mphidflash as I load DMBASIC and MMBASIC today, but I don't know if the hex-files generated by MPIDE can be sent using mphidflash. It seems that it is possible:
http://chipkit.net/forum/viewtopic.php?f=6&t=2312
https://www.olimex.com/forum/index.php?topic=3664.0 (Your post.)
Could I use the same parameters to mphidflash when I send an MPIDE hex-file as I use when I send one generated using MPLAB-X? Now I use e.g.
sudo mphidflash -v 15BA -p 0032 -r -n -w Olimex\ DuinoMite\ Mega\ MMBasic\ Project.hex
Of course, I could just test it, but then I risk bricking the Duinomite-Mini by overwriting part of the bootloader.
iCE40HX8K-EVB w/ iCE40-IO, DuinoMite-Mini, DuinoMite w/ DuinoMite-IO, Olimexino-32U4

KeesZagers

I agree with John. It does not make sense to have a DMBasic environment together with MPIDE. If you want to show the differences between the interpreter and compiler based languages for educational purposes, you can stay with your traditional DMBasic system and have the correct MPLAB-X environment for C.
Step 1: Write a program to do any kind of job using Basic.
Step 2: Modify your DMBasic source code in C and add one Basic command, which does the same in one line.

The MPIDE environment makes sense for developing smaller efficient embedded applications. I agree that it should be compatible with the AVR code and the libraries for all hardware should be available. This is still a problem.

Kees

balenbalen

Graduated from Soran University with First Class Degree with Honours in Computer Science.