Do you have a crystal and capacitors attached to the OSC pins, or a resonator? Add this to your code DEFINE OSC 4 . Use 4 if you are using 4mhz xtal, if you are using faster xtal you will need to change your default config statement to accept it.
Do you have a crystal and capacitors attached to the OSC pins, or a resonator? Add this to your code DEFINE OSC 4 . Use 4 if you are using 4mhz xtal, if you are using faster xtal you will need to change your default config statement to accept it.
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.
Kind of sounds like you left the /MCLR pin floating.
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.
Hi all.
thanks for the reply.
Joe S. I'm using 20mhz xtal. After Define still the same.
Bruce what should i do with the MCLR pin. I am totally zero with PIC but have some experience with BS2.
OK 20 mhz will not work with the default config statement, to use 20 mhz you must change it or comment it out of the PIC16F627A.INC file located in the PBP Directory. The Default config is set to use XT_OSC and the 20 mhz requires HS_OSC, what it does internaly is to provide the oscillator with more power, as it is needed to run that fast. Study this link : http://www.picbasic.co.uk/forum/showthread.php?t=543 As for the MCLR PIN tie a resistor about 5k ohm from mclr to thr 5v+ supply. To reset the PIC you then momentaraly ground it, OR in the config statement you turn it off and use it as an I/O.
Last edited by Archangel; - 18th January 2009 at 08:22.
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.
Joe S.
After editing the INC file in PBP I got this message
Error [113] c:\pbp\16f628.inc 22 : Symbol not defined (_HC_OSC)
For your info I'm using 16F628 now cause i broke some of the 16F627a pin while
remove it from my icsp.
Theres already a 10k resistor and a diode in series on my icsp module.
The LED blink when i touch the osc pin.
here's my code:
DEFINE OSC 20
CMCON = 7
OPTION_REG.7 = 0
TRISB.0 = 0
LED VAR PORTB.0 ' alias PORTB.0 to LED
loop:
high LED' turn on LED connected to PORTB.0
Pause 500 ' delay for .5 seconds
low LED ' turn off LED connected to PORTB.0
Pause 500 ' delay for .5 seconds
GoTo loop ' loop and blink LED forever
Last edited by azmax100; - 18th January 2009 at 13:21.
I got my LED to blink. Problem solve. This is my first lesson. Under microcode studio compile and program option I uncheck the MPASM option. I should not use the MPASM compiler.
For other newbies please learn from my mistake.
Thanks to all the forum members.
Hi Azmax100,
First off, Congratulations on your sucess, It is so irritating to pour your time and effort into a project and it does not work as expected.
I have commented out the default config statements for the chips I use most often and always insert the config statement into my code.
This gives me flexibility to quickly change things like OSC, WDT, MCLR, BOD, and I never have to go hunt for the config settings in another file.
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.
Bookmarks