Page 1 of 1

Feeling really Dumb

Posted: Sun Feb 09, 2014 6:50 pm
by Bobw
I am using a 16F1827 18 pin DIP
I wrote a simple Blink LED to verify my programming set up.
Works fine in simulator.
PicKit3 will not program it (another issue all together)
Used Pickit3 stand alone program to program the hex file the FC5 made.
Programmed with success, verified, but program does not run on PIC???
I know I missed a real lame setting some where.

Re: Feeling really Dumb

Posted: Sun Feb 09, 2014 8:44 pm
by medelec35
Hi Bob, for hardware like EB006 programmer that uses a 19.66 crystal to drive the clock, there is not an issue with your flowchart.

Although if you had a Eb006 then you will not require a PICkit3 to program it!

So what is your hardware setup?
Have you got a diagram?

Using crystal and caps for clock circuit?

Are you using the voltage from the programmer?

Perhaps you can verify the 5V supply is present.


Martin

Re: Feeling really Dumb

Posted: Sun Feb 09, 2014 9:42 pm
by Bobw
Martin,
Wow quick response. Thanks:
Not using an external crystal.
Only thing on the board is the PIC and the 5 pin programming plug.
A single LED to Pin 3 (RA4) with a 100ohm dropping resistor and a 4.7K pull down resistor.
I do have to LED correctly oriented polarity wise. Works when I apply direct 5V to the LED.
I forgot to set the oscillator osccon = 0x70; in the beginning but fixed that.
Redid the 4.7K resistor between pin 14 (+5V) and Pin 4 (MCLR)
Have tried letting the pickit3 power it and an external 5V supply.
I do have an LED to indicate 5 volts is present and it lights in both cases.

Bob

Re: Feeling really Dumb

Posted: Sun Feb 09, 2014 9:56 pm
by medelec35
Hi Bob,

No problem,

Your Flowchart configuration is set for external osc and clock speed of 19660800Hz.
You will need to change the clock to internal osc, and change the speed to 8000000Hz if using a c code box at the start with osccon=0x70;
Unless you want to use the PLL that is?

You don't need a 4k7 pull down resistor for the output at RA4

4K7 will only be necessary if its an input and you also have a normally open switch connected to the input and +5V.

Re: Feeling really Dumb

Posted: Sun Feb 09, 2014 10:12 pm
by Bobw
Removed the pull down resistor.
Set osccon = 0x70; in a C code box at the very beginning.
Have "Auto clear watch dog" Unchecked.
Verified that the program was written to the pic.
I have another chip I am going to try.

So simple yet so hard !

Re: Feeling really Dumb

Posted: Sun Feb 09, 2014 10:17 pm
by medelec35
Hi Bob,
You have not set the configurations as my last post.

Have a try with this attachment.


Martin

Re: Feeling really Dumb

Posted: Sun Feb 09, 2014 10:31 pm
by Bobw
Yeah I saw that I did not change the clock to 8000000 right after I posted what I had.
Tried another PIC, even tried changing to output to Pin 10 (RB4)

Will take a coffee break and try again.

Re: Feeling really Dumb

Posted: Sun Feb 09, 2014 10:44 pm
by Bobw
Martin,
Thank You.
Helps if you also do not have the supplementary code box checked too......
The LED in question is also going to be used as an ON indicator from that pin.
Think I have just gone at it too long and got tunnel visioned.
All works as expected.

Re: Feeling really Dumb

Posted: Sun Feb 09, 2014 11:41 pm
by medelec35
As long as it's all working which is great. :)
Thanks for the update.

Martin