HOW TO UPLOAD file.hex to DUINOMITE MEGA ???

Started by wanderer, April 01, 2013, 04:02:15 PM

Previous topic - Next topic

wanderer

Hello ,

I'm writing you to ask you how can I upload a file converted to .hex by Pinguino v 4 to DUINOMITE MEGA ?


1) What board do I have to select before to use the compiler  (UBW32 795 ,PIC 32 Pinguino OTG , etc...)

2) What driver do I have to use ?



because I can use the compiler to convert file to .hex but I can't upload it even if my yellow and green LED are flashing .

Can you help me please ?  Thanks

maria_olimex

Hello,

There are several things you can do.

1) To compile successfully, you need to choose the UBW795 board, but I cannot guarantee pin and peripheral device compatibility. I've had success compiling and uploading to duinomite programs made with Pinguino, but that involved editing a lot of source files of a non-compiled pinguino IDE. Anyway, here are some pin definitions for Duinomite MEGA for the pinguino IDE. If you want to use them, comment out the UBW795 defs in the following files(they are in the .../core/ folder) and replace them with these:

Note: I used those in an older version of the Pinguino IDE, but they are generic defs and should be compatible with Pinguino x4

-- analog.c

// Pin mapping for the Arduino interface on the DUINOMITE MEGA
// Pins A0 - A6 on the Ard. interface are AN 3,4,6,7,9 and 10
// All the analog ports AN0 -> AN15 are mapped to PB0->PB15
u16 __analogmask[]={_3, _4, _6, _7, _9, _10};
u16 __bufmask[]=   {0x0C, 0x10, 0x18, 0x1C, 0x24, 0x28};


-- const.h

#define LED1 9 // PORTBbits.RB12
#define YELLOWLED 9 // PORTBbits.RB12

#define D0 0
#define D1 1
#define D2 2
#define D3 3
#define D4 4
#define D5 5
#define D6 6
#define D7 7
#define D8 8
#define D9 9
#define D10 10
#define D11 11
#define D12 12
#define D13 13

#define A0 0
#define A1 1
#define A2 2
#define A3 3
#define A4 4
#define A5 5


--digitalw.c

const u32 portmask[]=
{pE,pE,pE,pE,pE,pE,pE,pE, //0-7
  pB,pB,pD,pD,pD,pD,pD};    //8-13, 14 is SDCS for the SD card

const u32 pinmask[]={_0,_1,_2,_3,_4,_5,_6,_7, //0-7
  _11,_12,_11,_3,_2,_1, _5};


--spi.c

#if (SPIx == 3)
#define BUFFER SPI3ABUF
#define STATUS SPI3ASTATbits.SPIROV // Receive Overflow Flag bit
#define STATRX  SPI3ASTATbits.SPIRBF // receive buffer full
#define STATTX SPI3ASTATbits.SPITBF // transmit buffer full
#define SPICONF SPI3ACON
#define SPICONCLR SPI3ACONCLR
#define CLKSPD SPI3ABRG
#define INTFAULT INT_SPI3A_FAULT
#define INTTXDONE INT_SPI3A_TRANSFER_DONE
#define INTRXDONE INT_SPI3A_RECEIVE_DONE
#define INTVECTOR INT_SPI3A_VECTOR
#endif

#if (SPIx == 4)
#define BUFFER SPI4ABUF
#define STATUS SPI4STATbits.SPIROV // Receive Overflow Flag bit
#define STATRX  SPI4STATbits.SPIRBF // receive buffer full
#define STATTX SPI4STATbits.SPITBF // transmit buffer full
#define SPICONF SPI4CON
#define CLKSPD SPI4BRG
#define INTFAULT INT_SPI4_FAULT
#define INTTXDONE INT_SPI4_TRANSFER_DONE
#define INTRXDONE INT_SPI4_RECEIVE_DONE
#define INTVECTOR INT_SPI4_VECTOR
#endif


2) For the upload process - go to the Olimex Duinomite page and download the firmware updater :
https://www.olimex.com/Products/Duino/Duinomite/DUINOMITE-MEGA/

under "Software". Please also look at the important notes. Connect the DUINOMITE-MEGA via usb in bootloader mode and use this utility to upload your hex file.

OR you could buy a PIC32 compatible programmer and use mplab/MPLABX to upload hex files and create software projects for your board.

Best Regards,
Maria/OLIMEX
Software developer at Olimex

wanderer

#2
I modified the parameters and use the USB Bootloader v2.90a but It says

"No address within range in file: volmeter.hex.  Verify the correct firmware image was specified and is designed for your device."


Where is the problem ? Thank you .


I'm using  :

-Windows 7 Edition Familiale Premium  Service Pack 1
-Intel(R) Core(TM) i3-2310M  CPU @ 2.10GHz
-RAM 4,00 Go
-OS  64bits



Nicolas

Hello Maria! Prompt for eMEGA. Thank you!
Привет из России!