Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16F88 and MPLAB Help needed

Status
Not open for further replies.

GRC

New Member
Hi All
I find my self strugling with MPLAB and the Inchworm using the 16F88 PIC.
Can anyone tell me what files I need to use from MPLAB to get my project
running?
 
Have you read the Microchip tutorial?

There is also a help forum on the Microchip web site.
 
Perhaps I should have explained, what are the 2 files that are required from
MPASM (template, and ASM I think). Believe this is all that is left and the
project should "Build" without failing. The files I select seem to fail to "Bulid".

Thanks
Gordon
 
Hi
Yes I have read through the Quick Start Guide. However its puts the
example project together with an 18Fxxxx PIC. This example also shows
the 2 files that are required for the 18Fxxxx (.tmp and the .asm). This I
believe is where I have trouble. After selecting the 2 file I believe are needed
the Build option fails to build.
 
2 files that are required for the 18Fxxxx (.tmp and the .asm).
You should only need the .asm file. You can find some template files in the following directory:
C:\Program Files\Microchip\MPASM Suite\Template\Code
They will give you a good starting point for writing code for various PICs. Look for a file named f88temp.asm and copy it to a new location and use it to start your new project.
After selecting the 2 file I believe are needed
the Build option fails to build.
Cut and paste the error message and post it here so we'll be able to help you.
 
Last edited:
GRC. Can you post the error you are getting, that will help to figure out what files you are talking about.
 
Hi Kchristie
Did the process you recommended(which was one the 2 file I used before).
Still receive this error when attempting the "Build" process.

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "D:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F88 "f88temp.asm" /l"f88temp.lst" /e"f88temp.err"
Error[113] D:\PROGRAM FILES\MICROCHIP\MPASM SUITE\TEMPLATE\CODE\F88TEMP.ASM 46 : Symbol not previously defined (_WRT_ENABLE_OFF)
Error[173] D:\PROGRAM FILES\MICROCHIP\MPASM SUITE\TEMPLATE\CODE\F88TEMP.ASM 102 : Source file path exceeds 62 characters (D:\PROGRAM FILES\MICROCHIP\MPASM SUITE\TEMPLATE\CODE\F88TEMP.ASM)
Halting build on first failure as requested.
BUILD FAILED: Sun Dec 24 17:13:13 2006

Any ideas where I'm going wrong?
Thanks for the reply Kchristie

Gordon
 
The second error (Error[173]) leads me to believe that you should create a new folder on D: with a shorter path.
Something like this:
D:\Mplab\F88
Then copy the file F88TEMP.ASM to the above directory and open it with MPLAB from there and compile it.
I also get a build error if I try to compile directly in the ....Template\Code\ directory but I moved my files out of there long ago. I never store any working files under C:\Program Files\etc anymore after losing stuff by accidental deletion when I upgraded from some version to another.
 
Last edited:
I'll give your suggestion a try. By the way the _WDT_etc was also giving an
error. Any thoughts as to why.
 
It says the symbol was not defined, so it sounds like you typed the symbol name in wrong. Search the forum for __config and look at others programs.

And the path is too long on the other error? Are you running Windows XP?
 
Yes XP is being used. The symbol is used in the "F88TEMP.ASM" file and is
not defined by me. Is this a problem?
 
Symbol not previously defined (_WRT_ENABLE_OFF)
Have you modified the file at all? Because the file I have doesn't have this statement in it.
Here is the listing from the file on my computer which compiles fine:

Code:
	list      p=16f88           ; list directive to define processor
	#include <p16F88.inc>        ; processor specific variable definitions

	errorlevel  -302              ; suppress message 302 from list file

	__CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO
	__CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF

; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
; See data sheet for additional information on configuration word settings.




;***** VARIABLE DEFINITIONS
w_temp        EQU     0x71        ; variable used for context saving 
status_temp   EQU     0x72        ; variable used for context saving
pclath_temp   EQU     0x73	  ; variable used for context saving





;**********************************************************************
	ORG     0x000             ; processor reset vector
	goto    main              ; go to beginning of program
	

	ORG     0x004             ; interrupt vector location
	movwf   w_temp            ; save off current W register contents
	movf	STATUS,w          ; move STATUS register into W register
	movwf	status_temp       ; save off contents of STATUS register
	movf	PCLATH,W	  ; move PCLATH register into W register
	movwf	pclath_temp       ; save off contents of PCLATH register

; isr code can go here or be located as a call subroutine elsewhere


	movf    pclath_temp,w     ; retrieve copy of PCLATH register
	movwf	PCLATH            ; restore pre-isr PCLATH register contents
	movf    status_temp,w     ; retrieve copy of STATUS register
	movwf	STATUS            ; restore pre-isr STATUS register contents
	swapf   w_temp,f
	swapf   w_temp,w          ; restore pre-isr W register contents
	retfie                    ; return from interrupt


main

; remaining code goes here



; initialize eeprom locations

	ORG	0x2100
	DE	0x00, 0x01, 0x02, 0x03


	END                       ; directive 'end of program'
 
You shouldn't get the symbol not defined error as the symbols are included in the p16F88.inc file which is included in the line #include <p16F88.inc>.

To get a workable file do the following.

Make a new folder on drive C called MyPicProjects.
Open MPLAB and run the project wizard.
Select 16F88
Select MPASM toolsuite
For Project name type Test
For Project Directory browse to MyPicProjects
Don't add any files yet.
Select finish.

Now go to file\add new file to project
Type Test.asm as the new file name.

You now should have an empty window called test.asm

Using something like notepad open f88temp.asm and cut and paste all the code into the blank file window.

Press F10 and you should have a project that assembles correctly.

Mike.
 
Oh! I will load it here and see what happens.

Works fine, you have the configure_device set to 16F88? Are you running MPLABS 7.50? The file with mine works fine.

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F88 "f88temp.asm" /l"f88temp.lst" /e"f88temp.err"
Loaded D:\pic\f88temp.COD.
BUILD SUCCEEDED: Sun Dec 24 19:45:48 2006

Code:
    list      p=16f88           ; list directive to define processor
    #include <p16F88.inc>        ; processor specific variable definitions

    errorlevel  -302              ; suppress message 302 from list file

    __CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO
    __CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF

; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
; See data sheet for additional information on configuration word settings.




;***** VARIABLE DEFINITIONS
w_temp        EQU     0x71        ; variable used for context saving 
status_temp   EQU     0x72        ; variable used for context saving
pclath_temp   EQU     0x73      ; variable used for context saving





;**********************************************************************
    ORG     0x000             ; processor reset vector
    goto    main              ; go to beginning of program
    

    ORG     0x004             ; interrupt vector location
    movwf   w_temp            ; save off current W register contents
    movf    STATUS,w          ; move STATUS register into W register
    movwf    status_temp       ; save off contents of STATUS register
    movf    PCLATH,W      ; move PCLATH register into W register
    movwf    pclath_temp       ; save off contents of PCLATH register

; isr code can go here or be located as a call subroutine elsewhere


    movf    pclath_temp,w     ; retrieve copy of PCLATH register
    movwf    PCLATH            ; restore pre-isr PCLATH register contents
    movf    status_temp,w     ; retrieve copy of STATUS register
    movwf    STATUS            ; restore pre-isr STATUS register contents
    swapf   w_temp,f
    swapf   w_temp,w          ; restore pre-isr W register contents
    retfie                    ; return from interrupt


main

; remaining code goes here



; initialize eeprom locations

    ORG    0x2100
    DE    0x00, 0x01, 0x02, 0x03


    END                       ; directive 'end of program'
 
Last edited:
kchriste said:
Have you modified the file at all? Because the file I have doesn't have this statement in it.

I should have checked. I assumed that the file was unmodified. My copy of the file doesn't have the _WRT_ENABLE_OFF symbol either.

Mike.
 
Hi Guys and thanks for the replies.
I'm using MPLAB 7.11, maybe its time to upgrade. The holidays and company
at my home are at the moment are preventing me from doing alot of testing. But thanks for help. I'll let you know how it goes when my family/company leaves.

Gordon
 
Hey Guys
Hope you had a good holiday.
Well still struggling with this MPLAB. Gave all the suggestions a go still receive
the same errors.

Perhaps I should go back and do everthing all over including a fresh install
of MPLAB.

If you can think of any tips I'd be more than happy to hear them.
Thanks for the help guys. Its time to regroup and figure out where I'm
going wrong.

Gordon
 
GRC.. Without reading the whole thread again..

A couple of us went to help and found your template .ASM did not match ours. Uninstall yours and pull MPLABS 7.5.. I have used 7.5 for weeks and not a problem at all (other than my mistakes)

You have symbols that we did not have.

EDIT: Go look at Dec 24th 7:42 - 7:48AM. Cut and paste that code from one of us and paste it in and do a quick build with that.. Or again, reinstall it.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top