****************************************************************** MPLAB, PICSTART PLUS, and PIC are registered trademarks of Microchip, Inc. ****************************************************************** CONTENTS I. Creating a project in MPLAB II. Opening a project in MPLAB III. Building a Hex File IV. Downloading an 18C658 Hex File to the processor using the TS-18C658-1B Programming Adapter and PICSTART PLUS V. Downloading an 18F4X2 or 16F87X Hex File to the processor using the TS-18C658-1B Programming Adapter and PICSTART PLUS ****************************************************************** I. Creating a project in MPLAB 1) Create a directory that will contain your project using Windows Explorer or equivalent, then put your .asm source code file in that directory. 2) Start MPLAB and choose Project>New Project..., then navigate to the directory previously made in the 'New Project' dialog box. Name the project file and click OK. 3) The 'Edit Project Dialog box will appear with a hex (.hex) file in the 'Target Filename' text field having the same name as the project you named. Choose the desired development mode, such as "Editor Only18C658," by clicking the 'Change..' button. 4) Click the 'Add Node..' button, and add the source file you put in the project directory; you may have to navigate to the directory when the 'Add Node' dialog box appears. 5) Click OK in the 'Edit Project' dialog box. You may return to this box to edit the project file via the Project>Edit Project... menu selection. 6) Choose File>Open to open and edit the .asm source file. ****************************************************************** II. Opening a project in MPLAB 1) Choose Project>Open Project..., then navigate to the directory containing the project to be opened. Open the project. ****************************************************************** III. Building a Hex File 1) Choose Project>Build All to assemble the source file. ****************************************************************** IV. Downloading an 18C658 Hex File to the processor using the TS-18C658-1B Programming Adapter and PICSTART PLUS 1) Place the programming fixture onto the PICSTART PLUS so that the protruding pins under the left side of the fixture fit into the 40 pin ZIF socket of the PICSTART PLUS. The two rubber feet under the right side of the programming fixture will rest along the top of the right side of the PICSTART PLUS (looking down at the PICSTART PLUS from the top). Be sure that pin 1 of the protruding pins is inserted into pin 1 of the 40 pin ZIF of the PICSTART PLUS. There may be a double set of pins on the programming fixture for each pin hole of the 40 pin ZIF of the PICSTART PLUS. BE SURE THE 40 PIN ZIF LOCKING LEVER ON THE PICSTART PLUS IS IN THE LOCKED POSITION. 2) Place a blank 68 pin PLCC 18C658 into the PLCC socket on the programming fixture. The location of pin 1 is marked with an arrow on the programming fixture. This arrow should line up with the logo on the processor. 3) Power up the PICSTART PLUS, and be sure the serial cable is connected to the PC running MPLAB. 4) Choose Options>Development Mode...>Tools in the MPLAB menu and change the processor to PIC18C452. If you are working with the 18C658, you will generally change the processor type to PIC18C658 for building the Hex file. PICSTART PLUS does not generally support the 18C658, however, you can use PICSTART PLUS to program the 18C658 by using the TS-18C658 Programming fixture, and changing the processor type to PIC18C452. 5) When you build a hex file from a project in MPLAB, the hex file will automatically be loaded into the program memory buffer in MPLAB; the memory from this buffer will be sent to the PICSTART PLUS for programming the processor. You can also manually load this buffer by choosing File>Import>Import to Memory... from the menu. You can use the latter method to load a hex file without having a project open. 6) Choose PICSTART Plus>Enable Programmer in MPLAB. 7) To check that the device is blank, click the 'Blank' button in the 'PICSTART PLUS Device Programmer' window. If the device is not blank, you will see a message box with the following message: Device is NOT blank: Program Memory Configuration Bits IDs If you are using the 18C658 programming fixture with the processor set to PIC18C452, and the device being tested is blank, the message box will still tell you that the device is blank; however, it will indicate that there is only configuration bits in the program memory with the following message: Device is NOT blank: Configuration Bits If you are using the 18C658 programming fixture and you get this message, this means that the device actually IS blank. The reason for this is that the 18C452 has an extra configuration bit that the 18C658 does not need; this is the CCP2/RB3(RC1) Mux configuration bit. The 18C658 does not need to multiplex the CCP2 signal with a port bit because of the increase I/O count of the 18C658. The default state of that unused configuration bit in the 18C658 is opposite that of the 18C452, so MPLAB thinks that the device is not blank. So when using the 18C658 programming fixture just ignore the fact that the message box is telling you that the device is not blank; just be sure that it is not telling you that there is also program memory and ID's in the device; if this is the case, the device is not blank. 8) Once it has been established that the device is blank, click the 'Program' button in the 'PICSTART PLUS Device Programmer' window. When using the 18C658 programming fixture, you will get a warning message at this point telling you that the processor has configuration bits and is not blank. It will ask you if you wish to continue. Click yes. The device will be programmed. If there is an error programming the device, an error list will be displayed. If you do not see this error list after programming, then the device has been successfully programmed. 9) You can click 'Verify' in the 'PICSTART PLUS Device Programmer' window after the device has been programmed to check that the hex file that is in the MPLAB memory buffer is the same as that in the device. ****************************************************************** IV. Downloading an 18F4X2 or 16F87x Hex File to the processor using the TS-18C658-1B Programming Adapter and PICSTART PLUS 1) Place the programming fixture onto the PICSTART PLUS so that the protruding pins under the left side of the fixture fit into the 40 pin ZIF socket of the PICSTART PLUS. The two rubber feet under the right side of the programming fixture will rest along the top of the right side of the PICSTART PLUS (looking down at the PICSTART PLUS from the top). Be sure that pin 1 of the protruding pins is inserted into pin 1 of the 40 pin ZIF of the PICSTART PLUS. There may be a double set of pins on the programming fixture for each pin hole of the 40 pin ZIF of the PICSTART PLUS. BE SURE THE 40 PIN ZIF LOCKING LEVER ON THE PICSTART PLUS IS IN THE LOCKED POSITION. 2) Connect the Flash board programming cable, one end to the programming fixture, and the other end to the 16F87X/18F4X2 Main board. 3) Power up the PICSTART PLUS, and be sure the serial cable is connected to the PC running MPLAB. 4) Choose Options>Development Mode...>Tools in the MPLAB menu and change the processor to the microcontroller you are using, such as the PIC16F877. 5) When you build a hex file from a project in MPLAB, the hex file will automatically be loaded into the program memory buffer in MPLAB; the memory from this buffer will be sent to the PICSTART PLUS for programming the processor. You can also manually load this buffer by choosing File>Import>Import to Memory... from the menu. You can use the latter method to load a hex file without having a project open. 6) Choose PICSTART Plus>Enable Programmer in MPLAB. 7) When using a Flash part, is should not be necessary to check that the device is blank. 8) Click the 'Program' button in the 'PICSTART PLUS Device Programmer' window. The device will be programmed. If there is an error programming the device, an error list will be displayed. If you do not see this error list after programming, then the device has been successfully programmed. ****************************************************************** Copyright Tech Systems, 2002 techsystemsembedded.com ******************************************************************