Hi,
I am using LPC4357 controller. I wrote a code for led blinking. After downloading the code into uC and reset the uC the code is not running. If I do restart some 4-6 times, then 1-2 times uC running properly. but in debug mode it is running every time properly. If I change the code to internal oscillator, then every time the code is running. I probed the crystal output (crystal load capacitance is 20pf) and input it is coming proper waveform including the time when led is not blinking. After that I probed reset circuit also it is taking around 80msec to reach 3.3V. I observed a strange behavior while measuring reset voltage, whenever I touch reset pin with multimeter probe then controller is up and running properly.
What I am understanding is controller is getting up with internal oscillator, but it is not able to shift to external oscillator sometimes. I am not able to find the proper root cause of the issue. can anyone please help me to debug the issue?
Hi,
From your description, it appears that the external crystal leads to the issue that the LPC4357 can not start-up reliably, because the chip runs fine if you use internal clock.
First of all, pls check the loading capacitor value.
The Cx1=Cx2=2*(crystal load capacitance)-cap_parasitic.
for example, if the required crystal load capacitance is 20pF, assume the parasitic cap value is 3pF,the
Cx1=Cx2=2*20pF-3pF=37pF.
Secondly, pls check the code to switch from internal clock to external crystal clock? do you use PLL?
BR
XiangJun Rong
Hi,
My load capacitance of crystal is 10pf and I mounted 20pf. yes code is working in PLL1. Since low frequency clock shifting from internal to external is happening so I think code is right.
This is my PLL configuration.
for 192Mhz
MSEL 11
DIRECT 1
and other values are zero.
Hi,
Pls check if the P2_7 is high during/after Reset so that the LPC4357 can boot-up from internal flash.
Hope it can help you
BR
XiangJun Rong
Yes, P2_7 is pulled high.
I am not a hardware designer, but picked up one or the other thing during the years ...
First, I guess you are talking about a custom board, i.e. your own design, don't you ?
Second, such instabilities can come from the clock path or the power supply path. Insufficient power supply or capacitive buffering can cause such problems, especially during transients (like clock switching).
And third, I would check the PLL setting code, so as to not exceed any parameter limits, even temporarily (multiplier, divider).
I would try lower core clock values, and see if they work more stable. At least as a start.
Hi,
You use 16MHz external clock as the PLL1 input clock, the M is 12, the FCCO is 16*12=192MHz, so the FCLKOUT is 192MHz, I suppose it is okay.
I suppose that PLL1 lock is not implemented, you poll the lock bit, but is it not set, the the code hangs.
BR
XiangJun Rong
Hi,
Here I attached the PLL1 code part.
I am thinking it is correct. please check the same. If I call this part two times once for PLL1 clock for 144Hz and other for 192 MHz then code is working fine.
I tried to set PLL1 at 160Mhz and it is working fine. But what could be the issue in higher clock settings? we can set clock upto 204Mhz. In some pcb I used same circuit and I am using 192Mhz.
As said, I'm not a hardware guy, thus I can't really answer the question.
But the result would give an indication.
I assume you (or the designer) used the recommended values and placement of clock tree and power supply components.
> In some pcb I used same circuit and I am using 192Mhz.
That would indicate hardware, IMHO. Perhaps one of the component values is "marginal", or the PCB layout is needs improvement.
But I leave that to hardware guys with more experience in this area ...