AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Pic32 view on coolterm3/13/2023 ![]() ![]() So I've set the multiplier to 50, which means by 8Mhz will now be 400Mhz. The PIC uses something called a PLL (or Phase Locked Loop) to multiply the frequency we put into it, allowing us to run at very high speeds with a lower input frequency. If you have connected an external clock or a crystal, this will be set to POSC (which is short for Primary Oscillator). This tells the PIC32MZ where the clock signal is coming from. This next line tells the PIC32MZ what range this frequency is in, and 8Mhz fits nicely into the 5 to 10Mhz range. This means the PLL input frequency will be 24 / 3 = 8Mhz. I start with my 24Mhz clock frequency and I set the input divider to 3. #pragma config FPLLIDIV = DIV_3 // System PLL Input Divider (3x Divider) While it initially seems like a lot to take in, it's not that bad. ![]() #pragma config FNOSC = SPLL // Oscillator Selection Bits (System PLL) #pragma config POSCMOD = EC // Primary Oscillator Configuration (External clock mode) #pragma config FPLLODIV = DIV_2 // System PLL Output Clock Divider (2x Divider) #pragma config FPLLMULT = MUL_50 // System PLL Multiplier (PLL Multiply by 50) #pragma config FPLLICLK = PLL_POSC // System PLL Input Clock Selection (POSC is input to the System PLL) #pragma config FPLLRNG = RANGE_5_10_MHZ // System PLL Input Range (5-10 MHz Input) In my example, I'm using a 24Mhz External Clock and I want the chip to run 200Mhz so I set the relevant fuses as follows: #pragma config FPLLIDIV = DIV_3 // System PLL Input Divider (3x Divider) Today I'm purely going to be focussing on how to get the chip running at the frequency we want because it's long enough that it deserves a post of its own.įor my example, I'm using a PIC32MZ2048EFF144, but this configuration applies to any PIC32MZ chip, and is very similar to PIC32MX configuration settings. So we need to set up the configuration "fuses" (just another name for setting) before we even begin to code. Everything seems to be set to low speeds, all the digital ports are set to analog and nothing is how you generally want it to be. One of the biggest problems with the PIC32 series is that the startup configuration sucks. However, the reason for having this blog was to share why we set things to the values we do so here goes! TL DR warning: This goes into quite a lot of detail and you can just download the code at the bottom of the page and it'll work fine. How to configure the PIC32MZ to run at 200Mhz
0 Comments
Read More
Leave a Reply. |