Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 23rd November 2007, 09:25 AM   (permalink)
Default ICSP and 16F877A help

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
spectrum is offline  
Old 23rd November 2007, 10:12 AM   (permalink)
Default

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.
Pommie is online now  
Old 23rd November 2007, 10:19 AM   (permalink)
Default

Quote:
Originally Posted by spectrum
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.

Quote:

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.

Quote:

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.

Quote:

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!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 23rd November 2007, 10:32 AM   (permalink)
Default

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 is offline  
Old 23rd November 2007, 10:53 AM   (permalink)
Default

Quote:
Originally Posted by spectrum
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?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 26th November 2007, 09:48 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
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
spectrum is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
ICSP Programming 16F877A w/ Velleman Programmer bytter Micro Controllers 36 29th October 2006 03:14 PM
16F877A ICSP Beefer3 Micro Controllers 2 10th March 2004 06:52 AM



All times are GMT. The time now is 05:37 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker