Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

18F4431 40MHz Crystal frequency

Status
Not open for further replies.

dmta

Member
Hi all,

What should I do to operate a 18F4431 at 40MHz?

I tried using a 10MHz crystal with 2x22pF caps with the "HS oscillator, PLL enabled (clock frequency=4XFOSC1)" but it didn't work [I blinked an LED with 1Hz and the timing was all wrong].

I used a 4MHz with the same option but it also gave me the same result.

The pic works fine with a 20MHz crystal at HS mode.

What have I done wrong? Here is the bit configuration that I used

Regards
 

Attachments

  • 40M.JPG
    40M.JPG
    81.4 KB · Views: 184

Attachments

  • AAesp08.gif
    AAesp08.gif
    26.4 KB · Views: 190
  • 51537a.pdf
    2.4 MB · Views: 333
Last edited:
Thank you both for replying. I am using mikroc pro for pic v5.61

Code:
void main(){

     TRISC.F7 = 0;

     while(1){

              PORTC.F7 = 0;
              delay_ms(1000);
              PORTC.F7 = 1;
              delay_ms(1000);

     }

}
 
What speed does the LED blink?
How does the compiler know what frequency you are operating at?

BTW, the code you posted will produce a 0.5Hz flash.

Mike.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top