PDA

View Full Version : PIC16F876A-I/SO oscillator problem



Nicmus
- 20th September 2006, 02:26
Hi all,
I知 using PBP 2.45a in conjunction with CDlite version 1.6 Built 3 and MeLabs programmer software version 3.00.
I知 trying to convert an application from PIC16F876-20 I/SP, 28 pin DIP to PIC16F876A-I/SO, 28 pin SOIC.
The specs show that both PICs can go up to 20 MHz crystal but for some strange reason I can not get the 876a to go higher then 4 MHz.
Just by using a simple program like this:

@ device pic16F767, wdt_on
DEFINE OSC 16
Led VAR PORTB.0
Loop:
High led
Pause 1000
Low led
Pause 1000
Goto loop
END

It works with the DIP 876 but does not work with the SOIC 876A. The crystal does not oscillate. I知 using the same crystal and capacitors (22pF).
Is there a configuration fuse I have to change to get it going and force it in HS mode?
Any suggestion will be more then appreciated.
Best Regards,
Nick

Payatronico
- 20th September 2006, 06:04
the same code that you generate for pic's 16f87x can run if you only will turn on and off a led in port b.0 so, generate the code for any pic 16f87x I try with 116f877 for any program and it works well

other solution could be that you are not selecting the oscilator to XL in the programmer.

btaylor
- 20th September 2006, 12:27
Don't forget that the configuration fuses are set before you load your basic code. You might have a PIC set for RC or slow speed (XT) to save power.

To operate at 20 MHz you must set the oscillator option to HS in EPIC or whatever programmer you use.

Check you @ device line and add the command for HS oscillator.

HTH
Brian

Nicmus
- 20th September 2006, 13:14
Thank you Payatronico and Brian.
I'm having a blank right now.
What will that command for HS configuration be?
Thanks again.

Nick

mister_e
- 20th September 2006, 14:22
Have a look at this => http://www.picbasic.co.uk/forum/showthread.php?t=543

Nicmus
- 20th September 2006, 14:42
Thank you all.
I found the missing piece.
I needed a hs_osc to my CONFIG line.
Thanks again for your help.

Nick