Page 1 of 1

Circuit will not work with 20MHZ xcal

Posted: Wed Apr 11, 2012 10:29 am
by Puddy32
Hi guys
Im a bit stuck at the moment
I am trying to get a motor running with PWM and things were going well but I wanted a higher PWM frequency for better control and eliminate audible hum.
So I changed out my 4MHZ crystal and put in a 20MHZ made all the necessarily changes but nothing works properly now. Im using a 16F877A
Went back to basics and made a simple program(led flashing, lcd screen flashing message) with the correct configs and it ran ok on my EB006.
But in my circuit it just doesnt run, very erratic , the screen displays once and then nothing, the led flashes erratically and then stops after 30seconds.

After numerous different attempts I put back in my 4MHZ; in HS mode it doesn't work but when i change to XT it works perfectly.
My settings: project options=20KMZ, Configure options= Xcal HS , circuit 22pF with the crystal, have power and gnd where it should be, 10K between power and MCLR. have caps between power and ground.
One thing when i change to XT in the menu, exit and re-enter the selection has automatically gone from XCAL to RC, is that normal? so the 4MHz circuit that worked would be RC XT.
could there be a setting in the compiler options i need to change?
Hope thats understandable.
Puddy

Re: Circuit will not work with 20MHZ xcal

Posted: Sat May 12, 2012 5:57 pm
by medelec35
Hi Puddy,
did you get your hardware to run OK?

If not, can you post your flowchart and the compiled hex and C code and I can see if I can spot something for you.

Martin.

Re: Circuit will not work with 20MHZ xcal

Posted: Sun May 27, 2012 11:45 am
by Puddy32
Hi Martin
Thanks for inquiring.
After three days of torture i found the problem, it was the capacitors on the voltage regulator,they werent the correct value.
They were close but not right, when I put in the correct values it worked.
So obviosly if your working with a high frequency xcal you need to have the proper caps.
Hope this help someone.

Puddy