1
\$\begingroup\$

I have a PIC16 that is not connected to an external clock. If I program the PIC with the FLAG setting the clock to an external clock, then will I ever be able to reprogram the PIC?

Is the programming clock the one specified by the flags, or is it an external one provided by the programmer (PICKIT 3)?

\$\endgroup\$
2
\$\begingroup\$

Programming is clocked by the PGC line of the programmer, which is completely independant of the clock used when the PIC is running.

\$\endgroup\$
2
\$\begingroup\$

During programming (writing the HEX file contents into the PIC's non-volatile memory), the programmer supplies whatever clocking is needed for the programming logic in the PIC. During programming, data is transferred over a synchronous serial interface called the PGC (programming clock) and PGD (programming data) lines. The programmer will also need to control MCLR and in some cases Vdd.

If the PIC's oscillator were required for programming, then it would be impossible to program it in external oscillator mode without that oscillator running and hooked up. That would clearly be undesirable, and is not how it works.

For a brief introduction to this process, and some circuit design issues associated with it, see my In-Circuit Serial Programming intro. For detailed information, see the programming spec for your PIC.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.