Delays seem variable - Resonator Issue?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Delays seem variable - Resonator Issue?

671 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by micro9000 on Wed Jul 10 09:59:36 MST 2013
I have been playing around with delays and I have noticed that at times the delay isn't correct or the LED doesn't blink at all (nothing happens). For instance, working off of the systemtick examples, I use 1000 for 1s and 500 for .5s. When I ran it the first few times the delay appeared accurate for the LED I am using.

After this, I notied that upon programming it again, I noticed that the delays would start to decay and eventually it would stop working. Is this an indication of a oscillator/resonator issue? I tried a few different resonators (same capacitance) and the result was the same. What I suspect is that it could be the capacitance rating of the resonator. The one I have is a ceramic 20MHz resonator with 30pF capacitance.

I already ordered a 12MHz resonator with 30pF capacitance, but now I am not sure if I will get the same result. I am debating whether or not this is the issue from Table 15 in the user manual "crystal and external components parameters."

Here is a link to the resonator I have selected:
12Mhz 30pF built-in ceramic resonator


In addition, at times I get an error stating:

"05: File .axf load failure Ep(08). Cannot access core regs when target running."
(After building it again sometimes this goes away, but it appears after programming again the microcontroller is not operating properly - nothing happens and the LED does not blink)

I'm really not sure what is causing these issues with delays and what could be causing this error.

EDIT:
__________
Am I better off using a crystal such as this 12MHz crystal? It has a 20pF load capacitance, has a ESR of 40 Ohm, and I can use it with these 39pF capacitors. So, it seems like it checks out and could work better then the resonator I am using. Is this the way to go?
0 Kudos
Reply
2 Replies

659 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by micro9000 on Wed Jul 10 11:29:45 MST 2013
I was just trying to figure out if it is the resonator causing the delay/instability issues (it seems like it could be causing the problems mentioned above as you've suggested with system core clock). If the crystal I have selected isn't as good as one that you may have in mind, please do share :). The application I am think of doing would be dependent on keeping track of time so accuracy is of concern.

EDIT:
________
I purchased the crystal and capacitors I have selected. I'll let you know if either the 12MHz resonator or the crystal works.
0 Kudos
Reply

659 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Jul 10 11:13:21 MST 2013

Quote: micro9000
I have been playing around with delays and I have noticed that at times the delay isn't correct or the LED doesn't blink at all (nothing happens). For instance, working off of the systemtick examples, I use 1000 for 1s and 500 for .5s. When I ran it the first few times the delay appeared accurate for the LED I am using.


There's no reason why SysTick shouldn't work as long as SystemCoreClock is correct and you are not exceeding 24bit in  SysTick->LOAD...


Quote: micro9000
Am I better off using a crystal such as this 12MHz crystal? It has a 20pF load capacitance, has a ESR of 40 Ohm, and I can use it with these 39pF capacitors. So, it seems like it checks out and could work better then the resonator I am using. Is this the way to go?



0.5% Accuracy or 30ppm, what do you want?
0 Kudos
Reply