help with mplab please!!!

Discussion in 'Programmer's Corner' started by Rk17, Apr 25, 2011.

  1. Rk17

    Thread Starter Member

    Apr 23, 2011
    43
    0
    helo its my first time to post here i really need some help regarding mplab. i cant compile a code in mplab ide; i use the hi-tech compiler; here is the code

    //////////////////////////////////////////////////////////////////////
    //
    // File: 16F84_led_flash.c
    //
    // Author: J F Main.
    //
    // Description:
    //
    // Flash an led at RB3
    //
    // Compiler : mikroC, mikroElektronika C compiler
    // for Microchip PIC microcontrollers
    // Version: 5.0.0.3
    //
    // Note Testing:
    //
    // Tested on 16F84
    //
    // Requirements:
    //
    // Target : 16F84
    //
    // Notes :
    //
    // Uses internal oscillator.
    //
    // Version:
    // 1.00 Initial release.
    //
    // Copyright : Copyright © John Main 2006
    // http://www.best-microcontroller-projects.com
    // Free for non commercial use as long as this entire copyright notice
    // is included in source code and any other documentation.
    //
    //////////////////////////////////////////////////////////////////////

    #include <htc.h>

    void main() {
    unsigned short pa=0;
    unsigned int i;


    PORTA = 0;
    TRISA = 0; // o/p - sets analogue pins to digital output

    TRISB = 0;
    PORTB = 0;

    while(1) {

    pa=~pa;
    if (pa) {
    setBit(PORTB,3);
    } else {
    resBit(PORTB,3);
    }
    Delay_ms(100);
    } ; // infinite while loop
    }


    ***ive tried to recompile but i got this error message

    >>_Delay_ms (16F84_LED_Flash.obj)_resBit (16F84_LED_Flash.obj)_setBit (16F84_LED_Flash.obj)

    ****what does it mean? im kind of new to programing please help me tnx to those concerned i really would appreciate it so much
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    The best place to ask this question is the Microchip HiTech C forum:
    http://www.microchip.com/forums/f231.aspx

    I don't use that specific compiler, and you didn't post the full error message as to WHY those lines caused a problem, but it looks like the code is good (the last ; is unnecessary but doesn't add code).

    However it looks like the link step is failing. Those 3 lines are all using code from some library that your compiler needs to be told about. How you add that is best asked in the other forum.
     
    Rk17 likes this.
  3. Rk17

    Thread Starter Member

    Apr 23, 2011
    43
    0
    ok tnx for the tip
     
Loading...