Please help me, i designed a one board width 16F877A and 20MHz xtal.
CPU not working.
code is designed with DEFINE OSC 20
4mhz xtal working perfect.
DEFINE OSC 4
why????
please help me.
16f877A - I/P - 20MHz (DEFINE OSC 20) - Don't work
Please help me, i designed a one board width 16F877A and 20MHz xtal.
CPU not working.
code is designed with DEFINE OSC 20
4mhz xtal working perfect.
DEFINE OSC 4
why????
please help me.
16f877A - I/P - 20MHz (DEFINE OSC 20) - Don't work
Have you set the device configuration word (or 'fuse') to the appropriate value for the 20MHz osc?
Arch
"Data sheets? I ain't got no data sheets. I don't need no data sheets. I don't have to read any stinking data sheets!"
I had the same problem, I didn't set the option on the programmer to HS (High speed.) I used the MELabs programmer, just go under options and make sure the oscillator is set for HS. After that everything worked great. I'm assuming that you do have the correct capacitors on the crystal.
Jerry.
I also had the same problem, PIC16F877A I/P e3 sample from micrpchip,
i set config. bit in programmer "HS" , but working only up to 4 MHZ
I found this helpful, from the Microchip website;
http://ww1.microchip.com/downloads/e...Doc/31002a.pdf
I hope it helps.
Jerry.
a try all configurarion in hardware and software, other forum, say that using a command for set de fuses, but, not work, my configuration word is 2F4A, in de code write:
@ DEVICE HS_OSC
@ DEVICE WDT_OFF
@ DEVICE lvp_off
Define OSC 20
use other combination too:
@ DEVICE HS_OSC
@ DEVICE WDT_OFF
Define OSC 20
@ DEVICE HS_OSC
@ DEVICE lvp_off
Define OSC 20
@ DEVICE HS_OSC
Define OSC 20
with osciloscope, obtain sin wave in pins 14 and 13 at 20 +- 0.8 Mhz, for test, program pic whit this:
Prg:
PortA = %01010
PortB = %01010101
pause 500
hserout ["Prueba de envio 1",13]
PortA = %10101
PortB = %10101010
pause 500
hserout ["Prueba de envio 2",13," ",13]
goto prg
Hi ustredna,
What everyone here is trying to explain, but not quite doing is this:
The PIC oscillator requires a bit more power to operate at speeds above 4mhz.
you set the program parameters to be correct in your code for the oscillator speed with your DEFINE OSC 20 statement, but you tell the programmer to enable the oscillator to use the high power setting with the config fuse, or by manualy selecting HS on the programmer's software, elsewise your Oscillator is not going to work.
JS
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Last edited by JD123; - 13th March 2008 at 23:06.
you will have to edit your 16F877A.inc file as below.
NOLIST
ifdef PM_USED
LIST
include 'M16F87xA.INC' ; PM header
device pic16F877A, HS_osc, wdt_OFF, lvp_off, protect_ON , CP_ON
XALL
NOLIST
else
LIST
LIST p = 16F877A, r = dec, w = -302
INCLUDE "P16F877A.INC" ; MPASM Header
__config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
NOLIST
endif
LIST
Your 16F877A will work on 20Mhz.
Bookmarks