View previous topic :: View next topic |
Author |
Message |
andresteff
Joined: 21 Mar 2020 Posts: 44
|
CLKO PIN during programming - oscillation |
Posted: Wed Apr 28, 2021 5:52 am |
|
|
Hi,
I have a problem with CLKO pin during program the PIC.
At the PIC24F16KA301, it is pin 8, with these features:
"OSCO/AN14/C1INA/C2INC/CLKO/CN29/RA3".
I use this pin only as output. A buzzer is attached to this pin.
When i program the PIC, the buzzer goes on! I measure the pin with scope and there many oscillations during programming.
Why? Please help me!
Many greetings.
CCS Version: 5.080 with IDE
PIC: PIC24F16KA301
ICD3 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Wed Apr 28, 2021 6:45 am |
|
|
Quite a few of the PIC's do this.
When you are programming, the chip is actually clocked from the PGEC pin.
So the clock you see will be the inverse of what is coming in on this pin.
The enable for this is 'on' when the chip is erased, and functions when the
oscillator is disabled (which it is during programming). So basically during
programming you will see this. You will need to design your hardware to
cope with the signal being there. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Wed Apr 28, 2021 9:57 am |
|
|
Years ago I decided to dedicate the ICSP pins for only ICSP purpose. it has saved to problem on how to isolate ICSP pins from 'peripheral' uses, like your buzzer. Yes, you can add 3 pins and a jumper, or a spdt switch or some other form of isolation but that costs time,materials,board space and you MUST remember to program the jumpers for either 'programminmg' or 'product use'........
It's been easier and cheaper to use bigger PIC. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Wed Apr 28, 2021 11:37 pm |
|
|
He is not seeing a problem with the ICSP pins. His is with the chip's CLKO
pin generating a signal during programming.
I've seen this on a couple of PIC's (only specific versions). On most the
chip clocks off the programming clock, and no output is generated. But
there seem to be a few, that default to generating this clock output. It makes
a 'sort of sense', when you realise that CLKO is enabled on an erased chip,
and on these chips is generated when the chip is running off most clock
sources.
Interestingly the data sheet on most chips that don't do this usually has a
note "Always associated with OSC2 pin function.". on CLKO. On his
chip instead it shows CLKO as connected to the CPU clock in the oscillator
diagram, and the data sheet says that "this output is active when the primary
oscillator is disabled or when it is set to EC mode". The key point is that it
still works when the primary oscillator is disabled on this chip. Hence his
problem.... |
|
|
|