PDA

View Full Version : Programming a 16F688 PIC



kkmm
08-13-2007, 01:38 AM
I've been doing quite a bit of searching around both on this site, the old site, and the internet in general for the answer to this question, with no luck, so hopefully someone here can tell me why I'm screwing this up. I've never done this before. :oops:

My understanding of how to program the PIC chips are as follows:
1. Download the .asm file, and install MPLAB IDE, and whatever program you use to burn the .hex file to the chip (I use WINPIC800 with my JDM programmer)
2, Convert (compile) the .asm file to .hex with MPLABASM
3. Burn the .hex file to the PIC chip
4. Test

My problem comes in the compiling. I keep getting a "Error 111 Missing Symbol" error. I have tried creating a project file (And adding the P16F688.inc file in the appropriate place) in MPLAB . I also tried doing a Quickbuild. Both give me the same error. I clear memory between each attempt. I have made sure my selected device is the P16F688. Other than that, all the settings are pretty much default. Is there something I'm missing?

BTW, I get the error with both the renard-20070407c.asm and the renard-20070711.asm code.

I just downloaded and installed MPLAB IDE tonight. It's version 7.60.

I'm sure it's something I'm doing wrong, but I'm not seeing where the problem is. Any help is greatly appreciated.

EDIT: Looking at it some more, it looks as though the error is coming from the P16F688.INC file. Here is the error:

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F688 "renard-20070711.asm" /l"renard-20070711.lst" /e"renard-20070711.err"
Error[111] C:\PROGRAM FILES\MICROCHIP\MPASM SUITE\P16F688.INC 182 : Missing symbol
Halting build on first failure as requested.
BUILD FAILED: Mon Aug 13 01:52:01 2007
I also tried the sample code for the 16f688 from the Microchip website...same error
Does this help to diagnose the problem?

RJ
08-13-2007, 04:24 AM
Error[111] C:\PROGRAM FILES\MICROCHIP\MPASM SUITE\P16F688.INC 182 : Missing symbol

This line is telling you that on line 182 in the ASM file there is something not right. Take a look at the line. If you post the line in here we can look at the asm code and tell you whats not right. I believe there was a 16f688a chip also with some differences you might want to check with phil that you have the correct chip.

kkmm
08-13-2007, 08:01 AM
I don't think it's the .asm code from Phil. I keep getting the same error on the same line number no matter which .asm file I use, which leads me to think its the p16f688.inc file.

Here is the output from renard-pwm-20070216a_LO_576_EC.asm

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F688 "renard-pwm-20070216a_LO_576_EC.asm" /l"renard-pwm-20070216a_LO_576_EC.lst" /e"renard-pwm-20070216a_LO_576_EC.err"
Error[111] C:\PROGRAM FILES\MICROCHIP\MPASM SUITE\P16F688.INC 182 : Missing symbol
Halting build on first failure as requested.
BUILD FAILED: Mon Aug 13 07:48:47 2007

Here is the output from renard-20070407c.asm

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F688 "renard-20070407c.asm" /l"renard-20070407c.lst" /e"renard-20070407c.err"
Error[111] C:\PROGRAM FILES\MICROCHIP\MPASM SUITE\P16F688.INC 182 : Missing symbol
Halting build on first failure as requested.
BUILD FAILED: Mon Aug 13 07:51:16 2007

And this is line 182 from each:
renard-20070711.asm: addwf TMR0,f
renard-20070407c.asm: movwf PORTC
renard-pwm-20070216a_LO_576_EC.asm: movwf STATUS

and here's line 180-184 of P16F688.INC (the comment line is 182)
RX9D EQU H'0000'

;----- WDTCON Bits --------------------------------------------------------

WDTPS3 EQU H'0004'

I don't see anything wrong with any of these...but I continue to get the same error.

kkmm
08-13-2007, 09:33 AM
I modified the P16F688.inc file at line 182 by placing another ";" in front of the line. I then ran the compiler, AND IT WORKED!! I now have the .hex code for the PIC chip.

Here is the modified line:

RX9D EQU H'0000'

;;----- WDTCON Bits -------------------------------------------------------

WDTPS3 EQU H'0004'

Hope this helps someone else.

Macrosill
09-20-2007, 01:21 PM
I got the same error with line 182 of the .inc file. When I looked at it there was a strange character before the ; looked like a square. I deleted that character and saved the file. Smooth sailing since then.

azcap21
09-26-2007, 02:17 PM
Gents,

I experienced exact same problem with MPLAB ver. 7.60, line 182 extra character error

The problem appears to be linked to P16f688.inc file, line 182 which has an character Mplab compiler does not recognize. It's an easy fix by simply editing P16f688.inc file.

Procedure

#1. If using windows, path should be C:\Program Files\Microchip\MPASM
Suite.
#1a. Or perform file search on your hard drive for file name: P16F688.inc
#2. Open file using text editor
#3. Replace square character at the beginning of line 182 with a ;
(semicolon)
#4. resave file

I hope this helps.

:D

P. Short
09-26-2007, 07:02 PM
Which exact version of the firmware was that (so that I can search for and remove the character)? It doesn't seem to affect the version of MPLAB that I'm using, and it doesn't stand out with the editor that I'm using (emacs).

--

Phil

Wayne J
09-26-2007, 07:06 PM
I do not get this error either. I'm using v7.5 of MPLabs. I think this is only associated with v7.6.

P. Short
09-26-2007, 07:08 PM
NM, I didn't read all of the messages above.

--

Phil

azcap21
09-26-2007, 10:20 PM
I think the problem is only with version 7.6.

kkmm
10-04-2007, 03:46 AM
Now that I have my chips, I ran quickly through the process as outlined above. Everything worked just fine, after a few little settings changes:

What I'm using:
MPLAB IDE v7.62
WINPIC800 v3.62
JDM programmer I got of ebay for 15 bucks.
WINXP on a fairly new PC (full admin rights)

How I did it:
Use MPLAB to "build" the .hex code (no problem)
Configure WINPIC800 to use the JDM programmer (I use com1) and 16F688 chip
Load the .hex file from MPLAB into WINPIC800
Place the 16F688 chip with the "dent" toward the ZIF socket lever in slot 10 (10 slots up from the lever)
Place the jumper near the zif socket to "8, 14, 18, 20 pin" (jump the pins furthest from the zif socket)
Click on the "Program All" button in WINPIC800
After successful programming, Click on the "Verify All" button in WINPIC800

And that's it! Hope this helps someone out.

Edit: BTW, I did not have to modify the file as mention in previous posts with this version of MPLAB.

AaronG
05-28-2008, 06:40 AM
I have been working on this issue for all most 5 days now. Vista will not let me re save the file. Removed MPLAB 7.6 last night and will try to install ver 7.5 and see what happens. I installed 7.5 on my work computer and hade no problem!

kmc123
05-28-2008, 10:59 AM
Are you running the program as an Administrator?
Right click on the exe or shortcut, and select properties, then select the compatability tab, then check the box that says "Run this program as an administrator"

AaronG
05-28-2008, 11:34 AM
Yes I did I ever removed the reed only. still could not change the file. But like I said I got the older ver going and it is working fine. Thanks

slug
12-04-2010, 08:54 AM
I hate to even bring this up from so far back, but I can't create the hex file. I'm getting the error about a missing symbol at line 182. I don't have the strange square symbol that everyone said they saw. I'm using mpasmwin 5.11 . Any help?

kychristmas
12-04-2010, 09:05 AM
I believe you can download MPLab from the Microchip's website. You are going to find a great deal more support for that here. That said, I'm certain there are people here who may eventually chime in.

dirknerkle
12-04-2010, 09:28 AM
A lot of Windows folks would find mpasmwin a lot easier to use ;)

Wayne J
12-04-2010, 11:17 AM
I hate to even bring this up from so far back, but I can't create the hex file. I'm getting the error about a missing symbol at line 182. I don't have the strange square symbol that everyone said they saw. I'm using mpasmwin 5.11 . Any help?

Well, there has to be something wrong with line 182. Give this a try, it is the P16F688.inc from MPASMWIN v5.20

The path to use....
If using windows, path should be C:\Program Files\Microchip\MPASM
Suite.

www.jamesfamilychristmas.com/files/P16F688.INC

Be sure to copy the file that is in there now before you replace it with this one.