Content

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.

WxPic V1.2 contains now the porting of the full WinPic sources including the 18F support that was missing in earlier versions.

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:

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

WinPic Support of PIC18Fxxxx is restored in WxPic starting with WxPic V1.2. This brings back the following devices:

Haut

System requirements

To use WxPic you need:

The supported programmers are:

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

Haut

Install and Run WxPic

Windows

Before running WxPic for the first time you must install it. This is a simple operation using the provided installer wizard. But this operation should be performed in a priviledged account. Else you won't be allowed to install for all users and you won't be able to use the parallel port.

To install WxPic, simply execute the downloaded multilanguage installer (WxPic-V#.#.#R###-installer.exe) and follow the instructions:

Choose your preferred installation language

Installer language selection screen

Review and accept the licence terms and then confirm the installed components. You should not need to change any selection except that you can unselect the language support if you need only the English language. Note that the proposed WinRing0 driver depends on your operating system word size (32 or 64 Bits). This is automatically selected by the installer. The WxPic program itself is always 32-bit so it is compatible with both types of operating system.

Slection of components to install

Then at next step you will just have to confirm the installation directory by clicking on Install button. That's all, and WxPic should complete installation in less than 5 seconds.

Installation folder selection screen

Then you can run WxPic from your Windows Start > All Programs > WxPic > WxPic menu. Don't forget to run WxPic from an administrator account if you want to use the parallel port. In this case, under Vista or Windows 7, you will have to confirm that you accept to grant WxPic the administrator rights. Serial ports can be used from any user account.

Haut

Linux

On linux, installation is slightly more tricky than on Windows. It depends on the actual Linux version you may have. The binaries are provided only for Ubuntu 12.04 and for CentOS 5.7. They may be compatible with other versions and/or variants. You will have to try to know. If the binaries does not run on your OS you will have to build your own binaries. In this case, refer to the Build page.

In the case you are running a compatible OS or you want to install one version to assess if your OS is compatible with one of the binary, follow these instructions:

After installation, WxPic appears in the Application > Programmation Gnome menu. WxPic can be run with that menu. But this must be done from the root account to allow acces to parallel port. Using only serial ports is possible from any account.

Under Ubuntu the root account should not be used directly. It is recommended to use sudo to run a command with priviledges. The following command should be used to run WxPic under Ubuntu so that it can access to the parallel port:

sudo -H wxpic

Warning: it is important to not forget the -H sudo option. It allows to move the environment to the root account. This avoids WxPic to create its file with root priviledges in the user account. Those files would no longer be writable by the user. WxPic verifies this condition and warn the user when it is detected. It is not recommended to continue working in this way.

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:

For Linux replace the '/' parameter prefix by '-'

<any string not beginning with a slash ('/') [a dash ('-') for Linux]>
This string is 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.
Only one file may be specified. If it contains spaces, it must be enclosed between quotes (").
/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. Compare 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=<n>
Terminates WxPic after the job is done automatically + <n> seconds. <n> must be positive or null. Without this command, you must close WxPic manually, even when running in command-line mode. The time before quitting may allow you to look at the message window to verify the execution traces. Though note that if an error occurs during the execution of the command line operations, the execution of these operations are aborted. So the /q operation executed at the end will never be executed in case of error.
/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=<device-name>
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=<hex-value>
Overrides the configuration word from any loaded hex file. The parameter <hex-value> is as a four-digit hexadecimal value.
/session=<session-name>
Select the session <session-name> (ignoring case) instead of the Default Session that is used by default when parameters are specified on command line. If no session name is provided (/session=) it is the Default Session that is used whatever its name.
If the session name contains spaces, the parameter must be enclosed between quotes (for example: /session="My Session" or "/session=My Session")
Under Windows it is not possible to specify a session name containing quotes.

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:

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