| FORUM

FEDEVEL
Platform forum

Important notice : When software makes you think your design is wrong ...

mulfycrowh , 02-25-2022, 09:25 AM
Hi everyone !

Sometimes you made everything professional about the hardware design and your board seems to be good for the garbage !
Take your time and read CAREFULLY the datasheets.
You have to be really careful with registers.
Registers are invaders from another planet who makes you think that your development is wrong...

I recently experienced this problem with PIC32MK from Microchip.
PIC32MK Product Family | Microchip Technology

When I received a prototype I check everything with ohmmeter, oscilloscope and spectrum analyser...
I immediately noticed that the main crystal (12 MHz) doesn't oscillate.

I sent the board back to the manufacturer, a leading services manufacturing company.
They didn't find the reason to this problem.
In the mean time, I purchased the J-32 probe from Microchip.
J-32 Debug Probe | Microchip Technology

I was unable to make the probe run to write some software on the MCU.
At this time you really think you have a big hardware issue on your board.
You are on the verge to throw everything through out the window.

A few months later, I discover that, contrary to what it is written on the Microchip website, the probe is not compatible with PIC32MK.
I have to say that Microchip helped a lot on that case !
They changed the probe for another one, the MPLAB PICKit 4.
MPLAB® PICkit™ 4 In-Circuit Debugger | Microchip Technology

They made the board run !!!!
Why ????
Because at very first time of operation, PIC32MK uses its internal oscillator and makes you able to use the JTAG connector for programming and debugging purpose.

And now comes the best !
You have a register that allows you to choose between internal or external oscillator.
When you choose the external oscillator, the oscillator starts to oscillate.
It didn't oscillate because the register shut it down, I guess that the MCU put both oscillator inputs to high Z state because I saw a "floating 50 Hz signal" on the scope.

I wanted to share this experience !
Be free to ask any question.
I am here to reply !



qdrives , 02-25-2022, 04:22 PM
It is not only the PIC32MK that has registers to control the clock and crystal... A lot of microcontrollers do.
Step 1 in software design are the clocks, together with power if present. With having this configured correctly, nothing may work correctly.
robertferanec , 02-26-2022, 01:45 AM
Registers are super tricky - some chip manufacturers have plugins which help with registers setup. I recommend to use them - it can save you a lot of time e.g. MPLAB has MCC configurator for PIC, I made a video about it: https://youtu.be/e6YTg-UrKes?t=811
Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?