Hi Bruce,
I know the datasheet shows RA7 is external clock in..but I dont get it working. When connecting to RA6 it works. should I try a long-time test if the pic gets to hot? maybe a resistor between canned oscillator and PIC?
Hi Bruce,
I know the datasheet shows RA7 is external clock in..but I dont get it working. When connecting to RA6 it works. should I try a long-time test if the pic gets to hot? maybe a resistor between canned oscillator and PIC?
Hi Mugelpower,
Here is what I think, <b>I say think because I do not definately know.</b> Being that your config fuse setting is WRONG, I think your PIC is not properly set up for EXT OSC and that is why it will not accept input on RA7, I THINK it it using the oscillator as a crystal, somehow getting enough signal to work, elsewise it may be defaulting to int osc, who can say? Try sending out some serial data to a serial lcd and see if it scrambles the data, better yet correct your config statement and then try the OSC on it's proper pin. I compiled your code both ways and the hex files have some distinct differences. One more thought, the PIC is probably using the default config statement in the 16F628A.inc file, unless you have commented it out.
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.
Try the attached .hex file with your oscillator connected to RA7. This is your code compiled
with EC oscillator settings I posted previously.
If it doesn't work I would guess you have a bad PIC, oscillator, or both. Or your programmer
is not using the config options embedded in the .HEX file.
This @config_EXTCLK_OSC is not valid, so it does nothing to set EC mode. Whatever config
options you're getting programmed into the PIC are the defaults in 16F628a.inc. Normally osc
is set to XT in the defaults. In this mode, OSC2 provides the drive for an external crystal circuit
like the one shown in first diagram on the link you posted.
Thanks Bruce,
will test that in the evening. Its now 3 pm. will take another 4 hrs til Iīm home.
Does That mean MPASM doesnīt handle extern osc settings ?
Or does it mean the PicKit2 sets its own default osc settings?
very strange.
MPASM works just fine with any config directives the PIC has, but they are different than config directives the PM assembler expects. See the thread I linked to above for the details on config use. Melanie does a nice job explaining this.
I don't have a PicKit2, so I can't really say how it works, but I would assume it can read & use config options embedded in the .HEX file, or give you an over-ride option.
Maybe someone else here familiar with the PicKit2 can comment on this one?
Look in the 16F628a.inc file in your PBP directory. If you use PM, it uses the top config defaults. If you use MPASM, then the 2nd default config options are used.
When you insert a bogus config directive in your code, it isn't used, and of course it has no bearing on what config options will be embedded in the .HEX file.
Read the thread by Melanie I linked to earlier. It is well worth the time.
Thanks Bruce,
your file is ok and now 20Mhz could find their way via RA7!
I will try to grasp the "Define-thingy" by reading and trying.
Ha!
Hi Bruce,
as I told you your hex code of my small program really works.
But if I take your previously shown config fuses I get only a compilation error
'************************************************* *******************************************
' 16F628A 20Mhz extern canned Oscillator
' damn program should blink an LED
' Igot that compilation error
'************************************************* *****************************************
@ __config _EXTCLK_OSC & _WDT_OFF & _MCLRE_OFF & _LVP_OFF & _CP_OFF
LED VAR PORTB.7
CMCON = 7 ' RA0-RA3 are digital I/O
TRISB = %01111111 ' RB7 is output, rest are inputs.
main:
led = 1
pause 500
led = 0
pause 500
goto main
END ' End of program
Error[118] c:\pic\16f628a\blinkb~2.asm : Overwriting previous address contents (2007)
when I use only this config:
@ __config _EXTCLK_OSC
I get no comp. error but the thing dosnīt work either.
is an external Osc. with 20 Mhz a no go for PBP ?
Bookmarks