Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

PIC 16F84A Crystal Dont Work?

Status
Not open for further replies.

wolf12

Advanced Member level 4
Joined
Mar 31, 2011
Messages
109
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
2,102
I've been using RC circuits as the ossilator configuration for 16f84a. They work well. But now when I'm trying to use a 4MHz or 10MHz crystal, it doesnt work, even for the blinking LED program. Do I have to change something in the program when changing the oscilator configuration? (Assembly Language used)
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,967
Helped
14,147
Reputation
28,553
Reaction score
12,834
Trophy points
1,393
Location
Bochum, Germany
Activity points
278,259
Are you aware of the oscillator related configuration bits ("fuses")? You have to change default RC to XT oscillator configuration, setting FOSC1 to '0'.
 

wolf12

Advanced Member level 4
Joined
Mar 31, 2011
Messages
109
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
2,102
Are you aware of the oscillator related configuration bits ("fuses")? You have to change default RC to XT oscillator configuration, setting FOSC1 to '0'.
No i didnt know, you do it in bank 0 or 1? bcf FOSC1 works ?
I read the datasheet and it says about a 2007h register.
 

rishabh.anand

Newbie level 3
Joined
Sep 10, 2010
Messages
4
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
bangalore
Activity points
1,308
else if u are using MPLAB IDE u can set config bits separately by unchecking the option ' configuration bits set in code", set oscillator to 'HS' type..hope it works
 
  • Like
Reactions: wolf12

    wolf12

    points: 2
    Helpful Answer Positive Rating

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,715
Helped
4,810
Reputation
9,637
Reaction score
4,590
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
125,343
Its a configuration fuse, not a file register. You have to set it at the programming stage, it can't be changed under program control, if you did it would crash the processor!
You can either set it manually or embed the configuration in the HEX file if your assembler lets you do that. Most programming hardware will check to see if the configuration is stored in the HEX file and if it finds it will set the configuration for you.

For 4MHz you can use either XT or HS mode, for 10MHZ only use HS mode. The only difference between XT and HS modes is the gain of the internal oscillator, there is a wide overlap area around 4MHz where both will work equally well.

Brian.
 
  • Like
Reactions: wolf12

    wolf12

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top