Introduction

IC-Prog is a Windows based software to control a development programmer for PIC microcontrollers. To operate this software, a basic knowledge about electronics and Windows is necessary.

In order for this software to operate you have to attach a programmerProgrammer_hardware to your computer and set up the hardware & software appropriately. Please note, that because of differences in programmers, the software might not work on some combinations of programmer hardware and PC’s.

IC-Prog requires Windows 95, 98, ME, NT, or 2000 and an internal or external math coprocessor to operate. All processors that are upwardly compatible with 386 processor with 8Mb of ram should work.

IC-Prog is copyrighted but free software. It is OK to copy and distribute this software as long as it is not modified in any way, being charged for, or used for illegal purposes.

IC-Prog has been designed as a universal programming application for all programmers. Please contact the author if you have a programmer that you would like to be supported by IC-Prog.

The author will not take any responsibility for direct or indirect damage caused by this software. If you use this software, you use it completely at your own risk.Background


IC-Prog Prototype Programmer

IC-Prog is a windows based programmer that enables the programming of many devices and supports a number of programmer types.

See Supported Devices for a current list of supported devices. Click here to see al list of successfully verified devices.

See Supported Programmers for a current list of supported devices.

Both driving the programmer hardware by Direct I/O or the Windows API is supported.

Commandline parameters may be supplied in order to use IC-Prog from within your own program or external compiler etc.


Install programmer hardware

Plug the programmer into a port (serial or parallel). Ensure that any switches on the programming device are configured to the manufacturers recommendations for the interface to be used.

Insert chip or Smartcard

PIC’s are sensitive to ESD (electrostatic discharge), make sure that you have discharged yourself and your environment before you take the chip away from its protective foam or packaging.

Make sure that all pins go straight into the programming socket before you carefully insert the chip. Chip pins are easily broken. If you are doing development work that calls for frequent reprogramming, it may be a good idea to use a carrier socket to take the wear and tear out of the PIC. Ensure that any switches on the programming device are configured to the manufacturers recommendations for the device to be programmed.


General

The main area of IC-Prog shows the information that needs to be programmed into the specified device. All devices at least have a Code area where information can be stored. Devices like eeproms only have this Code area.

Other devices like most microcontrollers have additional storage areas, like the Data area. Normally the Code area contains code that will be executed by the microcontroller and the data area contains some fixed data like tables for calculating etc.

Most microcontrollers, like PIC, have a Configuration area as well. This configuration information will configure the microcontroller with some initial settings at bootup.

This configuration information is different and unique for each microcontroller, and specific information can be found in the microcontroller’s datasheet.

Main view :

Main view

IC-Prog intends to display the information in all areas in such a way, that it is easy to see what the information means. The Code and Data area will display the information in hexadecimal values and character values: The left part of the Code and Data area contains the address on which the information is stored. The middle part contains the information in hexadecimal values and the right part contains the SAME information, but displayed in character values.

Each row in the Code area will display 8 words. So each row the address will be incremented with 8. A word is normally 16 bits wide so IC-Prog will show 0000 to FFFF as a hexadecimal value. Some devices only have 14 bit, 12 bit or 8 bit words, so the maximum hexadecimal value will be 3FFF, 0FFF or 00FF, but IC-prog will always display a hexadecimal value using 4 digits. The character values only use the lower 8 bits of the 16 bit data word, because the standard character range only runs from 0 to 255 (8 bits).

Code area :

Code area

Each row in the Data area will also display 8 words, but these words are by default always 8 bits. They will always be displayed as 2 digit hexadecimal words with a minimum of 00 and a maximum of FF.

Data area :

Data area

The configuration area of device (if a device has one) will be shown with easy understandable elements, such as drop down combo boxes and checkboxes. The user can easily select the desired configuration, and IC-Prog will calculate the according configuration word. This calculated configuration word is also displayed at the bottom of the configuration area.

These configuration elements are device specific, and so this configuration area will look different for each selected device. Look at the device’s datasheet to find specific configuration information.

Configuration area :

Often a specific configuration element can only be enabled or disabled. This results in IC-Prog calculation a zero for a specific bit in the configuration word or a one. This can be the other way around if a specific configuration element is inverted inside the device. IC-Prog automatically inverts a configuration element if this is needed. To enable a configuration element, place a mark in the checkbox. To disable a configuration element, remove the mark from a checkbox.

Configuration area

Some devices have so much configuration elements; the configuration area cannot contain them all. Then IC-Prog will create a second (or a third) configuration area, which you can select by using the arrows in the upper right corner of this area. If a device has only 1 configuration area, then these arrows will be disabled. If a device has more configuration areas, then you can walk through them using the arrows.

When you select a device from the menu, IC-Prog will automatically determine the device type and adjust the main view. All devices have a Code area at least, so this part of the main view is always visible. Some devices (like eeproms) do not have a Data area, so IC-Prog will not show this area. Instead it will extend the Code area to get a full view. Some devices also don’t have configuration information, and IC-Prog will leave it blank. Only the checksum value will be visible.

Standard operations:

Normally, a user will simply open a file and then program it in the device.

To open a file, go to menu File and choose Open File…

Now you will get a standard “Open File” dialog.

IC-Prog will default to the “Any file (*.*)” filter, so all files can be seen.

Simply select the desired file and click open.

When you have opened a file, you will see the information from the file displayed in the Code, Data and Configuration area (if the choosen devices has these areas).

You can also manually change the information inside the Code, Data and Configuration area.

(The Code and Data areas are referred to as buffers.)

This can be done in several ways :

· Just type in the buffer areas. If you enter a value that exceeds the word size of the device then IC-Prog will automatically change it. So if you type FABC and you have a 14bit PIC then IC-Prog will change the leading F into a 3, which results in 3FFF. You can also type in the character area. The character value will be placed in the lower part of the word. For example if you type ‘A’ then the word value will become 0041 hexadecimal, which equals to 65 decimal.

· Double-click on a location. You can enter a decimal, hexadecimal or character value.

· Using the Edit menu. You can fill the entire buffer with a single value, fill the buffer from and to a specific point with a single or you can paste text from the clipboard to the buffers.

· Using the right mouse button. The same options as from the Edit menu will appear.

How to use a Phoenix Programmer :

The first thing you need to do is correctly configure your Phoenix settings.


How to install IC-Prog

Configure IC-Prog

IC-Prog has been designed to work with a number of programming devices.

The programming device and a number of settings may be selected using the Settings/Hardware menu option.

Interface

IC-Prog may drive the programming device using direct port access, or via the Windows API (Application Programming Interface).

Use of the API option is only supported for the serial port. Use the Windows API under Windows NT.

Use of the parallel port is currently not supported for NT and Windows 2000. Use of the parallel port under NT or Windows 2000 will probably give a "Permission" error.

Communication

The following signals may be inverted

  • Data Out
  • Data In
  • Clock
  • MCLR
  • VCC
  • VPP

Process Priority

  • Normal
  • High
  • Realtime

Process Priority enables IC-Prog to provide more accurate programming timing pulses. However, setting the Process Priority to High may make windows run slowly due to the CPU dedicating more processor time to IC-Prog instead of other processes.

change I/O Delay

The faster the computer, the higher I/O delay should be. Normally (e.g. a PIII 650) an I/O Delay of 4 is sufficient.


Open File

This function loads the code and data buffers from the file selected. IC-Prog supports both 8-bit and 16-bit Intel hex files, object files, and binary files.

Note that some assemblers might generate hexfiles with nonstandard file extensions. In such cases, you have to select the “All Files” filter to be able to find the file. If the hex file does not include fuse information defaults for the appropriate device will be used.

You have to explicitly tell IC-Prog, which filetype you want to open.

Currently supported filetypes:

· IHX8 (*.hex, *.h8, *.sxh)

· IHX16 (*.hex, *.h16, *.sxh)

· Binary (*.bin)

· Object (*.obj)

· Motorola S (*.mot, *.s19)

· Eeprom files (*.e2p, *.eep)

· Any file (*.*)

The “Any file (*.*)” filter can AUTODETECT which file it is.

IC-Prog defaults to “Any file (*.*)”

If you have problems opening a file with “Any file (*.*)”, try and choose a specific filetype.

“Any file (*.*)” can detect the following filetypes: IXH8, IHX16, OBJ, Motorola and binary. n.b. e2p,eep files cannot be detected unless they are actually IHX files - this also applies to the “Drag & Drop” parameters in the Options menu.

ALT+F1 is a shortcut to open the last opened file


Save File As

The Save File As command will save the buffer contents to a hex file. The file will include program and data memory, configuration fuses and ID locations.


Open Data File

This function loads the data buffer from the file selected.


Recent Files

This command displays a list of the last eight recently used files.


Print

This command prints the data for the selected buffer.


Fill Buffer

This function will fill the code buffer with a single value. The value may be defined decimal, hexadecimal, or ascii.


Fill Buffer

Fill Buffer From

This function will fill the code buffer with a single value between a range of addresses. The value may be defined decimal, hexadecimal, or ascii.


Fill Buffer

Copy From Buffer

This function copies the selected data into a scratchpad area.


Fill Buffer

Paste To Buffer

This function pastes from the scratchpad area to the buffer at the current position.


Fill Data Buffer

This function will fill the data buffer with a single value. The value may be defined decimal, hexadecimal, or ascii.


Fill Data Buffer From

This function will fill the data buffer with a single value between a range of addresses. The value may be defined decimal, hexadecimal, or ascii.


Fill Buffer

Copy From Data Buffer

This function copies the selected data into a scratchpad area.


Fill Buffer

Paste To Data Buffer

This function pastes from the scratchpad area to the data buffer at the current position.


Active Buffer

This function allows the selection of a buffer.


Compare

This function allows the comparison of the current buffer with another.


Fill Buffer

Device

This function allows the selection of a device to be programmed.


Recent Devices

This command displays a list of the last eight recently used devices.


Hardware

This command enables the IC-Prog to be configured for the hardware that is to be used.

The type of hardware, interface, port, and communication parameters may be defined in this function.


Hardware Check

This command checks the hardware that is connected to IC-Prog.


Options

The following options may be amended by this command:

· Drag & Drop

· Smartcard port & device type (16F84 or 16C84)

· Language to be used

· Shell Extension

· Miscellaneous

· Confirmations

· Notifications

· I2C

· Programming

  • Shortcuts

A configuration page is provided for each of the above options.

Confirmation page:

When you want IC-Prog to do an action, it can ask you for a confirmation first.

This is to ensure that you don’t erase a device by mistake.

There are 4 actions, which can be required to ask you for a confirmation:

  • Programming a device
  • Erasing a device
  • Codeprotecting a critical device
  • Overwriting a file

Codeprotecting a critical device: Some devices are “One Time Programmable”. This means that you can only program them ONE time. So when you codeprotect such an device, you cannot read it back anymore and you cannot erase it anymore. If the code inside is wrong then you can throw this device away. This option makes sure that such a device will NOT be accidentally codeprotected, unless you explicitly ask for it.

Notification page:

IC-Prog can notify you of some events. There are currently 2 notifications:

  • When ID word is missing in the loaded file
  • When Configuration word is missing in the loaded file

When the ID or Config word is missing from the file, their values will default to FFFF.

In order to make you aware that the loaded value is not FFFF, but is simply missing, you can enable these options

I2C page:

On this page you can configure some options that relate to I2C devices (e.g. the 24Cxx family).

Enable MCLR as VCC : When reading/programming 24Cxx devices with a “ludipipo” interface the MCLR needs to be high. The reason why MCLR needs to be high is as it is used to create the supply voltage (VCC).

Enable Page-Write : Normally a 24Cxx device can be programmed in 2 ways: Bytewrite and Pagewrite. Pagewrite is recommended because it is a lot faster, however not all devices do support this feature. Therefore if you have a device that does NOT support pagewrite then disable this option. Otherwise this option should be left enabled.

Hardware Address : When reading/programming 24Cxx devices you need to address them. Three input pins on 24Cxx devices configure the address. These input pins (A0, A1, and A2) are normally connected to GND (done in the programmer socket), so the default hardware address is 0. But if you need to program a 24Cxx while it is inside a circuit, then the hardware address input pins may be connected to VCC as well, and so the hardware address will have a different value. This option enables you to change the hardware address to the corresponding value.

Programming page:

You can tell IC-Prog to verify the device:

  • AFTER it has been programmed
  • DURING the programming phase

Only PIC programming supports the verify during programming!

By default IC-Prog will first program a device, power it off and on again, and then start to verify. This way IC-Prog ensures that the device is properly programmed.

If a PIC microcontrollers is codeprotected the programmed information cannot be read back anymore and the verify routine will fail.

If you choose “Verify during programming” then each programmed word will be verified at the same time, before the codeprotection is applied. This enables you to codeprotect a device and verify it in the same routine.

Shortcuts page:

In IC-Prog you can use 4 pre-defined shortcuts: CTRL+F1, CTRL+F2, CTRL+F3 and CTRL+F4 for devices. This page enables you to assign a specific device to each shortcut.

Drag & Drop page:

IC-Prog allows you to drag and drop files from Windows explorer to the Code area or the Data area. You should select a specific filetype for each area. You can also use the “Any file (Auto)” type. This type will AUTODETECT the filetype. (More info can be found in the Open File section).

Smartcard page:

IC-Prog supports “Phoenix” compatible programmers. However, because a “Phoenix” programmer is actually not a programmer, it is not listed in the Hardware menu. On this page you can configure your smartcard settings.

Port : Choose the serial port to which your Phoenix interface is (will be) connected.

Invert Reset: The reset signal going to your Phoenix can be inverted. This is needed when your Phoenix interface itself inverts this reset signal. So IC-Prog inverts the reset signal and the Phoenix interface inverts this reset signal again (thus returning the reset signal to a normal value). Phoenix Programmers that have an inverted reset are often called “Smartmouse” programmers.

Protocol : IC-Prog currently supports 2 types of bootloader : Multimac compatible and Secanix compatible. Please select which bootloader communications IC-Prog needs to use.

Device : IC-Prog needs to know which device it needs to program in the Smartcard Wizard. This normally is 16C84 or 16F84. Please select the device which is on your card.

Frequency : The Phoenix interface is normally be equipped with two crystals - 3.58Mhz and 6MHz. Please choose the crystal that you wish to use.

Language Page:

IC-Prog supports a number of different languages. Please choose the desired language from the combo box. Some languages require characters that are located in a different character set. IC-Prog automatically uses the correct character set, but not for menus. This is standard behavior. If you wish the menus to be displayed correctly in a selected language, you will need to change the SYSTEM font to use the desired character set. This can be done in the Control Panel.

Shell Page:

The page enables IC-Prog to be associated with file extensions. This means that you can double-click on a file in Windows Explorer, and then it will be opened by IC-Prog. You can also use the right mouse menu from Windows Explorer. Selecting the check box on this page enables the use of the Shell extension.

Misc. Page :

This is the miscellaneous page. Here you can configure some additional options that couldn’t be placed on other pages.

Process Priority: All applications in Windows can define a priority level. Normally the priority level of an application is NORMAL. If the timing of IC-Prog needs to be more accurate then you can use a higher priority. Note: Making this priority to high may slow your Windows down, or slow down other applications. If you do not need more accurate timing, then please set this option to NORMAL.

Enable NT/2000 Driver : IC-Prog normally uses Direct I/O access to communicate with different programmers. Windows NT/2000 does NOT allow Direct I/O access, and will normally raise an error “Privileged”. This special driver enables IC-Prog to use Direct I/O on Windows NT/2000 systems. Please make sure the the driver “icprog.sys” is placed in the same directory as “icprog.exe”. If you enable this option, then IC-Prog will install the driver.

Enable VCC control for JDM : Normally JDM (compatible) programmers cannot control VCC. This means that the power supply is always on. Some PIC microcontrollers cannot be programmed correctly without VCC being toggled. This option allows IC-Prog to control the VCC on JDM Programmers. This option is not guaranteed to work and is therefore experimental and only for advanced users. Please do not use this option, because it can fail programming of other types of devices.

Make all outputs high (Combi) : There are some special programmers who have a parallel (LPT) and a serial (COM) interface. In order for these ports to work together correctly, the parallel interface needs to be high in the not used state. Normally IC-Prog leaves the LPT port as it is, but this option makes sure that IC-Prog places the LPT pins in the HIGH state.

The use of this option means that you don’t have connect/disconnect the programmer if you want to switch to the LPT or COM port.


Smartcard (Phoenix)

Selecting the Smartcard (Phoenix) option will enable IC-Prog to use Phoenix hardware (via a suitable loader program) to program the eprom on a Smartcard.

n.b. This can only be used with a serial port, because the communication is standard asynchronous communication (Phoenix).


Clear Settings

This command will clear all the settings in IC-Prog to the default state.


Read All

This command will read the chips data into memory. The fuses will be set from the chip. If the chip is copy protected (indicated by CP being ticked on the screen), you will end up with garbage values in the buffer.

When you read a code protected chip (CP) you may read different values. The 16C84 reads all 7F's. Other devices read 00's and AVR read 11,22,33, etc. It's not possible to detect that an AVR (90xxx) or 89xxx is code protected. You can only detect that by the values read. So the fuse bits for 90xxx are NOT reset when reading a device.


Program All

The Program All command will program the chip with the contents of the buffer. The buffer may have been filled through the Open File function or through the reading of an already programmed chip. This function also programs the chip with the configuration displayed on the screen.


Program Config

The Program Config command will program the chip with the configuration displayed on the screen.


Erase All

This command will erase the contents of the chip.


Blank Check

The Blank Check command will read the contents of the chip and confirm that it is blank.

n.b. a blank device will read al FFFF’s, when a device is filled with al 0000’s it is NOT blank.


Verify

This command will verify that the contents of the chip correspond to the contents of buffer held in IC-Prog.


Smartcard Wizard

The Smartcard Wizard will program a Smartcard with a BootLoader that will enable through pic programming of the eeprom. The eeprom file may be selected during this process.


CRD Upload

This command enables the upload of a CRD.


Assembler

This command will display the data in the form of assembler code.


Hex View

This command will display the data in the form hexadecimal codes.


Device Position

This command will display the position of the device in the selected programmer.


Device Information

This command will display details of the device to be programmed.


Refresh

This command will refresh the display.


About

This command displays the version and contact information for IC-Prog.


Supported Programmers

The following programmers are supported by IC-Prog:

  • JDM Programmer (Ludipipo)
  • Conquest programmer
  • TAFE Programmer
  • TAIT 'Classic' Programmer
  • Parallel TAIT programmer
  • Fun-card Programmer
  • SCHAER Programmer
  • ProPic II Programmer
  • STK200 Programmer
  • AN589 Programmer
  • WILLEPRO Programmer
  • Fluffy Programmer
  • DL2TM Programmer


Programmer Specific Information

JDM Programmer

  • When programming 24Cxx with JDM Programmer, please disconnect pin 7 (WP) of the eeprom from the socket and connect it to GND
  • Please do NOT use the option "Enable VCC control for JDM" This option is experimental and NOT for common use! Please disable it!


Supported Devices

The following devices are currently supported:

4-Wire eeproms:

59C11, 59C22, 59C13

I2C eeproms:

24C01, 24C02, 24C04, 24C08, 24C16, 24C32, 24C64/65, 24C128, 24C256, 24C512
PCF8572 or 8572 = 24C01
PCF8582 or 8582 = 24C02
PCF8592 or 8592 = 24C04
SDE2516 = 24C??
SDE2526 = 24C??
SDA2546 = 24C??
SDA2586 = 24C??
SDA3546 = 24C??
SDA3586 = 24C??

24LC21 = 24C01 ( Pin7 (VCLK) must be connected to VCC !!)

All C and LC series are supported. The CS series is not supported yet!

Please connect pin7 of the 24Cxx to GND! Please connect pin7 of the PCF to VCC!

Flash Microcontrollers:

89C1051, 89C2051, 89C4051

IM-Bus eeproms:

NVM3061
MDA2060, MDA2061, MDA2062
Still experimental!

Microchip PIC devices:

12C508, 12C508A, 12C509, 12C509A, 12CE518, 12CE519
12C671, 12C672, 12CE673, 12CE674
16C433
16C54, 16C56
16C61, 16C62A, 16C62B, 16C63, 16C63A, 16C64A, 16C65A, 16C65B, 16C66, 16C67
16C71, 16C72, 16C72A, 16C73A, 16C73B, 16C74A, 16C76, 16C77
16C84, 16F83, 16F84, 16F84A
16C505
16C620, 16C621, 16C622, 16C622A
16F627, 16F628 Pull RB4 to GND
16C715
16F870, 16F871, 16F872, 16F873, 16F874, 16F876, 16F877 Pull RB3 to GND
16C923, 16C924

Microwire eeproms:

93C06, 93C46, 93C57, 93C56, 93C66, 93C76, 93C86
93C13 = 93C06
93C14 = 93C46
All C and LC series are supported. The CS series is not supported yet!

Modern Serial eeproms:

AK6420, AK6440, AK6480
BR9010, BR9020, BR9040, BR9080
Still experimental!

Scenix devices (rev5.2 only):

SX18AC, SX28AC
Still experimental!

Spi eeproms:

25010, 25020, 24040
25080, 25160, 25320, 25640

Spi Microcontrollers:

90S1200, 90S2313, 90S2323, 90S2333, 90S2343
90S4414, 90S4433, 90S4434, 90S8515, 90S8535
89S53, 89S8252


Verified Devices

Succesfully programmed devices:

JDM PROGRAMMER

- 24C01, 24C02, 24C04, 24C08, 24C16

- 24C32, 24C64/65, 24C256

- 59C11

- 93C46, 93C06, 93C66

- PIC 16C84, 16F84, 16F84A

- PIC 16C71, 16C72

- PIC 16C64A

- PIC 12C508, 12C508A, PIC12C509, 12CE518

- PIC 12CE674

- PIC 16C505

- PIC 16F872 (It is important to pull Pin PB3 of the 872 Low while programming it ( the first time prior disableing LVP mode ))

- PIC 16F877, 16F876, 16F874, 16F873

- PIC 16C715

- AT90S8515

- AT90S2323

- 25020

- 89S53

CONQUEST PROGRAMMER

- 24C16

- PIC 16F84

TAFE PROGRAMMER

- AT89C2051

TAIT SERIAL PROGRAMMER

- 24C16, 24C32, 24C64/65

- PIC 16C84, PIC16F84, 16F84A

- PIC 12C508, 12C508A, 12C509, 12C509A

- PIC 16C622A

- PIC 16F873, PIC 16F874, PIC 16F876

- PIC 16C622A, PIC 16C63A, PIC 16C66

TAIT Parallel Programmer

- 16C54

FUN-CARD PROGRAMMER

- AT90S1200

- AT90S2313-10PI

- AT90S2323-10PI

- AT90S2343-10PI

- AT90S8515-8PI

SCHEAR Programmer

- 16F873

- 16F84, 16F84A

- 24C16, 24C32

STK200 Programmer

- 90S1200

- 90S1200A

- 90S2313

- 90S8515

ProPic II Programmer

- (Propic I : 12C508A and 16F84)

- 12C508A, 16F84, 16F84A

- 24C04, 24LC16

- 12C509A

- PIC16F870 , PIC16F872, PIC16F873 , PIC16F876, PIC16F877 Need Rb3 connected GND!!! OK.

- 93C06, 93C46 (Adapter needed)


Command Line Options

Start IC-Prog with the following command line:

IC-Prog Option1 Option2 etc.

Options:

-p Program device

-v Verify device

-r Read device

-I Mainform invisible

-x Enable smartcard (Through Pic Programming)

-t00 Device type (00 can be any valid device) //NOT CHECKED!

-g00 Programmer type (00 can be any valid programmer) //NOT CHECKED!

-o0 Port type (0 can be any number 1-4, which corresponds to either LPT or COM) //NOT CHECKED!

-lFILENAME Load a file (Currently only IHX8 files can be loaded)

-sFILENAME Save file as FILENAME (Currently only IHX8 files can be saved)

-q Quit after last command

-fxxxx Fuse word = xxxxh

-ft? Selects a specific filetype: 0 = Any file, 1= IHX8, 2 = IHX16 etc.

The value 0 is used by default ("Any file")

Example: IC-Prog ltest1.hex -p -v -i -f3EEA -q

The test1.hex will be loaded. Then it will be programmed. You still get the message 'Do you want to program?'.

Afterwards the device will be verified. You also get the message box 'Verified successfully'.

When IC-Prog is finished it is automatically closed and the mainform isn't visible at all.


Buffer Editing

There are different ways to edit the buffers:

· Just type in the buffer areas. If you enter a value that exceeds the word size of the device then IC-Prog will automatically change it. So if you type FABC and you have a 14bit PIC then IC-Prog will change the leading F into a 3.

· Double clicking on a location. You can enter a decimal, hexadecimal or ASCII value.

· Using the Edit menu. You can fill the entire buffer, fill the buffer from and to a specific point.

  • Using the right mouse button. The same options as above will be seen.


PIC Information

The best source of information on the PIC is the Internet. On the Internet you will be able to find FAQ:s (Frequently Asked Questions), specifications, application notes, assemblers, simulators, programs, experiment boards and much more.

Some links are detailed below. Should these links be outdated try using one of the search engines that are available on the Internet.

Home of IC-Prog:

IC-Prog Software

Email :

bgijzen@wanadoo.nl

David Tait´s Pic Links:

http://www.man.ac.uk/~mbhstdj/piclinks.html

Microchip Technology:

http://www.microchip.com/

WinPhoenix:

http://www.thoic.com/decrypt/


Smartcards

Smartcards (Wafercards)

Original Smartcards were based upon a single PIC, newer cards are based upon at least one PIC and an Eeprom to provide additional memory.

A typically a Gold card contains a 16x84 + 24LC16.

The 16x84 PIC may either be a 16C84 or the newer 16F84.

The 16x84 is the processor, the 24LC16 is the Eeprom.

· The 24LC16 is a 16K bit (2K Byte) EeProm (256x8x8 bits).

· The 16x84 has 1024 bytes of code and 64 bytes of data area.

Oscillator selection

XT Crystal oscillator mode (standard)

The full list is:

· LP Low power oscillator mode

· XT Crystal oscillator mode (standard)

· HS High Speed oscillator mode

· RC Resistor/Capacitor mode

WDT (Watchdog timer)

Always off

PWRT (Power on reset)

ON for 16C84

OFF for 16F84

The PWRT bit meaning is inverted for 16C84 vs 16F84 devices. Therefore if you declare a chip to be a 16C84 in IC-Prog and load a hex image (from a file or chip), then declare it to be a 16F84 and reload you will see that the PWRT status inverts.

RB6 vs RB7

RB6/RB7 identifies the pin of the PIC that is used to communicate to the Smartcard pad (MultiMac Gold Cards typically use RB7). Hex files for the PIC may come in two flavours (RB6, RB7, or both) it is important to select the correct Hex code to match the Smartcard.

Gold Smartcard (Wafer Card)

Single PIC Card Connections

Single PIC with EEProm Card Connections

Through PIC Programming

Direct programming of the Eeprom is not possible with some Smartcards as the Eeprom chip is not connected directly to the pads on the Smartcard. Programming the Eeprom through the PIC is used in this case. IC-Prog supports “Through PIC Programming” providing the programmer used has the capability to program Eeproms. If this is not the case a Phoenix or Smartmouse programmer will be required to program the Eeprom.


Credits

IC-Prog author : Bonny Gijzen

Helpfile author : Paul Walton

Laguage support :

· Spanish Jose from ZdS electrónica

· French Richard Klein at www.varicap.com/

· Portuguese Gil for translating and Fernando Carvalho for the initial (Brazilian) translation

· Dutch Wilfred de Wolf

· Italian MM9800 and Pleaser at freesat.cjb.net

· Russian Sergei and Alex Kokaiko

· Greek Con Tanidis

· Polish Rajmund Komosinski

· Turkish Ayhan

· German Christoph Heitkamp

Sections of this helpfile have been based upon a help file created by Tord Andersson.


Through Pic Programming

How to put use "Through Pic Programming" to put Seca/Mediaguard or Irdeto onto a PIC/wafer-card

v1.0
Sept/2000
by 2old4this
============

Background and disclaimer
-------------------------
Since March/2000 software and methodologies have been published on the Internet which allow "old-fashioned" Multimac-type cards (previously used for D2MAC) to be reprogrammed for free reception of digital Irdeto/Betacrypt and Seca/Mediaguard encrypted channels.
This document has been prepared using that information (which comes from unknown sources).
Anyone wishing to make use of this information to avoid payment of fees to pay-tv providers should be aware that such practises are illegal across the whole of the European Economic Community, regardless of whether or not a subscription to the desired channels can be obtained in a particular country. The author of this document in no way condones such activities nor accepts any responsibility for the use of this information for anything other than educational purposes.

Quick step-by-step reference
----------------------------
1) use h/w device like JDM + IC-Prog to write Loader/Boot/Main file xxx.HEX to 16F84 PIC
2) use h/w device Phoenix + IC-Prog to write Seca/Irdeto keys file yyy.BIN to 24c16 EEPROM
3) use h/w device JDM + IC-Prog to write Seca/Irdeto pgm file zzz.HEX to 16F84 PIC

Requirments
-----------
* Windows PC with COM port & cable (e.g. COM1 port and the same serial RS232 cable used to connect your PC to a modem)
* Wafer card. Several formats are useable. See below. Typically a "goldwafer" is needed.
* Programmer device which can operate in "JDM" mode for programming loose DIL chips (PIC and/or EEPROM).
* Programmer device which can operate in Phoenix/Smartmouse mode for programming embedded EEPROM chips
- if using a card with dismountable chips, no Phoenix/Smartmouse device is required.
- these Ludi & Phoenix programmers can be 2 separate devices or a single "combi" device.
* PIC programming software to operate the JDM device
* Phoenix/Smartmouse software to operate any Phoenix/Smartmouse programming device you need.

More details on suitable cards
------------------------------
Basically there are three main types.

(1) Wafer cards
These are the traditional plastic credit-card type. They contain chips which are etched into the layer sandwiched between the plastic, and so are invisible.
They follow international (ISO 7816) standards, and their pin layouts are well documented in official literature. The word "wafer" itself arises from the fact that they are wafer thin.

There are various kinds of such cards.

"wafer" (i.e. the simple term, as opposed to, say, goldwafer) usually refers to a card containing just one chip. These can not be used for digital Irdeto or Seca decryption. They used to be in service for decrypting D2MAC analogue channels, and were known as MultiMacI (MM1) cards.

"Goldwafer" is a card that contains 2 chips: one PIC and one EEPROM. They first became popular as auto-updating D2MAC analogue pirate cards, and were known as MultiMacII (MM2) cards. The name arose because most of these class of wafer cards are gold coloured. But not all. Some are white, for example. In fact it doesn't matter what colour they are so long as they contain the right chips. But beware: many (most) of the white wafers are actually single-chip wafers, and that is not sufficient.
The PIC is type 16F84. Some older D2MAC wafer cards have a 16C84. This is NOT ok, since it contains insufficient RAM memory to hold the files that will be loaded.
The EEPROM is a 24C16. Some variations are ok. For example, the 24LC16 where the "L" indicates "low power consumption".

"Triple-wafer" cards contain 2 PICs and one EEPROM.
"Quad" cards contain 2 PICs and 2 EEPROMs.
Primarily these configurations have been created to allow more keys to be loaded, and a bigger/better version of the Seca or Irdeto card emulation software. The 2 PICs are configured as "slave" and "master". Schematics for such cards exist on the internet, some are now also being sold ready-made, and the special master/slave versions of the files to be loaded are also now widely available.

"Fun-cards" are also now available, which not only have a different internal configuration, but also use a different chipset (eg an Amtel AT90S8515 with a 24c65 EEPROM)

(2) SMD cards - Surface Mount Devices.
These are the same dimensions and layout as a plastic wafer card, but they contain visible surface-mounted chips (i.e. chips whose pins are soldered onto the surface of the card rather than through holes. The chips are very low profile, so this card - like the wafers - fits into a CAM slot with the flap (if any) closed. Some SMD cards are badly soldered and can give problems.

(3) PCBs - Printed Circuit Board cards, or Print-cards (or PIC-cards)
These are normal circuit boards shaped to fit into the CAM slot and etched with tracks which match the internally etched tracks of a wafer. They usually hold sockets soldered onto the PCB, into which dismoutable chips are pushed. The disadvantage of PCBs is that the size of socket+chips means they do not slide completely out of sight into the CAM slot. They have to be made longer than a normal card, with the sockets/chips at the end so that they stick out of the CAM. This means that any flap over the CAM can not be closed (a minor inconvenience).
They have two significant advantages though. First, the chips can be removed - and so can be programmed separately on a JDM device. This contrasts with the normal wafers, where the EEPROM chip can only indirectly be programmed using a technique known as "through-PIC". More of that later.
Second, they can be made from standard electronic parts by the hobbyist. Schematics/layouts are downloadable at many internet sites and the chips needed are standard PICs and EEPROMs, available from normal electronics suppliers.
Oh, and they are a bit cheaper too.

More details on programmers
---------------------------
Most but not all programming devices work through the serial port using a standard serial cable. Some (typically the more expensive models) work through the parallel printer port, using a bespoke cable. The required power-supply is typically 9v or 12v DC, delivering 300mA.

In order to program plastic cards, both the Ludi and Phoenix devices should be equipped with a smartcard reader (i.e. a slot into which the wafer can be slid in order to program it). Not all such devices have this as standard.
If you are intending only to work with PCB cards (with dismountable chips) then a Ludi without card-reader will be all you need - assuming it has one or more sockets suitable for inserting loose EEPROMs and PICs.

If you are working with plastic cards, you MUST have a Phoenix/Smartmouse device, since that is the only device which can program the embedded EEPROM. It will also have to operate at the lower speed of 3.57MHz. The higher speed of 6.00MHz is ok for modern MOSCs but can damage wafer cards. Not all such devices have a 3.57MHz oscillator - some only have a 6.00 MHz. But a 6.00MHz programmer can be turned into a 3.57MHz programmer simply by swapping the oscillator crystal - no other modifications are required.
Note: a device in JDM mode does not use the crystal.

Popular JDMs (also referred to as a "Hi/Lo programmer") are the DL20 & JDM (Jens Dyekjær Madsen).

More details on programming software
------------------------------------
These programs offer features for programming, reading, and erasing the chips. The HEX or BIN file is read from the pc-media (eg hard-disk) into a buffer, and from there piped across the COM-port/cable to the programming device and into the chip. Most programs use checksums to verify what they are writing.
There are a vast range of utilities available, some Ludi-only, some Phoenix-only, some combined. Some have additional handy features such as HEX disassemblers.
Some programming devices come with their own dedicated software.
Note: whatever Phoenix/Smartmouse software you use, it should support the 3.57MHz speed - and not all do!

Where to buy and what they cost.
--------------------------------
Wafer-cards, SMD-cards, PCB-cards are available in many satellite shops throughout Europe, and through many internet retailers. It is perfectly legal to sell such cards and/or chips in the raw, blank state, since they have multiple purposes. Only when the software is loaded, turning it into (say) a pirate satellite card, would its sale or use become illegal.
Price typically GBP 15 each. You really shouldn't pay more. If you are asked for more, you are being ripped-off. They used to be even cheaper but the arrival of Irdeto and Seca hacks using such cards pushed the price up and there are even supply problems now.
PCB cards can be built by the electronics hobbyist. Schematics/layouts are downloadable at many internet sites and the chips needed are standard PICs and EEPROMs, available from normal electronics suppliers. If you make such a card yourself, expect to pay less than GBP 10 for the parts.
Fun-cards can be made (schematics again are available on the Internet) or purchased ready-made. Trio- and Quad-cards are mainly DIY items at the moment.

Programmers can also be purchased in kit or ready-built format. ready-built ones are still being sold by satellite shops, though some less openly than before the 28th/May/2000 European anti-piracy legislation came into force. There are many retailers selling them online though.
Costs range from about GBP 30 for the cheapest combi (VP-2) up to hundreds of pounds for professional-quality PIC programmers alone. The higher costs usually are indicative of a wider range of supported chips, as well as a better tolerance of the many differences across PCs of COM-port, processor-speed, etc. But if the sole purpose is to program 16f84 and 24c16 chips then the cheapest should suffice.

Overview of process
-------------------
The goal is to get a key file into the EEPROM, and a software file (including key-decryption algorithms) into the PIC.
The software file is usually a hexadecimal (xxx.HEX) file.
The key file is usually a binary (xxx.BIN) file.
A loader (or "boot") file may also be needed in order to pass the key file through the PIC and into the EEPROM. The loader will typically be a HEX file.
Some programming utilities will demand that the file for the EEPROM is indeed a BIN file, and the others are HEX. But if the downloaded files are not in those formats, don't worry: there are utilities available for converting from one to the other.
There are also wafer software files available which allow the keys to be loaded using new pseudo-nano-commands in CRD format as familiar to people who have played with MOSCs. But we will ignore those here.

The loader/hex file
-------------------
When working with non-removable chips (i.e. SMD cards, or plastic wafers), there is a problem to be overcome: how to gain access to the EEPROM, since it sits "behind" the PIC. The solution is to use "Through-PIC" technique. This means loading a special file onto the PIC whose sole purpose is to pass the key/bin file through to the EEPROM. This loader (or boot) file exists in many different versions, with names like LOADER.HEX, MAIN.HEX, 16F84.HEX and so on. Often the wafer-software files are packaged with a loader. But don't think you have to use the loader which comes with the particular package. Once you've found a loader which is reliable for you, save it and reuse it for all future through-PIC programming.
When the EEPROM has been successfully programmed, the loader has fulfilled its purpose and can be overwritten with the program/hex which you really wanted on the PIC in the first place.

In the case of many Seca wafer-software files, the loader is built-into the seca hex. So there is no need to load a loader as a separate step: simply load the final HEX file, and that will allow the EEPROM to be programmed as well. However, this is not always reliable, and in any event, there is no harm in going though the extra separate loader step. My advice is to always use a the same dedicated loader for through-PIC programming, whether Irdeto or Seca.

The key/bin file
----------------
The key file contains some data which mimic a MOSC (Manufacturer's Original Smart Card). For example, an ATR, a country-code, a hex-serial number, an ascii-serial.
It also contains a pack of keys. In the case of Irdeto, maximum 8 packs. For Seca, maximum 16 packs.
These packs can contain plainkeys, plainmasterkeys, hexmasterkeys, providerids, dates, channel-ids (for Irdeto beacon channels) and so on.

The key file can be edited on the PC prior to loading into the card's EEPROM. To edit, use a standard hex-editor or - better - one of the various recently developed utilities such as Arcano's "Ich Bin" (the MaMBa version can edit and even create both Seca and Irdeto Eeprom files). This can be useful if you have found a stable version of the software for your receiver, and now simply want to update/add one or more keys to meet your needs (rather than blindly loading full hex/bin sets again hoping they give you what you want).

Some versions of the Seca software once loaded onto a wafer allow new keys to be entered (in a rather tortuous manner admittedly) using the remote control. Other versions (both Seca and Irdeto) are "auto-updating" - they generate new key and store them on the wafer as necessary (i.e. when the provider changes keys - as happens regularly).

The program/hex file
--------------------
This mimics an official card to a degree, but also offers more functionality. For example, it can process many more providers than official cards. It incorporates the decryption algorithms for the keys that are used to interrogate or activate the cards in order to grant access to the encrypted channels.
Many different versions exist and they are constantly being tweaked, to create new versions. More often than not they are matched in some subtle way to the associated key/bin file. So best advice is to use the hex/bin pair as a pair - don't mix and match.

Troubleshooting
---------------
There are so many variations of card, software, programming device, PC, CAMs and receivers, that it is inevitable that problems arise. Sometimes problems are due to faulty hardware, or mismatched hardware. Sometimes bugs in the software, or the firmware of the CAM. When problems do arise, it can be difficult to find out the cause.
Here are a few known problems.

* Some programming devices (such as the VP-2) can not work with laptops. This may be due to the com-port settings, or to power-management of the COM-port. Always switch off any power-management utilities you have running, and ensure that the COM port you are using is powered-up.

* Some programming devices (such as the VP-2) can not work reliably (or at all) with fast computers - which can be anything from a Pentium 90 upwards. Such problems may originate with bad timing pulses generated within the programming software, so that some software will work, others not. Now where have you got that old 286 stored?

* Not all combinations of programming software and programming device are compatible. There are lots of different PIC and EEPROM programming utilities to try out though, so when you find one that works, keep it.

* Often small variations in voltage or timing pulses might cause read/write errors, and verify-failures. The solution will usually be simply to start the operation again (perhaps after re-inserting the chip, or cleaning the card's contacts, or switching the programmer off/on).

* Some wafer software is not compatible with some receivers. Search out specific wafer files for your receiver if they exist.

* Some CAM firmware is unstable in combination with wafer software. Astoncrypt v1.03 is more stable than the earlier v1.00.

* Different receivers behave in different ways. Some are more tolerant of wafer files or flaky CAM firmware. Some receivers' firmware is itself buggy. The Echostar ad3000ip is an example - it regularly hangs on Seca PPV channels.

* Some loaders/boot-hex files work well, some don't. When you have found one that works for you, keep it and always use it in preference to any that is supplied with the other bin/hex wafer files.

* Most embedded Seca CAMs can work with more providers' keys in the package than can most (Aston) CI CAMs. A CI-CAM can typically only work reliably with maximum 9 providers, an embedded CAM with 14 or more. And note: a Seca auto-update on a normal goldwafer (1 PIC, 1 EEPROM) will usually only hold maximum 7 providers' keys in any case.

* some wafer files are known to contain addressing errors. So they will never work properly. The best strategy is to keep hold of one that does work on your receiver, and edit/add new keys as required - rather than having to hunt out hex/bin files - which will certainly have new keys, but may also be badly programmed software.

Links:
======
The following files and links are a sample only. Dozens of others exist out there.

This file
---------
Satellites-UK board (GB) http://www.satellites.co.uk/cgi-bin/dcforum/dcboard.cgi
Satellite Fun board (NL) http://pub10.ezboard.com/bthesatellitefunboard

Other helpful resources/FAQs/etc
--------------------------------
H2DeeToo's message board: http://hostedscripts.com/boards/icprog/ (mainly English language)
PIC FAQ: http://www.piclist.com/techref/default.asp?from=/techref/piclist/&url=../microchip/index.htm
PIC FAQ: http://www.ubasics.com/adam/pic/archive/picfaq.txt
PIC info archive: http://www.ubasics.com/adam/pic/archive.shtml
PIC links mirrors: http://www.man.ac.uk/~mbhstdj/piclinks.html
...eg1: http://www.ubasics.com/adam/pic/piclinks.shtml
...eg2: http://engmtasd.derby.ac.uk/mirrors/pic/