Hi guys
I designed a small circuit with Microchip PIC16F877A micro. Non of the programs compiled with HI-TECH C compiler worked on the unit. I used the same programmer for several other systems. There is not much difference in this circuitry other than the 8MHz crystal oscillator I used. Even a small program to make a pin high doesn't work.
Can you think of a solution please?
16F877A isn't working with External Oscillator (HI-TECH C)
Re: 16F877A isn't working with External Oscillator (HI-TECH C)
You would need to set the oscillator at compile time. For 8MHz, you need to set to HS mode. Refer 12.2 section on the datasheet (Page 123).
To do this on HI_TECH C, add the following line before main.12.2 Oscillator Configurations
12.2.1 OSCILLATOR TYPES
The PIC16F87X can be operated in four different oscillator
modes. The user can program two configuration
bits (FOSC1 and FOSC0) to select one of these four
modes:
• LP Low Power Crystal
• XT Crystal/Resonator
• HS High Speed Crystal/Resonator
• RC Resistor/Capacitor
XT
455 kHz
2.0 MHz
4.0 MHz
HS
8.0 MHz
16.0 MHz
Code: Select all
__CONFIG( HS & WDTDIS & PWRTDIS & BORDIS & LVPDIS & WRTEN & DEBUGDIS & UNPROTECT );