Page 1 of 1

Setting PB2CLK for PIC32MZ2048EFG144 - Unlock Sequence

Posted: Wed May 13, 2020 1:29 am
by Brendan
Hello experts,

I'm needing to change PB2CLK for correct UART speed, though I've come across need to exercise an unlock sequence before being able to change the prescaler. Presently the UART has to be declared at 4x speed in Flowcode with the default SYSCLK division of 2 (PB2CLK = 100MHz), so fundamentally I'm trying to exercise the following in a C block... PB2DIVbits.PBDIV=8

I realise I'm being a little lazy here, but wondering if anyone has successfully exercised the applicable unlock sequence in a C block, or can offer a few pointers?

Thank you in advance,
Brendan

Re: Setting PB2CLK for PIC32MZ2048EFG144 - Unlock Sequence

Posted: Wed May 13, 2020 4:45 pm
by stefan.erni
Hi Brendan

There is like sample how to unlook:

http://www.matrixtsl.com/mmforums/viewt ... nce#p91247

But for the UART Speed read this:

http://www.matrixtsl.com/mmforums/viewt ... 76&t=22017

I hope it helps

regards
Stefan

Re: Setting PB2CLK for PIC32MZ2048EFG144 - Unlock Sequence

Posted: Wed May 13, 2020 5:46 pm
by Brendan
Thank you Stefan, a very useful link!

I originally came across the following and couldn't believe that simply changing a clock prescaler could be so cumbersome - but evidently it is.
https://www.microchip.com/forums/m935190.aspx

Tech used to be so much less bloated - and much more productive :?

Thank you again, and best regards,
Brendan