Content
Advanced Information

The WxPic's Tab Pages

The tab pages gather the data managed by WxPic and the controls that allows to set up WxPic. The items are distributed in the following pages:

Code
Displays/Edits the program code buffer(s).
Data
Displays/Edits the data buffer if the selected component has one.
Device Config
Allows to select the device and Display/Edit the configuration in symbolic way.
Config Memory
Displays/Edits the configuration buffer in hexadecimal or binary representation (including the the configuration words that are managed by the Config PIC page).
Options
Configures the WxPic behaviour.
Interface
Allows to select the programmer interface and provides debugging tools for this interface.
Messages
Displays the error and debug messages.
Haut

The Code Page

This page displays the code buffer content modified by the user editing if any. Editing is possible when enabled through the Enable HEX editor menu.

The left column indicates the address at the beginning of the row. The top row indicates the address offset of the column from the beginning of the row.

The colour indicates the word state that can be:

Used word
Contrasted colour that can be adjusted in the Options page.
Unused word (its value should be equal to the erased word value)
Dimmed colour.
Erroneous word (there is a difference between the buffer and the device memory)
Rouge
Special word (calibration)
Violet
Haut

The Data Page

This page displays the data buffer content modified by the user editing if any. Editing is possible when enabled through the Enable HEX editor menu.

Haut

The Device Configuration Page

This page allows to select the device to program in a dropdown list. It is possible to declare new devices by editing the Device.ini file.

Depending on the selected device, the code and data memory sizes are displayed in the device properties frame. The disabled checkbox indicates, when checked, that the device memory is flash memory.

The hexadecimal value of the device configuration word(s) are displayed and editable. The meaning of this configuration is provided by the table below. Each line represents a device configuration parameter. The columns indicate:

  1. The parameter name,
  2. The address of the configuration word that contains this parameter,
  3. The hexadecimal mask that corresponds to the bits of the configuration word that code the values of this parameter,
  4. The meaning of the current values of these bits. This value is modifiable by selection in a dropdown list that contains the possible values of the parameter. This list is displayed upon a double clic on the cell to modify. The modification is immediatly applied and reflected in the value of the configuration word.

The list of parameters depends on the selected device.

The modification of the configuration word hexadecimal value is immediatly validated and reported in the parameter table.

The saved before erase information is the values of calibration data that are factory programmed but that are erased by the erase operation. WxPic saves this information to be able to reprogram them and avoid loosing the calibration values. In addition this information is displayed in this page.

Haut

The Config Memory

This page displays in a table the value of configuration buffer words. It contains among others the configuration words managed by the Device Config Page. Each row of the table displays a device configuration buffer word. The columns indicates respectively:

  1. The word address,
  2. The reserved status of the word when a star is displayed,
  3. The aim of this word,
  4. The current value of this word in a hexadecimal or binary representation.

In the right panel, the radio buttons allow to select between the hexadecimal and binary representation of the config words.

The checkbox allows to display, when checked, all the words of the configuration buffer even those that are reserved. The reserved words are not modifiable and often not used. When reserved words are displayed they are marked with an star in the left column.

The device ID provides the value of the words that indicates device model (for those that supports this feature). The translation of this value in device name is provided. It should correspond to the selected device.

The Apply Edits button allows to apply the changes made to the hexadecimal or binary representation of the configuration buffer content.

Haut

Configuration memory and ID Locations

Most of the configuration memory addresses store identification information (ID). These locations most often contain four or seven bits per location. For example in "14-bit" devices these locations are mapped to addresses 0x2000 to 0x2003. In contrast to the code memory, the ID locations can be read unscrambled even if the PIC is protected.

In MPASM (the assembler from microchip), there is the __idlocs command (with two underscores) to set these bits, but only the lowest 4 bits in every location. The __idlocs command bundles 4 * 4 bits in a single 32-bit value, presumably because older PICs only had 4 usable bits per ID location. But the 12F675 for example has seven bits per location !

With WxPic, you can read / modify / write the ID locations (all bits). If ID location data are contained in a HEX file, they will be loaded and displayed also. WxPic does not display the data in MPASM's 4*4-bit-format, it uses a table where all bits are displayed in binary form. You can edit the contents of the grid table. After doing so, click the Apply edits button under the table. Clicking this button copies the table contents into an internal buffer, but does not program them into the PIC immediately - the ID locations will be programmed together with the other programmable parts in a PIC.

Haut Other Config Data

The "Device ID word" can be used to identify a chip after reading the PIC. This 14-bit word is mapped to address 0x2006, but not all PICs seem to have it (a test with an old 16F84 always returned 0x3FFF as device ID). The lower 4 or 5 bits may contain the PIC's revision number in some devices. WxPic tries to decode the device ID word and shows the result on the "ID locations" tab. If there is a conflict between the selected PIC device and the readout ID word, the Device ID display turns red. If WxPic cannot find a match for the device ID of the new chip, you may add a new entry to the device database as explained here (don't forget to set the parameter DeviceIdValue to the new chip's device ID).

The "Config Memory" tab may also show the contents of some other special function registers which did not fit on the "Configuration Bits" tab. For example, you will find the PIC10F20x's Backup OSCCAL Value in this table.

Because it is entirely unknown how many (and which) cells will be used in the configuration memory in future devices, WxPic's device table contains information of all really "implemented" cells. More about this in the chapter about the file DEVICES.INI, which describes how to add support for future devices.

Haut

The Options Page

This page regroups the choices allowing to modify the WxPic behavior.

The checkboxes CODE, DATA and CONFIG allows to disable, when unchecked, the programmation of the corresponding part of the device memory. Only the checked items are programmed.

Clear buffers before loading HEX files allows to be sure that the memory area not described in the HEX file are unused. On the other hand unchecking this box allows to combine the content of several HEX files.

Raise Vdd before Vpp changes the order the power supplies are raised on the device. You must select the behaviour that suites your device and your programmer.

Le language dropdown list allows to choose a translation of WxPic interface. It will be effective only after a restart of WxPic. Though take care that quitting with Exit without saving the setting will not save the language choice and therefore it will not be applied even after restart.

The buttons Code memory color and Data memory color allows to select the display colours of respectively the Code and Data pages. They display the colour dialog twice each. The first time to select the foreground colour, the second time to select the background colour. Red colours should be avoided because they are used to display the errors and the special words.

The field MPLAB DEV-file directory must refer the sub-directory Device of MPLAB installation where the PIC device definition files provided by Microchip are. Usually this directory is C:\Program Files\Microchip\MPLAB IDE\Device. If this path is wrong and the current device description file cannot be found, the field title turns red. It will turn black only when the error is fixed (i.e. a path is entered where the needed device file is found).

When this field is left empty, WxPic search for the device description files in the Devices subdirectory of the WxPic installation directory. Copying those files here could be a good idea in case a future version would not provide them or would use a different format.

Haut

The Interface Page

This page regroups the selection, configuration and tests of the programmer interface.

The upper right list allows to select the model of programmer. This choice implies the type of port that is used by the programmer. The second list allows to select the port to use when there are several on the PC. The address field allows to change the physical addres of the port. Though this is generally a critical error to change this value, the effect could be a crash of the PC.

For the cutstom interfaces it is necessary to select a file that describes the programmer behavior. This is done using the Select button. It is also possible to enter directly the filename in the text field. The interface definition file contains the rules that allows to drive the interface.

The other fields below allows to modify the durations in programmer cycles. Usually it is not necessary to modify them. Though they may help to workaround some weak interface.

The checkboxes on the left allow to modify at will the status of the signal on the device. The Data In value indicates the status of the data input from the device. The optional programmer LEDs and button are indicated too when applicable. This should be necessary only for debugging a new programmer. In fact WxPic performs automatically a programmer test at startup. The result of this auto-test is displayed in the rectangle in the middle of the right panel. The Initialize! button at upper left allows to redo this auto-test.

WARNING: To use a parallel port adapter, it is necessary to install and run WxPic in an administrator account. VISTA users will have to register WxPic as a priviledeged program. To do this, right-clic on the shortcut used to run the program and choose properties. In the Compatibility tab check the box at the bottom.

When using a parallel port you will generally get the error WARNING ! Windows fooled around with the LPT port bits !

This error is caused by Windows writting to the LPT port without even verifying that it has been open by an application. This is probably used to detect a plug-and-play peripheral (printer) that would be plugged on the LPT port. The method to de-activate this polling is to modify the registry:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Parport\Parameters] "DisableWarmPoll"=dword:00000001

This method is not documented by Microsoft. So it is not sure it will always work. Though it has successfully been tested on XP SP2 and VISTA. You can double-click on the file DisablePolling.reg at the root of WxPic intallation directory to perform this change. In case you would need to restore the polling of the port use EnablePollingBack.reg

Haut

The Messages Page

This pages displays the status, debugging and error messages. It should be usefull only in case of error to analyze the details. This is also the page that is displayed during Batch programming. The log window must have the focus when pressing Enter to confirm the start programming for the next device of the batch.

The Clear button allows to empty the message window. It is necessary to perform this operation when the window content size become to large.

Retour