[PIC32] Mikroelektronika Mini-32 Problem - Page 1
Forum section: electronics / general

author: N3xus
author_rank: Contributor
timestamp: July 22, 2016, 09:25:48 pm
content: Hello all.Some days ago I bought a MINI-32 from Mikroelektronika.Here a link to the data sheet:http://download.mikroe.com/documents/starter-boards/mini/pic32/mini-32-manual-v101.pdfThe problem I have is that I am not able to get it working using the boot loader of Mikroelektronika.Unfortunately they do not offer any support if I do not use their compiler.Here the source code I was trying to implement:Code:// disable PLIB warning#define _SUPPRESS_PLIB_WARNING//#include <XC.h>#include <plib.h>#include <p32xxxx.h>//Configuration Bits#pragma config FSOSCEN = OFF // Disable secondary oscillator#pragma config POSCMOD=HS // High speed crystal mode#pragma config FNOSC=PRIPLL // Use Primary Oscillator with PLL (XT, HS, or EC)#pragma config FPLLIDIV = DIV_2 // Divide 8MHz to between 4-5MHz before PLL (now 4MHz)#pragma config FPLLMUL=MUL_20 // Multiply with PLL (now 80MHz)#pragma config FPLLODIV=DIV_1 // divide by 1#pragma config FWDTEN = OFF // Disable watchdog timer#define SYSCLK 80000000ULint main(void) {SYSTEMConfigPerformance(SYSCLK);TRISDbits.TRISD6 = 0;LATDbits.LATD6 = 1;TRISGbits.TRISG6 = 0;LATGbits.LATG6 = 0;while(1){}return (1);}When I compile the code and upload it to the board nothing happens. Both LED's stay off.I also tried to set it up using MPLAB Harmony which also led to no results.Does somebody of you have any clue about the problem I am facing?BTW. the example .hex file supplied by Mikroelektronika works without problems and so there seems to be no problem with the µC.RegardsArmin

author: dannyf
author_rank: Super Contributor
timestamp: July 22, 2016, 10:33:16 pm
content: QuoteSeems to me the natural course of action in this case would be to use their software (demo or otherwise) to compile a proven piece of code (their own sample code for example) into a hex file (or to get a proven working hex file from a proven / reliable source) and flash it to your chip.As of now, you have too many unknowns for you to pinpoint the issue. You need to narrow that down.

author: N3xus
author_rank: Contributor
timestamp: July 23, 2016, 07:26:02 am
content: Maybe that's a good idea. I will try it this afternoon. Thanks so far.Gesendet von iPhone mit Tapatalk

author: N3xus
author_rank: Contributor
timestamp: July 23, 2016, 01:05:42 pm
content: Ok, I know recognised that it doesn't work with their software either. I assume that there are configuration issues. I will try to ask them for help directly again.Gesendet von iPhone mit Tapatalk

author: dannyf
author_rank: Super Contributor
timestamp: July 23, 2016, 01:49:46 pm
content: QuoteGenerally, the issues are with configuration bits and alternative functions on gpio pins. The typical process is to use the simplest configuration (internal rc, no pll, etc.) and disable any non-gpio function on pins and flip them.I posted a series of "getting started on ..." posts on my blog and here is the one for pic32:https://dannyelectronics.wordpress.com/2016/04/24/getting-started-on-pic32-mplab-xpickit2/It uses a different processor but the basic idea is the same.

author: N3xus
author_rank: Contributor
timestamp: July 23, 2016, 05:45:58 pm
content: Well, generally I would agree with you but this is not possible with this board.There is a preloaded bootloader that seems to define the configuration bits. So as I assume the configuration bits written in the software will not have any influence. I got this as answer on the MikroElektronika Forum. Furthermore, I do not have a programmer by now because otherwise it would be no problem to program the PIC.Nevertheless, thank you for sharing the Link.Gesendet von iPhone mit Tapatalk

author: N3xus
author_rank: Contributor
timestamp: July 23, 2016, 07:14:46 pm
content: FYI the link to the MikroElektronika Forum where I posted my question:http://forum.mikroe.com/viewtopic.php?f=12&t=68103&p=273338#p273338I got it working in their IDE with their compiler but the same software do not run with MPLAB. As I wrote in the other Forum I think I will give up and switch to a programmer or completely switch platform.

author: dannyf
author_rank: Super Contributor
timestamp: July 23, 2016, 07:59:59 pm
content: QuoteIt is highly unlikely that they got the programming software fully integrated into the IDE.So if you can find their programming software that takes a .hex file, you can pretty much use any IDE that produces the .hex file.Again, common sense dictates that you try to reduce the unknowns in a process to help pin point your issues.

author: N3xus
author_rank: Contributor
timestamp: July 23, 2016, 08:24:05 pm
content: You are right, the "programmer" is a separate tool supplied by them.Some clarification:Method 1:Project compiled with MikroC (Compiler from Mikroelektronika)Uploaded to the µC via the supplied tool -> µC works as it should.Project compiled with MPLABUploaded to the µC with the same tool as before -> µC does not do anything.So I must assume that there is any problem with MPLAB. I think that there is any setting in MPLAB I am missing to get this thing up and running but I scanned through all settings and cannot find anything plausible. BTW I used the same configuration bits as in the MikroC version.

author: Kilrah
author_rank: Unknown
timestamp: July 23, 2016, 08:29:57 pm
content: Are the libraries, definitions etc identical for both? Most likely not, you often can't just copy/paste the code form one compiler suite to the other.

author: N3xus
author_rank: Contributor
timestamp: July 23, 2016, 08:39:43 pm
content: No, they are not the same because the compilers are different. But I adapted all lines to the other compiler which also compiled without errors or warnings.I now tried out the simulator in MPLAB and saw that the Port value changes as expected. So there must be any problem when the .hex file is created...

author: Kilrah
author_rank: Unknown
timestamp: July 23, 2016, 08:45:23 pm
content: Is there any doc about the bootloader? It might require relocating the code in memory for proper operation.

author: dannyf
author_rank: Super Contributor
timestamp: July 23, 2016, 08:50:40 pm
content: try to download the following two .hex files to the chip and see what happens:hex file 1Code::020000040000fa:020000041fc01b:042ff000ffffff3fa1:020000040000fa:020000041fc01b:042ff40099fff9ff49:020000040000fa:020000041fc01b:042ff80058ceefffc1:020000040000fa:020000041fc01b:042ffc00ffffff7f55:020000040000fa:020000041fc01b:1000000000601a40c0045a7f050040130000000041:10001000009d1a3ce4035a2708004003000000003a:1000200000a01d3cf83fbd2700a01c3cf07f9c2792:1000300002600940205820018449497d02608940be:10004000c000000000e0dc4102608b40009d083ce5:100050000c04082509f800010000000000a0083c7d:100060000000082500a0093c00002925060000101a:1000700000000000000000ad040000ad080000ad6d:100080000c0000ad100008252b080901f9ff201411:1000900000000000009d083cfc0308250000098dbd:1000a000180020110400082500000a8d040008250e:1000b00000000b8d090060110400082500000c9160:1000c000ffff4a250100082500002ca1fbff401579:1000d000010029250500001000000000000020a1fb:1000e000ffff4a25fdff40150100292503000825d3:1000f000fcff0a24244048010000098de7ff201579:10010000000000000000093c00002925100020111b:10011000000000000000093c0040292588bf0a3c7f:1001200010204a25000049ad0000093c0040292567:1001300088bf0a3c20204a25000049ad0000093c48:100140000040292588bf0a3c30204a25000049addf:1001500000488040ffff0a2400588a40c09f093ca5:1001600000102925017889400000093c010029255b:1001700000000a2444492a7d01608a408000093c2d:1001800000688940008008408005097d404c0900d6:10019000006008405800013c24400101254028012e:1001a00000608840009d083c1404082509f80001ff:1001b0000000000000600840bfff013cffff213449:1001c0002440010100608840000084300000a53018:1001d000009d083c74020825080000010000000092:020000040000fa:020000041fc01b:10038000009d1a3c44035a27080040030000000067:020000040000fa:020000041fc01b:10118000009d1a3c28015a27080040030000000077:020000040000fa:020000041fc01b:08120000ed00400b00000000ae:020000040000fa:020000041fc01b:08122000ed00400b000000008e:020000040000fa:020000041fc01b:08124000ed00400b000000006e:020000040000fa:020000041fc01b:08126000ed00400b000000004e:020000040000fa:020000041fc01b:08128000ed00400b000000002e:020000040000fa:020000041fc01b:0812a000ed00400b000000000e:020000040000fa:020000041fc01b:0812c000ed00400b00000000ee:020000040000fa:020000041fc01b:0812e000ed00400b00000000ce:020000040000fa:020000041fc01b:08130000ed00400b00000000ad:020000040000fa:020000041fc01b:08132000ed00400b000000008d:020000040000fa:020000041fc01b:08134000ed00400b000000006d:020000040000fa:020000041fc01b:08136000ed00400b000000004d:020000040000fa:020000041fc01b:08138000ed00400b000000002d:020000040000fa:020000041fc01b:0813a000ed00400b000000000d:020000040000fa:020000041fc01b:0813c000ed00400b00000000ed:020000040000fa:020000041fc01b:0813e000ed00400b00000000cd:020000040000fa:020000041fc01b:08140000ed00400b00000000ac:020000040000fa:020000041fc01b:08142000ed00400b000000008c:020000040000fa:020000041fc01b:08144000ed00400b000000006c:020000040000fa:020000041fc01b:08146000ed00400b000000004c:020000040000fa:020000041fc01b:08148000ed00400b000000002c:020000040000fa:020000041fc01b:0814a000ed00400b000000000c:020000040000fa:020000041fc01b:0814c000ed00400b00000000ec:020000040000fa:020000041fc01b:0814e000ed00400b00000000cc:020000040000fa:020000041fc01b:08150000ed00400b00000000ab:020000040000fa:020000041fc01b:08152000ed00400b000000008b:020000040000fa:020000041fc01b:08154000ed00400b000000006b:020000040000fa:020000041fc01b:08156000ed00400b000000004b:020000040000fa:020000041fc01b:08158000ed00400b000000002b:020000040000fa:020000041fc01b:0815a000ed00400b000000000b:020000040000fa:020000041fc01b:0815c000ed00400b00000000eb:020000040000fa:020000041fc01b:0815e000ed00400b00000000cb:020000040000fa:020000041fc01b:08160000ed00400b00000000aa:020000040000fa:020000041fc01b:08162000ed00400b000000008a:020000040000fa:020000041fc01b:08164000ed00400b000000006a:020000040000fa:020000041fc01b:08166000ed00400b000000004a:020000040000fa:020000041fc01b:08168000ed00400b000000002a:020000040000fa:020000041fc01b:0816a000ed00400b000000000a:020000040000fa:020000041fc01b:0816c000ed00400b00000000ea:020000040000fa:020000041fc01b:0816e000ed00400b00000000ca:020000040000fa:020000041fc01b:08170000ed00400b00000000a9:020000040000fa:020000041fc01b:08172000ed00400b0000000089:020000040000fa:020000041fc01b:08174000ed00400b0000000069:020000040000fa:020000041fc01b:08176000ed00400b0000000049:020000040000fa:020000041fc01b:08178000ed00400b0000000029:020000040000fa:020000041fc01b:0817a000ed00400b0000000009:020000040000fa:020000041fc01b:0817c000ed00400b00000000e9:020000040000fa:020000041fc01b:0817e000ed00400b00000000c9:020000040000fa:020000041fc01b:08180000ed00400b00000000a8:020000040000fa:020000041fc01b:08182000ed00400b0000000088:020000040000fa:020000041fc01b:08184000ed00400b0000000068:020000040000fa:020000041fc01b:08186000ed00400b0000000048:020000040000fa:020000041fc01b:08188000ed00400b0000000028:020000040000fa:020000041fc01b:0818a000ed00400b0000000008:020000040000fa:020000041fc01b:0818c000ed00400b00000000e8:020000040000fa:020000041fc01b:0818e000ed00400b00000000c8:020000040000fa:020000041fc01b:08190000ed00400b00000000a7:020000040000fa:020000041fc01b:08192000ed00400b0000000087:020000040000fa:020000041fc01b:08194000ed00400b0000000067:020000040000fa:020000041fc01b:08196000ed00400b0000000047:020000040000fa:020000041fc01b:08198000ed00400b0000000027:020000040000fa:020000041fc01b:0819a000ed00400b0000000007:020000040000fa:020000041fc01b:0819c000ed00400b00000000e7:020000040000fa:020000041fc01b:0819e000ed00400b00000000c7:020000040000fa:020000041fc01b:1004800000f89b40c0000000009d1b3cc0027b2781:1004900000c09b4000f81b40c00000001f0000424d:0404a0000000000058:020000040000fa:020000041d00dd:10000000f8ffbd270400beaf21f0a003211080003f:100010000700400b0800c2a3400000000800c29384:100020002b100200ff0042300800c393ffff63243f:10003000f9ff40140800c3a321e8c0030400be8fe9:100040000800e0030800bd27e8ffbd271400bfaf8c:100050001000beaf21f0a0031800c4af1800c28f7b:10006000ff004230212040000000400f000000004f:100070001800c28f021202001800c2af2400400b09:1000800000000000ff0004240000400f00000000fa:100090001800c28f2b100200ff0042301800c38fdf:1000a000ffff63241800c3aff6ff401400000000f8:1000b00021e8c0031400bf8f1000be8f1800bd27b9:1000c0000800e00300000000e8ffbd271400bfaff8:1000d0001000beaf21f0a0031800c4af3c00400bdd:1000e00000000000c00304241200400f00000000c4:1000f0001800c28f2b100200ff0042301800c38f7f:10010000ffff63241800c3aff6ff40140000000097:1001100021e8c0031400bf8f1000be8f1800bd2758:080120000800e00300000000ec:020000040000fa:020000041d00dd:10012800a8ffbd270400a1af0800a2af0c00a3af31:100138001000a4af1400a5af1800a6af1c00a7af0d:100148002000a8af2400a9af2800aaaf2c00abafad:100158003000acaf3400adaf3800aeaf3c00afaf4d:100168004000b8af4400b9af4800bfaf124000002c:100178004c00a8af104000005000a8af009d1a3cea:100188007c035a2700000000006804400060054016:1001980009f84003000000005000a88f110000017a:1001a8004c00a88f130000010400a18f0800a28f43:1001b8000c00a38f1000a48f1400a58f1800a68f21:1001c8001c00a78f2000a88f2400a98f2800aa8fc1:1001d8002c00ab8f3000ac8f3400ad8f3800ae8f61:1001e8003c00af8f4000b88f4400b98f4800bf8fe4:0c01f8005800bd27c000000018000042a5:020000040000fa:020000041d00dd:10020400e8ffbd271400bfaf1000beaf21f0a0036c:10021400c100400f0000000088bf023ca061438c75:1002240000ff02242418620088bf023ca06143ac92:1002340088bf023c8061438c00ff022424186200c2:1002440088bf023c806143ac88bf023ca061428c01:10025400ff00433888bf023ca06143ac640004241f:100264003200400f000000009300400b000000002b:020000040000fa:020000041d00dd:100274000000043ce8ffbd27000084240300801034:100284001400bfaf09f880000000000000008430b3:100294000000a5308100400f000000000000023c77:1002a40000004224030040100000000009f8400050:0c02b40000000000f9ff00100000000036:020000040000fa:020000041d00dd:1002c00000606041c000000099aa033c81bf023c6d:1002d0005566632430f240ac30f243ac6655033cc3:1002e000aa99633430f243ac81bf023c010003247d:1002f00018f643ac81bf023c10f6428cb200400bb2:1003000000000000f8ffbd270400beaf21f0a003ed:1003100081bf023cffff0334609043ac88bf033cc5:100320000010628c010004240463827c001062ac23:1003300021e8c0030400be8f0800bd270800e003c9:0403400000000000b9:020000040000fa:020000041d00dd:100344000000023ce8ffbd270000422406004010e4:100354001400bfaf0000023c000042240300401020:10036400009d023c3f000070009d023cc0024224fc:0803740009f840000000000040:020000040000fa:020000041d00dd:10037c000000023ce8ffbd270000422406004010ac:10038c001400bfaf0000023c0000422403004010e8:10039c00009d023c3f000070009d023cc0024224c4:0803ac0009f840000000000008:020000040000fa:020000041d00dd:1003b4000000023c00004224050040100000023c02:1003c4000000422403004010009d023c3f000070e6:1003d400009d023cc002422409f8400000000000d5:020000040000fa:020000041d00dd:1003e40000601a40bfff1b3cffff7b3724d05b0338:0803f40000609a40180000426d:020000040000fa:020000041d00dd:1003fc000000000022222222222222222222222259:020000040000fa:020000041d00dd:08040c000800e00300000000fd:020000040000fa:020000041d00dd:080414000800e00300000000f5:00000001FFhex file 2Code::020000040000fa:020000041fc01b:1000000000601a40c0045a7f050040130000000041:10001000009d1a3ce4035a2708004003000000003a:1000200000a01d3cf83fbd2700a01c3cf07f9c2792:1000300002600940205820018449497d02608940be:10004000c000000000e0dc4102608b40009d083ce5:100050000c04082509f800010000000000a0083c7d:100060000000082500a0093c00002925060000101a:1000700000000000000000ad040000ad080000ad6d:100080000c0000ad100008252b080901f9ff201411:1000900000000000009d083cfc0308250000098dbd:1000a000180020110400082500000a8d040008250e:1000b00000000b8d090060110400082500000c9160:1000c000ffff4a250100082500002ca1fbff401579:1000d000010029250500001000000000000020a1fb:1000e000ffff4a25fdff40150100292503000825d3:1000f000fcff0a24244048010000098de7ff201579:10010000000000000000093c00002925100020111b:10011000000000000000093c0040292588bf0a3c7f:1001200010204a25000049ad0000093c0040292567:1001300088bf0a3c20204a25000049ad0000093c48:100140000040292588bf0a3c30204a25000049addf:1001500000488040ffff0a2400588a40c09f093ca5:1001600000102925017889400000093c010029255b:1001700000000a2444492a7d01608a408000093c2d:1001800000688940008008408005097d404c0900d6:10019000006008405800013c24400101254028012e:1001a00000608840009d083c1404082509f80001ff:1001b0000000000000600840bfff013cffff213449:1001c0002440010100608840000084300000a53018:1001d000009d083c74020825080000010000000092:020000040000fa:020000041fc01b:10038000009d1a3c44035a27080040030000000067:020000040000fa:020000041fc01b:10118000009d1a3c28015a27080040030000000077:020000040000fa:020000041fc01b:08120000ed00400b00000000ae:020000040000fa:020000041fc01b:08122000ed00400b000000008e:020000040000fa:020000041fc01b:08124000ed00400b000000006e:020000040000fa:020000041fc01b:08126000ed00400b000000004e:020000040000fa:020000041fc01b:08128000ed00400b000000002e:020000040000fa:020000041fc01b:0812a000ed00400b000000000e:020000040000fa:020000041fc01b:0812c000ed00400b00000000ee:020000040000fa:020000041fc01b:0812e000ed00400b00000000ce:020000040000fa:020000041fc01b:08130000ed00400b00000000ad:020000040000fa:020000041fc01b:08132000ed00400b000000008d:020000040000fa:020000041fc01b:08134000ed00400b000000006d:020000040000fa:020000041fc01b:08136000ed00400b000000004d:020000040000fa:020000041fc01b:08138000ed00400b000000002d:020000040000fa:020000041fc01b:0813a000ed00400b000000000d:020000040000fa:020000041fc01b:0813c000ed00400b00000000ed:020000040000fa:020000041fc01b:0813e000ed00400b00000000cd:020000040000fa:020000041fc01b:08140000ed00400b00000000ac:020000040000fa:020000041fc01b:08142000ed00400b000000008c:020000040000fa:020000041fc01b:08144000ed00400b000000006c:020000040000fa:020000041fc01b:08146000ed00400b000000004c:020000040000fa:020000041fc01b:08148000ed00400b000000002c:020000040000fa:020000041fc01b:0814a000ed00400b000000000c:020000040000fa:020000041fc01b:0814c000ed00400b00000000ec:020000040000fa:020000041fc01b:0814e000ed00400b00000000cc:020000040000fa:020000041fc01b:08150000ed00400b00000000ab:020000040000fa:020000041fc01b:08152000ed00400b000000008b:020000040000fa:020000041fc01b:08154000ed00400b000000006b:020000040000fa:020000041fc01b:08156000ed00400b000000004b:020000040000fa:020000041fc01b:08158000ed00400b000000002b:020000040000fa:020000041fc01b:0815a000ed00400b000000000b:020000040000fa:020000041fc01b:0815c000ed00400b00000000eb:020000040000fa:020000041fc01b:0815e000ed00400b00000000cb:020000040000fa:020000041fc01b:08160000ed00400b00000000aa:020000040000fa:020000041fc01b:08162000ed00400b000000008a:020000040000fa:020000041fc01b:08164000ed00400b000000006a:020000040000fa:020000041fc01b:08166000ed00400b000000004a:020000040000fa:020000041fc01b:08168000ed00400b000000002a:020000040000fa:020000041fc01b:0816a000ed00400b000000000a:020000040000fa:020000041fc01b:0816c000ed00400b00000000ea:020000040000fa:020000041fc01b:0816e000ed00400b00000000ca:020000040000fa:020000041fc01b:08170000ed00400b00000000a9:020000040000fa:020000041fc01b:08172000ed00400b0000000089:020000040000fa:020000041fc01b:08174000ed00400b0000000069:020000040000fa:020000041fc01b:08176000ed00400b0000000049:020000040000fa:020000041fc01b:08178000ed00400b0000000029:020000040000fa:020000041fc01b:0817a000ed00400b0000000009:020000040000fa:020000041fc01b:0817c000ed00400b00000000e9:020000040000fa:020000041fc01b:0817e000ed00400b00000000c9:020000040000fa:020000041fc01b:08180000ed00400b00000000a8:020000040000fa:020000041fc01b:08182000ed00400b0000000088:020000040000fa:020000041fc01b:08184000ed00400b0000000068:020000040000fa:020000041fc01b:08186000ed00400b0000000048:020000040000fa:020000041fc01b:08188000ed00400b0000000028:020000040000fa:020000041fc01b:0818a000ed00400b0000000008:020000040000fa:020000041fc01b:0818c000ed00400b00000000e8:020000040000fa:020000041fc01b:0818e000ed00400b00000000c8:020000040000fa:020000041fc01b:08190000ed00400b00000000a7:020000040000fa:020000041fc01b:08192000ed00400b0000000087:020000040000fa:020000041fc01b:08194000ed00400b0000000067:020000040000fa:020000041fc01b:08196000ed00400b0000000047:020000040000fa:020000041fc01b:08198000ed00400b0000000027:020000040000fa:020000041fc01b:0819a000ed00400b0000000007:020000040000fa:020000041fc01b:0819c000ed00400b00000000e7:020000040000fa:020000041fc01b:0819e000ed00400b00000000c7:020000040000fa:020000041fc01b:1004800000f89b40c0000000009d1b3cc0027b2781:1004900000c09b4000f81b40c00000001f0000424d:0404a0000000000058:020000040000fa:020000041d00dd:10000000f8ffbd270400beaf21f0a003211080003f:100010000700400b0800c2a3400000000800c29384:100020002b100200ff0042300800c393ffff63243f:10003000f9ff40140800c3a321e8c0030400be8fe9:100040000800e0030800bd27e8ffbd271400bfaf8c:100050001000beaf21f0a0031800c4af1800c28f7b:10006000ff004230212040000000400f000000004f:100070001800c28f021202001800c2af2400400b09:1000800000000000ff0004240000400f00000000fa:100090001800c28f2b100200ff0042301800c38fdf:1000a000ffff63241800c3aff6ff401400000000f8:1000b00021e8c0031400bf8f1000be8f1800bd27b9:1000c0000800e00300000000e8ffbd271400bfaff8:1000d0001000beaf21f0a0031800c4af3c00400bdd:1000e00000000000c00304241200400f00000000c4:1000f0001800c28f2b100200ff0042301800c38f7f:10010000ffff63241800c3aff6ff40140000000097:1001100021e8c0031400bf8f1000be8f1800bd2758:080120000800e00300000000ec:020000040000fa:020000041d00dd:10012800a8ffbd270400a1af0800a2af0c00a3af31:100138001000a4af1400a5af1800a6af1c00a7af0d:100148002000a8af2400a9af2800aaaf2c00abafad:100158003000acaf3400adaf3800aeaf3c00afaf4d:100168004000b8af4400b9af4800bfaf124000002c:100178004c00a8af104000005000a8af009d1a3cea:100188007c035a2700000000006804400060054016:1001980009f84003000000005000a88f110000017a:1001a8004c00a88f130000010400a18f0800a28f43:1001b8000c00a38f1000a48f1400a58f1800a68f21:1001c8001c00a78f2000a88f2400a98f2800aa8fc1:1001d8002c00ab8f3000ac8f3400ad8f3800ae8f61:1001e8003c00af8f4000b88f4400b98f4800bf8fe4:0c01f8005800bd27c000000018000042a5:020000040000fa:020000041d00dd:10020400e8ffbd271400bfaf1000beaf21f0a0036c:10021400c100400f0000000088bf023ca061438c75:1002240000ff02242418620088bf023ca06143ac92:1002340088bf023c8061438c00ff022424186200c2:1002440088bf023c806143ac88bf023ca061428c01:10025400ff00433888bf023ca06143ac640004241f:100264003200400f000000009300400b000000002b:020000040000fa:020000041d00dd:100274000000043ce8ffbd27000084240300801034:100284001400bfaf09f880000000000000008430b3:100294000000a5308100400f000000000000023c77:1002a40000004224030040100000000009f8400050:0c02b40000000000f9ff00100000000036:020000040000fa:020000041d00dd:1002c00000606041c000000099aa033c81bf023c6d:1002d0005566632430f240ac30f243ac6655033cc3:1002e000aa99633430f243ac81bf023c010003247d:1002f00018f643ac81bf023c10f6428cb200400bb2:1003000000000000f8ffbd270400beaf21f0a003ed:1003100081bf023cffff0334609043ac88bf033cc5:100320000010628c010004240463827c001062ac23:1003300021e8c0030400be8f0800bd270800e003c9:0403400000000000b9:020000040000fa:020000041d00dd:100344000000023ce8ffbd270000422406004010e4:100354001400bfaf0000023c000042240300401020:10036400009d023c3f000070009d023cc0024224fc:0803740009f840000000000040:020000040000fa:020000041d00dd:10037c000000023ce8ffbd270000422406004010ac:10038c001400bfaf0000023c0000422403004010e8:10039c00009d023c3f000070009d023cc0024224c4:0803ac0009f840000000000008:020000040000fa:020000041d00dd:1003b4000000023c00004224050040100000023c02:1003c4000000422403004010009d023c3f000070e6:1003d400009d023cc002422409f8400000000000d5:020000040000fa:020000041d00dd:1003e40000601a40bfff1b3cffff7b3724d05b0338:0803f40000609a40180000426d:020000040000fa:020000041d00dd:1003fc000000000022222222222222222222222259:020000040000fa:020000041d00dd:08040c000800e00300000000fd:020000040000fa:020000041d00dd:080414000800e00300000000f5:00000001FFI think all the right points have been made earlier in the thread. You just need to follow them.

author: N3xus
author_rank: Contributor
timestamp: July 23, 2016, 09:01:03 pm
content: attached you can find the information about the bootloader.Unfortunately this is too much for me to understand... oOIt seems reasonable to me that there is any memory adress problem.I tried both HEX files but did not get any response from the board. At least no LED's are turned on.

author: N3xus
author_rank: Contributor
timestamp: July 24, 2016, 07:04:07 am
content: I think this output from MikroC could help. Am I right that this is the memory map of the program?It is called "view listing" in the IDE. Is it correct that in this case my program must be located starting at address 0x9D000050 ?Code:; LST file generated by mikroListExporter - v.2.0; Date/Time: 23/07/2016 20:50:46;----------------------------------------------;Address Opcode ASM____SysVT:0x9FC01180 0x0B400008 J ___GenExcept0x9FC01184 0x70000000 NOP; end of ____SysVT____BootVT:0xBFC00380 0x3C1E9D00 LUI R30, 401920xBFC00384 0x37DE0038 ORI R30, R30, 560xBFC00388 0x03C00008 JR R300xBFC0038C 0x70000000 NOP; end of ____BootVT_main:;01_blinkLED.c, 1 :: void main() {;01_blinkLED.c, 3 :: AD1PCFG = 0xFFFF;0x9D000050 0x3402FFFF ORI R2, R0, 655350x9D000054 0x3C1EBF81 LUI R30, 490250x9D000058 0xAFC29060 SW R2, -28576(R30);01_blinkLED.c, 6 :: TRISG = 0;0x9D00005C 0x3C1EBF88 LUI R30, 490320x9D000060 0xAFC06180 SW R0, 24960(R30);01_blinkLED.c, 7 :: TRISD = 0;0x9D000064 0x3C1EBF88 LUI R30, 490320x9D000068 0xAFC060C0 SW R0, 24768(R30);01_blinkLED.c, 10 :: LATG = 0;0x9D00006C 0x3C1EBF88 LUI R30, 490320x9D000070 0xAFC061A0 SW R0, 24992(R30);01_blinkLED.c, 11 :: LATD = 0;0x9D000074 0x3C1EBF88 LUI R30, 490320x9D000078 0xAFC060E0 SW R0, 24800(R30);01_blinkLED.c, 13 :: while(1)L_main0:;01_blinkLED.c, 16 :: LATG = ~LATG;0x9D00007C 0x3C1EBF88 LUI R30, 490320x9D000080 0x8FC261A0 LW R2, 24992(R30)0x9D000084 0x00401027 NOR R2, R2, R00x9D000088 0x3C1EBF88 LUI R30, 490320x9D00008C 0xAFC261A0 SW R2, 24992(R30);01_blinkLED.c, 17 :: LATD = ~LATD;0x9D000090 0x3C1EBF88 LUI R30, 490320x9D000094 0x8FC260E0 LW R2, 24800(R30)0x9D000098 0x00401027 NOR R2, R2, R00x9D00009C 0x3C1EBF88 LUI R30, 490320x9D0000A0 0xAFC260E0 SW R2, 24800(R30);01_blinkLED.c, 19 :: Delay_ms(1000);0x9D0000A4 0x3C180196 LUI R24, 4060x9D0000A8 0x3718E6AA ORI R24, R24, 59050L_main2:0x9D0000AC 0x2718FFFF ADDIU R24, R24, -10x9D0000B0 0x1700FFFE BNE R24, R0, L_main20x9D0000B4 0x70000000 NOP;01_blinkLED.c, 20 :: }0x9D0000B8 0x0B40001F J L_main00x9D0000BC 0x70000000 NOP;01_blinkLED.c, 21 :: }L_end_main:L__main_end_loop:0x9D0000C0 0x0B400030 J L__main_end_loop0x9D0000C4 0x70000000 NOP; end of _main___CC2DW:;__Lib_System.c, 4 ::0x9D000000 0x27BDFFFC ADDIU SP, SP, -4;__Lib_System.c, 6 ::L_loopDW:;__Lib_System.c, 7 ::0x9D000004 0x831E0000 LB R30, 0(R24);__Lib_System.c, 8 ::0x9D000008 0xA2FE0000 SB R30, 0(R23);__Lib_System.c, 9 ::0x9D00000C 0x26F70001 ADDIU R23, R23, 1;__Lib_System.c, 10 ::0x9D000010 0x16F6FFFC BNE R23, R22, L_loopDW;__Lib_System.c, 11 ::0x9D000014 0x27180001 ADDIU R24, R24, 1;__Lib_System.c, 13 ::L_end___CC2DW:0x9D000018 0x03E00008 JR RA0x9D00001C 0x27BD0004 ADDIU SP, SP, 4; end of ___CC2DW___BootStartUp:;__Lib_System.c, 68 ::0xBFC00000 0x27BDFFFC ADDIU SP, SP, -4;__Lib_System.c, 72 ::0xBFC00004 0x70000000 NOP;__Lib_System.c, 73 ::0xBFC00008 0x70000000 NOP;__Lib_System.c, 74 ::0xBFC0000C 0x70000000 NOP;__Lib_System.c, 75 ::0xBFC00010 0x70000000 NOP;__Lib_System.c, 76 ::0xBFC00014 0x70000000 NOP;__Lib_System.c, 77 ::0xBFC00018 0x70000000 NOP;__Lib_System.c, 78 ::0xBFC0001C 0x70000000 NOP;__Lib_System.c, 79 ::0xBFC00020 0x70000000 NOP;__Lib_System.c, 80 ::0xBFC00024 0x70000000 NOP;__Lib_System.c, 81 ::0xBFC00028 0x70000000 NOP;__Lib_System.c, 82 ::0xBFC0002C 0x70000000 NOP;__Lib_System.c, 83 ::0xBFC00030 0x70000000 NOP;__Lib_System.c, 84 ::0xBFC00034 0x70000000 NOP;__Lib_System.c, 85 ::0xBFC00038 0x70000000 NOP;__Lib_System.c, 86 ::0xBFC0003C 0x70000000 NOP;__Lib_System.c, 87 ::0xBFC00040 0x70000000 NOP;__Lib_System.c, 88 ::0xBFC00044 0x70000000 NOP;__Lib_System.c, 89 ::0xBFC00048 0x70000000 NOP;__Lib_System.c, 90 ::0xBFC0004C 0x70000000 NOP;__Lib_System.c, 91 ::0xBFC00050 0x70000000 NOP;__Lib_System.c, 94 ::0xBFC00054 0x3C1DA000 LUI SP, 409600xBFC00058 0x37BD3FFC ORI SP, SP, 16380;__Lib_System.c, 95 ::0xBFC0005C 0x3C01A000 LUI GP, 409600xBFC00060 0x34218000 ORI GP, GP, 32768;__Lib_System.c, 99 ::0xBFC00064 0x401E6002 MFC0 R30, 12, 2;__Lib_System.c, 100 ::0xBFC00068 0x03C0E00A MOVZ R28, R30, R0;__Lib_System.c, 101 ::0xBFC0006C 0x7FDB1E80 EXT R27, R30, 26, 4;__Lib_System.c, 102 ::0xBFC00070 0x7F7E4984 INS R30, R27, 6, 4;__Lib_System.c, 103 ::0xBFC00074 0x409E6002 MTC0 R30, 12, 2;__Lib_System.c, 104 ::0xBFC00078 0x41C10800 WRPGPR GP, GP;__Lib_System.c, 105 ::0xBFC0007C 0x409C6002 MTC0 R28, 12, 2;__Lib_System.c, 111 ::0xBFC00080 0x3C02A421 LUI R2, 420170xBFC00084 0x34420583 ORI R2, R2, 14110xBFC00088 0x0040F00A MOVZ R30, R2, R00xBFC0008C 0x409E8000 MTC0 R30, 16, 0;__Lib_System.c, 114 ::0xBFC00090 0x0000100A MOVZ R2, R0, R00xBFC00094 0x0040F00A MOVZ R30, R2, R00xBFC00098 0x409E4800 MTC0 R30, 9, 0;__Lib_System.c, 117 ::0xBFC0009C 0x3C02FFFF LUI R2, 655350xBFC000A0 0x3442FFFF ORI R2, R2, 655350xBFC000A4 0x0040F00A MOVZ R30, R2, R00xBFC000A8 0x409E5800 MTC0 R30, 11, 0;__Lib_System.c, 119 ::0xBFC000AC 0x3C029FC0 LUI R2, 408960xBFC000B0 0x34421000 ORI R2, R2, 40960xBFC000B4 0x0040F00A MOVZ R30, R2, R00xBFC000B8 0x409E7801 MTC0 R30, 15, 1;__Lib_System.c, 121 ::0xBFC000BC 0x34020020 ORI R2, R0, 320xBFC000C0 0x0040F00A MOVZ R30, R2, R00xBFC000C4 0x409E6001 MTC0 R30, 12, 1;__Lib_System.c, 123 ::0xBFC000C8 0x3C020400 LUI R2, 10240xBFC000CC 0x0040F00A MOVZ R30, R2, R00xBFC000D0 0x409E6002 MTC0 R30, 12, 2;__Lib_System.c, 124 ::0xBFC000D4 0x0000100A MOVZ R2, R0, R00xBFC000D8 0x0040F00A MOVZ R30, R2, R00xBFC000DC 0x409E6003 MTC0 R30, 12, 3;__Lib_System.c, 129 ::0xBFC000E0 0x3C020010 LUI R2, 160xBFC000E4 0x0040F00A MOVZ R30, R2, R00xBFC000E8 0x409E6000 MTC0 R30, 12, 0;__Lib_System.c, 132 ::0xBFC000EC 0x34020032 ORI R2, R0, 500xBFC000F0 0x3C1EBF88 LUI R30, 490320xBFC000F4 0xAFC24000 SW R2, 16384(R30);__Lib_System.c, 137 ::0xBFC000F8 0x34021000 ORI R2, R0, 40960xBFC000FC 0x3C1EBF88 LUI R30, 490320xBFC00100 0xAFC21000 SW R2, 4096(R30);__Lib_System.c, 143 ::0xBFC00104 0x3C020080 LUI R2, 1280xBFC00108 0x0040F00A MOVZ R30, R2, R00xBFC0010C 0x409E6800 MTC0 R30, 13, 0;__Lib_System.c, 149 ::0xBFC00110 0x3C1E9D00 LUI R30, hi_addr(_main+0);__Lib_System.c, 150 ::0xBFC00114 0x37DE0050 ORI R30, R30, lo_addr(_main+0);__Lib_System.c, 152 ::0xBFC00118 0x03C00008 JR R30;__Lib_System.c, 153 ::0xBFC0011C 0x70000000 NOP;__Lib_System.c, 155 ::L_end___BootStartUp:0xBFC00120 0x03E00008 JR RA0xBFC00124 0x27BD0004 ADDIU SP, SP, 4; end of ___BootStartUp___BootGenExcept:;__Lib_System.c, 56 ::0x9D000038 0x27BDFFFC ADDIU SP, SP, -4;__Lib_System.c, 57 ::L___BootGenExcept6:;__Lib_System.c, 58 ::0x9D00003C 0x0B40000F J L___BootGenExcept60x9D000040 0x70000000 NOP;__Lib_System.c, 59 ::L_end___BootGenExcept:0x9D000044 0x27BD0004 ADDIU SP, SP, 40x9D000048 0x42000018 ERET0x9D00004C 0x70000000 NOP; end of ___BootGenExcept___GenExcept:;__Lib_System.c, 61 ::0x9D000020 0x27BDFFFC ADDIU SP, SP, -4;__Lib_System.c, 62 ::L___GenExcept8:;__Lib_System.c, 63 ::0x9D000024 0x0B400009 J L___GenExcept80x9D000028 0x70000000 NOP;__Lib_System.c, 64 ::L_end___GenExcept:0x9D00002C 0x27BD0004 ADDIU SP, SP, 40x9D000030 0x42000018 ERET0x9D000034 0x70000000 NOP; end of ___GenExceptSymbol List://** Routines locations **//ADDRESS SIZE PROCEDURE//----------------------------------------------0x9D000000  ___CC2DW0x9D000020  ___GenExcept0x9D000038  ___BootGenExcept0x9D000050  _main0xBFC00000  ___BootStartUp//** Variables locations **//ADDRESS SIZE VARIABLE//----------------------------------------------

author: Howardlong
author_rank: Super Contributor
timestamp: July 24, 2016, 07:30:23 am
content: Firstly, your program looks reasonable.Secondly, trying to get Microchip's toolchain output to work with Mikroe's bootloader is likely to be a bit of work as you are already finding!I don't have your board, but it would appear from the docs that it relies on Mikroe's toolchains and IDE to operate. And there the problem lies, that of vendor lock in, Mikroe's business model is to keep you coming back to them for hardware and compilers, they don't much want you going off to Microchip or anyone else.It may well be that you're going to need to apply a linker file to your MPLAB X project to allow your code to co-exist with Mikroe, including entry point of course. Add to that any requirements in the future for interrupts and for IVT remapping, and how the bootloader deals with that, you could be in for quite a bit of detctive work. Getting a PIC32 linker file to work properly can be a significant piece of work in itself,While I realise this isn't going to help you with your immediate problem, a similar option is the Microstick II which includes a proper programmer/debugger and is not dependent on any bootloader. If your requirement is for lots of pins and backwards compatibilty to a PIC16F877 pinout then your board may be OK but I'd see of you can hook up a PICkit3 to it and absolve yourself of the bootloader altogether.

author: N3xus
author_rank: Contributor
timestamp: July 24, 2016, 08:00:48 am
content: Yes, it seems that this is their goal.I had a look at the memory in comparison and I also think that this is just too much work to get it running.This Microstick looks very interesting but I think it I need something more flexible.The reason why I bought the Mini-32 was that it is perfectly suitable for plugging it into a breadboard, it was cheap and I don't need a programmer. And Microchip was my preferred supplier because they offer an IDE for OS X which is also the main reason why I don't want to use the IDE from MikroElektronika. Maybe I will switch to STM32 because their evaluation boards are really cheap and have the programmer/debugger included...

author: Howardlong
author_rank: Super Contributor
timestamp: July 24, 2016, 09:11:59 am
content: Quote from: N3xus on July 24, 2016, 08:00:48 amWhat is it that the Microstick II doesn't do that you would need the mini-32 for?The Microstick II:O on board programmer and debuggerO selection of four devices included, including PIC32MX250F128BO works with MPLAB X in OS XO plugs directly into breadboardMini-32 is $28, Microstick II is $35, so yes, a $7 premium.

author: N3xus
author_rank: Contributor
timestamp: July 24, 2016, 11:07:22 am
content: I know, it's quite the microstick same or even better but unfortunately I didn't saw it before I bought the Mini-32.Nevertheless I am still struggling about starting to develop with ST Micro or microchip... The big pro for ST is that they have a programmer included with their DEV boards which can also be used for programming chips which are on a designed pcb...I assume that you did the most on pics?Gesendet von iPhone mit Tapatalk

author: dannyf
author_rank: Super Contributor
timestamp: July 24, 2016, 11:26:27 am
content: QuoteThat's the code I gave you: one without config bits and another with.So it is interesting that you reported that the MikroC code worked and the two .hex files I provided didn't.QuoteThe ST programmers go for peanuts.

author: Howardlong
author_rank: Super Contributor
timestamp: July 24, 2016, 12:00:42 pm
content: Quote from: N3xus on July 24, 2016, 11:07:22 amYes, at this level, mostly PICs but also a fair bit on NXP and TI ARM Cortex M0 thru M4F, and occasionally AVR UC3.When you've invested a lot of time in particular ecosystems you tend to keep with them, not least because you risk being a jack of all trades and master of none.I have nothing against ST, and have collected several dev boards over the years, I've just never had a requirement to use their devices over something else, or at least the need to learn yet another ecosystem, as it could be done with something I already knew.

author: N3xus
author_rank: Contributor
timestamp: July 24, 2016, 12:11:40 pm
content: Quote from: dannyf on July 24, 2016, 11:26:27 amYeah that's true... Really strange...So far I have done some simple projects with AVRs but I wanted to switch to more powerful devices for driving displays and so on. Both solutions (STM32 and PIC32) are suitable... Gesendet von iPhone mit Tapatalk

author: hugo
author_rank: Regular Contributor
timestamp: July 25, 2016, 08:56:41 pm
content: Forget about mikroe bootloader, buy a PICKIT 3 and use it with MPLABX IDE .