9
\$\begingroup\$

Previously, I was working with PIC16 and PIC18 series, and none of them provided multiple channels for programming. Now, I am designing my first PIC32 circuit, and I'm very confused with these multiple programming/debugging channels.

Why are there more than one of them? As far as I know, programming is a special event, and it is done when doing firmware update, or during development stage, or just after manufacturing process. Neither of these cases require more than one programming channels. Why do they provide 3 or 4 channels for this? I want to leave ICSP pins in my circuit for programming; can I choose either of these channels, or must I prefer a certain one?

enter image description here
enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ The PIC18F4455/4550 also has shared as well as exclusive programmimg pins! However, the exclusive pins are more or less useless because you have to activate them first via config bits, i.e. you have to use the shared pins for this... This applies for the TQFP44 only, the QFN44 surprisingly has another pinout and lacks this dedicated pins. But in principle, dedicated programming pins are also available in the PIC18 family. \$\endgroup\$
    – sweber
    Mar 26, 2015 at 16:01

2 Answers 2

11
\$\begingroup\$

This is not limited to the PIC 32. There are other PICs with multiple pairs of PGC/PGD too.

The reason is to give you a choice of what other pin functions will be unavailable during debugging or if you dedicate a pair of pins to programming. Note all the other functions of those pins.

\$\endgroup\$
5
  • \$\begingroup\$ Do you also happen to know how are they internally connected? I'm guessing the programming hardware is not triplicated so there is some sort of mux maybe set by a couple of fuses. Or is it different? \$\endgroup\$ Mar 26, 2015 at 17:20
  • 1
    \$\begingroup\$ @Vlad: I have no special knowledge of how this works inside. I expect there is a mux for debugging. For programming, I think any of the pairs works, so there is probably some kind of ORing going on. \$\endgroup\$ Mar 26, 2015 at 18:19
  • 1
    \$\begingroup\$ Last year, I used a PIC24EP128GP206 in a project. I needed a full 16-bit port to write to a peripheral. There was only one fully populated port on this chip -- PORTB. In their infinite wisdom, Microchip located all three programming ports sharing the same pins as PORTB (RB2/3, RB5/6, and RB0/1). Which made it impossible to single-step through the code that worked with said peripheral. What irked me as much, was PORTC had 15 bits populated -- only RC14 was missing. Otherwise there would have been two 16-bit ports and I wouldn't have had the issue. Arrgh. I like Microchip. but ... \$\endgroup\$
    – tcrosley
    Mar 26, 2015 at 21:45
  • \$\begingroup\$ @tcrosley maybe you could pick another part... of a different manufacturer if necessary \$\endgroup\$ Mar 27, 2015 at 8:58
  • 1
    \$\begingroup\$ @VladimirCravero I chose a PIC24 (for code compatibility and cost reasons) at 70 MIPS in a 64-pin package. That was the smallest part we could get away with. It was a slave to a PIC32 running at 80 MIPS in a 100-pin package, via shared memory. Didn't want to use two PIC32s. Everything worked okay, as we lucked out with most of the PORTB peripheral code running right off the bat. \$\endgroup\$
    – tcrosley
    Mar 27, 2015 at 9:28
5
\$\begingroup\$

PGECx and PGEDx pin pairs are multiplexed for programming and any pair will work.

See DS61129F:

33.2.1.1.1 ICSP Interface ICSP uses two pins as the core of its interface. The programming data line (PGD) functions as both an input and an output, allowing programming data to be read in and device information to be read out on command. The programming clock line (PGC) is used to clock in data and control the overall process.

Most PIC32 devices have more than one pair of PGECx and PGEDx pins, which are multiplexed with other I/O or peripheral functions. Individual ICSP pin pairs are indicated by number, such as PGEC1/PGED1, and so on. The multiple PGECx/PGEDx pin pairs provide additional flexibility in system design by allowing users to incorporate ICSP on the pair of pins that is least constrained by the circuit design. All PGECx and PGEDx pins are functionally tied together and behave identically, and any one pair can be used for successful device programming. The only limitation is that both pins from the same pair must be used.

In addition to the PGECx and PGEDx pins, ICSP requires that all voltage supply (including the voltage regulator pin, ENVREG) and ground pins on the device must be connected. The MCLR pin, which is used with the PGECx pin to enter and control the programming process, must also be connected to the programmer.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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