PIC32MZ Mini

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
Novakiss
Posts: 21
Joined: 24 Sep 2017 23:02

PIC32MZ Mini

#1 Post by Novakiss » 16 Nov 2019 20:05

Hello
I have the dev.board
https://download.mikroe.com/documents/s ... l-v101.pdf

However I cannot even to get any simple blink working, struggling to set oscillator frequency. The board just get very hot and not working.

Can you please provide any blink example for this board? How to set up correctly configuration bits for the oscillator?

I need frequency 80MHz, I use manual from here:
http://ww1.microchip.com/downloads/en/D ... 01250B.pdf

the settings from "Edit Project" are also not help and not change anything.

Code: Select all

program testme

' Declarations section 

main:

'FNOSC0_bit   = 1
'FNOSC1_bit   = 1
'FNOSC2_bit   = 0
'
'POSCMOD0_bit = 0           ' EC
'POSCMOD1_bit = 0
'
'FPLLIDIV0_bit = 1          ' div by 6
'FPLLIDIV1_bit = 0
'FPLLIDIV2_bit = 1
'
'FPLLRNG0_bit = 0           ' bypass
'FPLLRNG1_bit = 0
'FPLLRNG2_bit = 0
'
'FPLLMULT0_bit = 1           ' x40
'FPLLMULT1_bit = 1
'FPLLMULT2_bit = 1
'FPLLMULT3_bit = 0
'FPLLMULT4_bit = 0
'FPLLMULT5_bit = 1
'FPLLMULT6_bit = 0
'
'FPLLIDIV0_bit = 0           ' div by 2
'FPLLIDIV1_bit = 0
'FPLLIDIV2_bit = 0





ANSELE = 0
TRISE  = 0

ANSELB = 0
TRISB  = 0

while (1)

  LATE = 0
  LATB = 0
  delay_ms(100)
  LATE = 0xFFFFFFFF
  LATB = 0xFFFFFFFF
  delay_ms(100)
  

wend
end.

Novakiss
Posts: 21
Joined: 24 Sep 2017 23:02

Re: PIC32MZ Mini

#2 Post by Novakiss » 17 Nov 2019 21:44

Can you please attach Project->Edit Project configuration or complete project with any PIC32MZ mini led blinking working example?
I have tried to configure the oscillator but the board only get heat and no blinking... seems like I missing something that the board does not even start.
On scope external oscillator is working ~24MHz

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: PIC32MZ Mini

#3 Post by jovana.medakovic » 18 Nov 2019 15:11

Hello,

In the attachment, you can find the LEDBlinking example where I set 80MHz frequency using a 24MHz external oscillator.

Kind regards,
Jovana
Attachments
Led Blinking.zip
(126.89 KiB) Downloaded 98 times

Novakiss
Posts: 21
Joined: 24 Sep 2017 23:02

Re: PIC32MZ Mini

#4 Post by Novakiss » 18 Nov 2019 16:28

Thank you, Jovana.
But it does not work. Bootloaded software connecting to the dev.board and reporting that hex loading was successful. However the board still not blinking even with your hex. The board just heating. I purchased it from digikey, first time connected it was blinking with the default pre-loaded software. But after I have tried to upload my first hex it just seems to be dead.

Maybe I'm missing here something small and important, maybe I'm doing something wrong. Hope you can advice.

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: PIC32MZ Mini

#5 Post by jovana.medakovic » 18 Nov 2019 17:21

Hello,

If you want to load the hex file using the bootloader application, you need to set MCU clock frequency to 200MHz, because the Bootloader works on this frequency.
In the attachment, you can find the LEDBlinking example where I set the 200MHz frequency. Load this hex file and let me know does it works.

Kind regards,
Jovana
Attachments
Led Blinking.zip
(126.96 KiB) Downloaded 109 times

Novakiss
Posts: 21
Joined: 24 Sep 2017 23:02

Re: PIC32MZ Mini

#6 Post by Novakiss » 18 Nov 2019 18:08

Now it works! :D Many thanks for your help.
200MHz even better for me. Should I use only 200MHz clock further with any project and bootloader on this board?

Is it normal that the board is hot?

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: PIC32MZ Mini

#7 Post by jovana.medakovic » 19 Nov 2019 16:30

Hi,

If you want to program the MCU using the bootloader application, you need to use a 200MHz clock.

Regarding the temperature, for the PIC32MZ family, it is normal for it to heat up because it works on 200MHz.

Kind regards,
Jovana

Novakiss
Posts: 21
Joined: 24 Sep 2017 23:02

Re: PIC32MZ Mini

#8 Post by Novakiss » 26 Dec 2020 16:17

I hope somebody can help again.
I attach my project for PIC32MZ mini. I'm using bootloader application to burn the firmware. All I need is to dump array via UART. I need CPU speed 200mHz for bootloader and UART 115200

But UART is not working, sometime it working but has erratic output, i.e. not with the baudrate I set in the code. Sometime the board just does not start and stay in reset. I think I have problem to set oscillator and periferal bus speed settings correcly. I have tried to set the oscillator PLL config bits manually, but the board just do not start. And it seems like playing with any project settings does not change anything too in my case. Hope somebody can set the project settings bits correctly.
Attachments
FIRMWARE-1.zip
(167.77 KiB) Downloaded 68 times

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: PIC32MZ Mini

#9 Post by filip.grujcic » 29 Dec 2020 10:12

Hello,

You cannot access configuration bits on PIC MCUs from code due to the PIC's design, they are only accessible while the PIC is in programming mode.
Since you are using the USB bootloader you are not able to change values of configuration bits -- you will have to get an external PIC programmer in order to do this.

Kind regards,
Filip Grujcic

Novakiss
Posts: 21
Joined: 24 Sep 2017 23:02

Re: PIC32MZ Mini

#10 Post by Novakiss » 29 Dec 2020 15:03

Thank you for the details.
But why UART has erratic baud rate when I use the default ledblink project oscillator settings (file posted above by support)? I download the ledblink project example from this thread for bootloader, just add UART and it does not work at correct speed.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC32MZ Mini

#11 Post by Dany » 30 Dec 2020 19:32

Novakiss wrote:
18 Nov 2019 18:08
Now it works! :D Many thanks for your help.
200MHz even better for me. Should I use only 200MHz clock further with any project and bootloader on this board?

Is it normal that the board is hot?
Hi, perhaps this review on the PIC32 mini can help you; viewtopic.php?f=202&t=63673. I obtained the min32 some time ago and I had to use a clock setting in the IDE of 80 Mhz. So, if the crystal frequency and the (bootloader) config settings are not changed since then you sould presumably use 80 Mhz in stead of 200 Mhz.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Novakiss
Posts: 21
Joined: 24 Sep 2017 23:02

Re: PIC32MZ Mini

#12 Post by Novakiss » 03 Jan 2021 16:20

Dany wrote:
30 Dec 2020 19:32

the (bootloader) config settings
Thank you for the hint. But how can I see or change bootloader config to view/change configuratiuon bits for the project? The bootloader folder does not contain any ini or config I can view same things you posted. Support say I just need to set 200MHz in IDE, however something wrong here because the board MINI MZ not works correctly. I add UART initialization and it just do not start 50/50. When it starts, I get wrong baudrate 151515 instead 115200. Seems like periferal bus or controller oscillator are not configured well. Maybe I have not properly soldered BGA chip, I don't know. Be honestly very frustrated with the support of PIC32 because no single explanation how to configure project for bootloader application.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: PIC32MZ Mini

#13 Post by filip » 04 Jan 2021 16:45

Hi,

You can import the bootloader HEX file into the mikroProg Suite for PIC application and see how config bits are set.

Regards,
Filip

Post Reply

Return to “mikroBasic PRO for PIC32 General”