PICcom a RealTime PIC Development Tool
PICcom is a general purpose serial port development tool designed
to aid debugging of standalone micro controllers such as Microchip's
PIC series. Data sent from the micro can be displayed in one of eight
display windows or the 'Terminal' window. The display 'Format' can be
set to Binary, Hex, Decimal or ASCII. Communications from the micro controller
to the PC is by the serial port and one way only (transmit) which can
be implemented using a single I/O pin. A simple code
library is provided for addition into your target firmware to implement
the serial port protocol. This means that PICcom can be used with any device
in the PIC family range.
Software
The software for implementing PICcom consists of the files
listed below which is provided in a single install file. Run the installer
and then create a Windows start icon for the PICcom.exe executable, setup
files and example library code are installed to C:\Program
Files\PICcom.
| File | Ver | Date | Description |
PICcomSetup Size: 200K |
1.0 | 15/5/2003 | PICcom self extracting installer |
| 1.1 | 15/5/2003 | Windows software Win98/2000/XP | |
| 1.0 | 15/5/2003 | 4MHz example code library | |
| 1.0 |
15/3/2003 |
10MHz example code library | |
| 1.0 |
15/5/2003 |
20MHz example code library | |
| 1.0 | 27/4/2003 | Demonstration code (4MHz) |
Serial Interface Lead
Connect the serial lead DB9F female connector to the
micro controller board with the following cable. Ideally the 2 pin connector
should be a polarised 0.1" PCB connector. Unpolarised connectors such as
those used on PC reset switches can also be used as they are unlikely to
cause damage to the PC or micro controller if plugged in upside-down.
Warning: Failure to connect to the correct DB9F serial pins may result in permanent damage to the micro controller or PC. Always measure the voltage across the two pin connector before connecting up. This should read less than 0.1V (floating input to PC).
Hardware Testing
To test the serial port start the PICcom program, set Terminal to
'CH1', set the Format of CH1 to 'ASC' and press 'Run'. With the lead disconnected from the micro controller short out pins
2 and 3 on the DB9F connector (loopback test). This should result in a stream
of 'S' characters being displayed in the terminal
window and in CH1.
Now you need to test the interface. I would recommend starting with a board that contains a PIC16F84 and a 4MHz crystal. Plug the 2 pin connector into the micro controller board. If you connect the Ground to PIC-pin 5 and TX to PIC-pin 6 (PORTB,0) this will work with the default software settings. Program the 'Demonstration code' hex image into the PIC, press 'Run' on PICcom and power up the board. This should result in the screen image shown at the top of this page.
Using PICcom
To add PICcom to your design it is necessary to select
the code library that matches the crystal or ceramic resonator frequency
being used (4/10/20MHz). This is because the serial bit rate is coded into
the library file as a function of the processor clock cycle. Note that external
or internal R/C oscillators may not be stable or accurate enough
(better than 5%) to achieve reliable serial communications. The
code library is not interrupt driven and is simply called with the data value
in 'Wreg'. The call address 'SETCH0', 'SETCH1' etc. determines which one
of the eight display windows will be updated. The following steps describe
how to integrate the code library.
1. Add the three/four file registers: PICCOMT, PICCOMD
and PICCOML (PICCOMH).
2. Add the PICcom Port and Pin definitions: PCPORT, PCPIN.
3. Add the main PICcom code segment.
4. In the setup code after reset set the PICcom port pin direction and
call PCINIT to initiate the interface.
5. Add calls to PICcom whenever you need to debug your code eg,
MOVLW
'M' ;Display 'M'
it window 2
CALL SETCH2
MOVFW TEMP0
;Display file register TEMP0
it window 7
CALL SETCH7
Since the call to SETCHx will result in a short software
delay as the data is transferred to the PC it is important to add the calls
carefully. Typically the transfer takes 220uS at 115200BPS so the best
place to make SETCHx calls is after a time crucial
action has completed or before a delay.
The PICcom 'Terminal window' allows multiple transfers
to be captured and displayed. One or more of the 'Display windows'
can also be directed to the 'Terminal window' in any 'Format'.
When the terminal window receives data in ASCII format (ASC) characters
in the range ' ' to '~' (0x20 to 0x7E) will be displayed. ASCII '0x0A'
will result in line feed, ASCII '0x7F' will result in the window being cleared.
Links