Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ICSP and 16F877A help

Status
Not open for further replies.

spectrum

Member
hello all,

i'm posting for some help on missing clock on 16F877A

First of all, i have some questions about the ICSP programming:

I've used ICSP programming algorithm 1, with 13V on MCLR.
Microchip says that this serial programming allow to program the microcontroller in the user circuit application. I've discovered that if there is a crystal resonator connected to osc1/osc2 the configuration bits programming fail, when i read the bits back i get 0x0000. Disconnectiong the crystal seems they are programmed fine, i read them back correctly. So do i have to disconnect the cristal everytime i program the pic ? If so, what is the standard way to go if i have to reprogram many times ?

Once programmed, (conf bits are __CONFIG 0x2F41) there is no way to see the 4Mhz clock signal by the oscilloscope. No signal is generated. I've changed capacitors, nothing change.

I've used 2 capacitors 22pF and crystal configuration.
Is there some particular rules to respect when i build my oscillator on the prototype board ? Do it must stay near the pic, should the ground between 2 capacitors be connected toward some specific pin, instade of a random ground pin ? What are the fisical condition on the board to rispect for a well-done oscillator ?

By the way, i don't remember such difficult thing to get the oscillator running, i suspect there is still some bad programming issue.

Thanks all, every help is appreciated

angelo
 
I have programmed a 16F876A (28 pin version of 877) with a 20MHz crystal and caps connected during programming. I even had a watch crystal connected as the timer1 oscillator with no problem.

Maybe you should post your circuit.

Have you written the programming software yourself?

Mike.
 
spectrum said:
hello all,

i'm posting for some help on missing clock on 16F877A

First of all, i have some questions about the ICSP programming:

I've used ICSP programming algorithm 1, with 13V on MCLR.
Microchip says that this serial programming allow to program the microcontroller in the user circuit application. I've discovered that if there is a crystal resonator connected to osc1/osc2 the configuration bits programming fail, when i read the bits back i get 0x0000. Disconnectiong the crystal seems they are programmed fine, i read them back correctly. So do i have to disconnect the cristal everytime i program the pic ? If so, what is the standard way to go if i have to reprogram many times ?

You don't mention what programmer you are using?, a specific ICSP programmer (like the Inchworm/ICD2) gives full control of the MCLR pin, a non-ICSP programmer doesn't - this is why you're having to remove the crystal.

Once programmed, (conf bits are __CONFIG 0x2F41) there is no way to see the 4Mhz clock signal by the oscilloscope. No signal is generated. I've changed capacitors, nothing change.

Well you're setting XT, but also 'memory write' - is there any reason for that?.

You must use a x10 probe, or the capacitance will usually kill the oscillator.

The fact that you need to disconnect the crystal in order to program it, shows that the oscillator is running.

I've used 2 capacitors 22pF and crystal configuration.
Is there some particular rules to respect when i build my oscillator on the prototype board ? Do it must stay near the pic, should the ground between 2 capacitors be connected toward some specific pin, instade of a random ground pin ? What are the fisical condition on the board to rispect for a well-done oscillator ?

Keep the crystal and capacitors as close to the PIC as possible, and keep all leads short - check my tutorial hardware for an example.

By the way, i don't remember such difficult thing to get the oscillator running, i suspect there is still some bad programming issue.

Like I said above, if you're having to remove the crystal, then it's already running!.
 
Pommie,

my circuit for now is very simple, i've only mounted the pic for programming and testing clock, VDD and VSS connected to a 7805 output, clock oscillator between pin 13 and 14, a reset circuit on MCLR, that i disconnect during programming.

Nigel, Really thanks for those really precious helps,

Damned me, I'm sure i was testing with x1 probe!
I have a willem pcb3 programmer, with an icsp output.

Another strange thing is that i'm getting always "device not blank" on the blank check, but the buffer show all cleared (3fff)

Thanbks Angelo
 
spectrum said:
Pommie,

my circuit for now is very simple, i've only mounted the pic for programming and testing clock, VDD and VSS connected to a 7805 output, clock oscillator between pin 13 and 14, a reset circuit on MCLR, that i disconnect during programming.

Check my tutorial hardware for the minimum required, I'm presuming you have suitable capacitors on the regulator and PIC?.
 
Nigel Goodwin said:
Check my tutorial hardware for the minimum required, I'm presuming you have suitable capacitors on the regulator and PIC?.

Yes, all is working fine now, infinite thanks for the help.

Angelo
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top