CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

CLKO PIN during programming - oscillation

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
andresteff



Joined: 21 Mar 2020
Posts: 44

View user's profile Send private message

CLKO PIN during programming - oscillation
PostPosted: Wed Apr 28, 2021 5:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Apr 28, 2021 6:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Apr 28, 2021 9:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Apr 28, 2021 11:37 pm     Reply with quote

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....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group