{"id":50,"date":"2012-05-04T13:27:24","date_gmt":"2012-05-04T12:27:24","guid":{"rendered":"http:\/\/www.kanda.com\/blog\/?p=50"},"modified":"2021-01-14T11:37:00","modified_gmt":"2021-01-14T10:37:00","slug":"pic-in-system-programming","status":"publish","type":"post","link":"https:\/\/www.kanda.com\/blog\/microcontrollers\/pic-microcontrollers\/pic-in-system-programming\/","title":{"rendered":"PIC In-system Programming"},"content":{"rendered":"\n
PIC microcontrollers, like most modern microcontrollers, can be programmed in system (or in circuit – ICSP) rather than in a socket programmer. This has advantages in development and in production, for example, to use different firmware for different versions or to speed up production. The major benefit though is field upgrades. We can give you lots of horror stories about people who didn’t think of firmware upgrades and had to recall products to fix a bug, not a cheap option. So how do you add In System Programming to your designs?<\/p>\n\n\n\n
The major factors are the electronic design of the ICSP circuit and the ICSP connector format. Let’s look at the connector format first. Most Microchip development boards (and ICD2\/3 debuggers) use RJ11 connector by default, but this is a poor choice for field or production use.<\/p>\n\n\n\n\n\n\n\n
For a start, RJ11 is not a recognised standard, and is often called RJ12 instead! Trying to find RJ11 connectors on Farnell or Digikey is really difficult. All it defines is a connector format, like the familiar RJ45 network connector. There are two parameters that define the connector – the number of connectors or poles and the number that are actually connected. The RJ45 is actually pretty standard and it is always an 8 pole connector with all 8 connected, so it is called an 8P 8C connector.<\/p>\n\n\n\n
When we get to RJ11 or RJ12 everybody seems to have their own idea, and they can be 4 way like the common telephone jack or 6 way. They may have all the poles connected or not. So we get 4P 4C (telephone) or 6P 4C or 6P 6C. The one we need is a 6P 6C connector, which is what you need to search for with your suppliers.<\/p>\n\n\n\n
Even if we eventually find the right connector, they have a large footprint, are not especially cheap and many production and field programmers do not use this format anyway. Kanda programmers do have an optional RJ11 connector if you must use this format but we don’t recommend it. So, what do we do instead?<\/p>\n\n\n\n
Most PIC programmers come with 6-way flying leads, that are connected to a 6 x 1 standard 0.1″ (2.54mm) pin header. This is much cheaper, smaller and easier to use. The flying leads from the programmer can be connected together in the right order or replaced with a 6 x 1 shroud when the pin order has been defined.<\/p>\n\n\n\n
Microchip ICD2 type emulators have a connector available that converts the RJ11 type interface into 6 x 1 pin header format and your best bet is to use this and design your PCB with this connection from the start.<\/p>\n\n\n\n