Mplab (project building error)

Discussion in 'Embedded Systems and Microcontrollers' started by ect_09, Jul 8, 2012.

  1. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    HI!
    MY CODE IS GIVEN BELOW.
    HERE IS THE PROBLEM WITH #INCLUDE <P18F452.INC>
    WHAT IS THIS PROBLEM.???
    Code ( (Unknown Language)):
    1.  
    2. ////////////////////
    3.  
    4. Processor 18f458
    5. #include <18f458.INC>    
    6. org 00
    7. BCF     TRISB,5        
    8.     MOVLW    0x08            
    9.     MOVWF    T0CON            
    10. HERE    MOVLW    0xFF            
    11.     MOVWF    TMR0H            
    12.     MOVLW    0xF2            
    13.     MOVWF    TMR0L            
    14.     BCF    INTCON, TMR0IF    
    15.     BTG    PORTB,5        
    16.     BSF     T0CON, TMR0ON    
    17. AGAIN    BTFSS    INTCON, TMR0IF    
    18.     BRA    AGAIN            
    19.     BCF    T0CON, TMR0ON    
    20.     BRA    HERE            
    21. ////////////////////////////////////
    22.  
    I ALSO ATTACH THE IMAGE OF ERROR PLEASE HELP ME.
    ACTUALLY AM NEW WITH MPLAB.
     
    • MP2.jpg
      MP2.jpg
      File size:
      198.5 KB
      Views:
      21
    Last edited by a moderator: Jul 8, 2012
  2. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    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.
     
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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"
     
  5. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    Thank you so much.
    you guide in a right a way.
    i have done it..
     
    DerStrom8 likes this.
  6. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    I am very glad to hear of your success! :)
     
  7. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    Thank you sir.
    its my pleasure,nice:)
     
  8. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    T0CON=0x08;
    TMR0H=0x35;
    TMR0L=0x00;
    i want to discuss them.please help me.
     
    Last edited: Jul 12, 2012
  9. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    and what is the difference between timer0,timer1,timer2...
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Have you read the datasheet? You can find relevant information here. In this case your question is to wide to answer. Be more specific:confused:
     
  11. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    >how to set the value of TMR0H and TMR0L;)
    >prescale of timer....
     
  12. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    It's all in the datasheet. It basically gives you the directions necessary to do it :D
     
Loading...