# WxPic
PIC Micro-controller Programmer

The PIC Microcontrollers are Microchip products.

## Introduction

WxPic is an (approximated) porting of the DL4YHF's WinPic program in a Free Software development environment including wxWidget, MinGw, Code::Blocks, wxSmith.

In this version V1.0 Alpha, WxPic has only been tested with the PIC12F629 and a serial interface programmer. It is very likely that bugs remain for other PICs and other interfaces that were managed by the original program. Though PIC12F675, PIC16F630 and PIC16F676 are very close to PIC12F629 and therefore WxPic should work with them too.

Note that the ported source code did not contain the complete set of files necessary to manage the PIC18Fxxx. So the support of PIC18Fxxx has been lost at least until I figure out what is missing and I rebuild it back.

WxPic license is identical to WinPic license:

Disclaimer
  THIS SOFTWARE IS CONSIDERED 'FREEWARE'. THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. In other words, THE ENTIRE RISK FOR THE USE OF THIS SOFTWARE IS WITH YOU. Permission is granted to use, modify, or redistribute this software so long as it is not sold or exploited for profit.
  Use this program as long as you keep in mind that this program is no professional software ! Because this program is freeware, the entire risk of its use is with you. As usual, neither the author nor contributors will be liable for anything. This also applies to the schematic diagrams presented in this document, and in "the software" itself. A missing copyright note in these documents does not indicate "no copyright" for names of products or companies mentioned here.

WxPic included the WinRing0 version 1.3.1a libraries. The License and the source files are on OpenLibSys web site

The last version of WxPic and its sources are available on the WxPic web site.

Haut

## What is WxPic made for?

In a single line, WxPic allows, with a PC and an adapter (programmer), to program a PIC micro-controller. With some more details, it allows to:

- Loading a HEX file such as those generated by MPLAB the free tool from Microchip. This files defines the binary content of memory areas.
- Mapping these memory areas on the memory areas (code, data and configuration) of a PIC micro-controller model to be selected in a list of supported devices.
- Writting in the device the memory data completly or by part
- Reading the content of the micro-controller (if this is allowed by the device) either to compare it to the loaded memory, or to load it in memory.
- Reviewing, edit or save in HEX format the content of the loaded memory.

And WxPic also helps debugging a home made programmer by allowing to command manually the programmer inputs, or to adjust the timings of the programmer interface management.

Haut

## List of supported Micro-Controllers

- PIC12F629, (tested)
- PIC12F675, PIC16F630, PIC16F676, (similar to tested PIC)
- PIC16C84, PIC16F84
- PIC16C61, PIC16C71
- PIC16C710, PIC16C711
- PIC10F200/202/204/206
- PIC12F635, PIC12F675, PIC12F683
- PIC12F609, PIC12F615, PIC16F610, PIC16F616
- PIC16F627, PIC16F627A, PIC16F628, PIC16F628A
- PIC16F636, PIC16F648A
- PIC16F684, PIC16F688
- PIC16F73, PIC16F737, PIC16F74, PIC16F76, PIC16F77
- PIC16F818, PIC16F819
- PIC16F87, PIC16F88
- PIC16F873A...PIC16F877A
- PIC16F88
- dsPIC30F2010 -- dsPIC30F6010, dsPIC30F's
- And others by developping corresponding parameter files...

Support of PIC18Fxxxx have been removed in the porting.

Haut

## System requirements

To use WxPic you need:

- A PC running Windows XP or Vista,
- A supported PIC programmer,
- A parallel port (LPT1 or LPT2) ou série (COM1, COM2, ...) disponible compatible avec le programmateur PIC utilisé.

The supported programmers are:

- F629 Programmer (tested)
- COM84 Programmer (code tested with F629 Programer)
- JDM (2) (code tested with F629 Programer)
- PIP84 (not tested)
- Tait Programmer (not tested)
- Microchip AN589 (not tested)

Other programmers based on either the serial interface or parallel interface can be supported by using a text file describing its interface.

Haut

## Command Line Arguments

You may call WxPic from a batch file, or an integrated development environment to do an automated job without any user intervention. For example, you can tell WxPic to load a program from a hexfile, write it into the target device, and terminate itself afterwards.

The following list shows all command line parameters which are accepted:

<any string not beginning with a slash>
  considered a file name. If the command line contains a /p command ("program)", this file will be loaded into a buffer. If the file cannot be loaded, the evaluation of the command line is cancelled immediately; you can try to load the file "manually" then. If the command line contains a /r command ("read"), this is the name of the produced hex file. If there is only a filename specified in the command line, but none of the following "switches", the specified file will be loaded into WxPic's buffer automatically but not programmed into the device.
/p
  program the buffer contents into the connected device
/e
  erase chip. Not necessary to use this command together with the 'program' option because 'p' will automatically erase if necessary.
/r
  read the contents of the device and dump them into the specified HEX file
/v
  Verify. Compares the contents of the device with the specified HEX file. Can be used as an "extra" verification together with the /p command, but this is usually not required because the programming algorithms for most PICs include verifying.
/q
  terminates WxPic. Should be the last argument, if you want to terminate WxPic after the job is done automatically. Without this command, you must close WxPic manually, even when running in command-line mode.
/q=5
  also terminates WxPic, but waits for 5 seconds before quitting so you will have the chance to look at any output in the message window.
/nodelay
  Usually, when command-line driven operation is active, the program waits for a few seconds until "the action starts". This can rescue a chip, because it allows you to terminate the erase-programming operation if you have started the wrong batchfile by mistake, etc. With the /nodelay option, there will be no pause before the execution of the command line starts.
/overwrite
  With this option, WxPic won't ask before overwriting an already existing disk file. Use it together with the /r command if necessary.
/device=XXXX
  Selects a new device type (to override the device used in the last WxPic session). Example: /device=PIC16F628 . No space characters are allowed in here !
/config_word=XXXX
  Overrides the configuration word from any loaded hex file. The parameter XXXX is as a four-digit hexadecimal value.

The command-line driven operation can be cancelled by pressing ESCAPE. The main menu will be enabled anyway. Selecting certain menu items also cancels evaluating the command line.

Some command line examples:

`WxPic keyer1.hex /p /q`
  Loads the file KEYER1.HEX, programs it into the connected device, and terminates WxPic ("quit").
`WxPic /nodelay c:\pic\my_src\keyer1.hex /p /q`
  Almost the same, with full path to the hexfile, and a bit faster without the 3-second-pause during which the ESCAPE key is polled.
`WxPic /overwrite /r "readout.hex" /q`
  Reads the contents, dumps the program to the file "readout.hex" (and overwrites the old file without asking). Terminates automatically.

Haut

## The Human Interface

The WxPic Interface mainly consists in:

- a menu bar,
- a button bar,
- 7 pages that can be selected from their tab.

Haut

## Glossary

The main terms used in the WxPic user interface and this help are the following:

Device
  The used PIC micro-controller.
Code
  The executable code (program) of the device.
Data
  The non volatile data of the device.
Configuration
  The configuration word(s) or more generally all the configuration and identification data.
Identification
  The identification words that is defined by the user or attached to the device. The latter indicates the device model.
Buffer
  The internal WxPic memory that holds the image of the code, the data, and the device configuration.
Hexfile
  Text file that decribes the content of memory areas, usually generated by the Microchip MPLAB development tools. WxPic can also recreate those files by reading non-protected devices.
Programmer
  Hardware peripheral that allows to read an program one or several device models.
Interface
  The programmer interface through a serial or parallel port.

Haut