Mplab (project building error)

Thread Starter

ect_09

Joined May 6, 2012
180
HI!
MY CODE IS GIVEN BELOW.
HERE IS THE PROBLEM WITH #INCLUDE <P18F452.INC>
WHAT IS THIS PROBLEM.???
Rich (BB code):
////////////////////

Processor 18f458
#include <18f458.INC>    
org 00
BCF     TRISB,5        
    MOVLW    0x08            
    MOVWF    T0CON            
HERE    MOVLW    0xFF            
    MOVWF    TMR0H            
    MOVLW    0xF2            
    MOVWF    TMR0L            
    BCF    INTCON, TMR0IF    
    BTG    PORTB,5        
    BSF     T0CON, TMR0ON    
AGAIN    BTFSS    INTCON, TMR0IF    
    BRA    AGAIN            
    BCF    T0CON, TMR0ON     
    BRA    HERE            
////////////////////////////////////
I ALSO ATTACH THE IMAGE OF ERROR PLEASE HELP ME.
ACTUALLY AM NEW WITH MPLAB.
 

Attachments

Last edited by a moderator:

DerStrom8

Joined Feb 20, 2011
2,390
What compiler are you using? In the build window, it looks like you're trying to use C18, but you wrote the code in ASM. Also, try including the .h instead of '.inc'

Or, another thought, try ".inc" rather than ".INC". I think it's case-sensitive.
 

t06afre

Joined May 11, 2009
5,934
Well metlab. It looks like the problem is that the inlude file 18f459.inc can not be found. Have you done a serch on your HD trying to locate it? If MPLAB is correct installed and you have made a project. MPLAB should have able to locate the correct inc file
 

t06afre

Joined May 11, 2009
5,934
What compiler are you using? In the build window, it looks like you're trying to use C18, but you wrote the code in ASM. Also, try including the .h instead of '.inc'

Or, another thought, try ".inc" rather than ".INC". I think it's case-sensitive.
Good catch I think metlab have selected the wrong toolsuite then creating the project. The correct toolsuite for an assembler project is "Microchip MPASM toolsuite"
 
Top