Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Problem in programming pic MCUs

Blockquote

CLEAN SUCCESSFUL (total time: 1ms)
C:\Program Files\Microchip\xc8\v2.32\pic\bin\picc -mcpu=18F45K50 -c -mdfp=C:/Users/Admin/.mchp_packs/Microchip/PIC18F-K_DFP/1.5.114/xc8 -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,–data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o build/default/production/test2_csource.p1 test2_csource.c
(908) exit status = 1
nbproject/Makefile-default.mk:107: recipe for target ‘build/default/production/test2_csource.p1’ failed
nbproject/Makefile-default.mk:91: recipe for target ‘.build-conf’ failed
nbproject/Makefile-impl.mk:39: recipe for target ‘.build-impl’ failed
(902) no chip name specified; use “XC8 --CHIPINFO” to see available chip names
make[2]: *** [build/default/production/test2_csource.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 956ms)

Blockquote

strong text
This is the message I am getting for any main.c program clean and build command. I discussed with Microchip Engr. reg. versions I am using for MP LAB Xide5.5, , xc8 ver 2.32. she agreed no problem by this. CCS gives message your compiler is expired on this computer, purchaseXC8 compiler. Any body who has gone th’ this problem pl. help me.
Waiting to hear from you.

Hello. It looks like XC8 is not receiving the --chip=18F45K50 argument that it needs, but I do not see the XC8 command in your build output so I am not sure what is going on. I have used MPLAB X and XC8 before but I have not seen any problems like this. If you have not done so already, you might try creating a totally new project in MPLAB X.

–David

Thanks for ur interest in replying to me. This problem started after copying 5 examples into the project. Or may be it is about 60 days after installing free XC8, this is programmed to stop doing compiling. Also CCS message says XC8 compiler ie expired on this system either reinstall or purchase XC8. After reinstalling XC8 and MPlab 5.5 same story. Microchip has replied to down load free compiler in a different method. I will try and let you know what happens.
Bye for now.

micro chip is also viewing, Mr. Giann is looking it. They say XC8 is full free in the google. but no compiling is happening. I am attaching some screen shots . Pl. see any thing I am missing to do while using the MPLAB. Also I have not yet connected PICKIT3/4 to o/p device, will this create any problem for generating hex file?

/*

  • File: source_vinod_controller.c
  • Author: Admin
  • Created on 16 November, 2021, 11:33 PM
    */
    // PIC16F877A Configuration Bit Settings

// ‘C’ source line config statements

// CONFIG
#pragma config FOSC = EXTRC // Oscillator Selection bits (RC oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = OFF // Brown-out Reset Enable bit (BOR disabled)
#pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)

// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.

#include <xc.h>

#include <xc.h>

    unsigned int c1;// call for g                        connected to RA0

unsigned int c2;// call for 1 -------"—RA1
unsigned int c3;// call for 2 -------"—RA2
unsigned int usl;// Reed for slowdn., indicator changing RA3
unsigned int pups = 0;//previous up reed
unsigned int dsl;// ------"---------------- RA4
unsigned int pdns = 0;//previous dn reed
unsigned int dts;// dn.terminal slowdn. limit sw. RA5
unsigned int uts;// up-------------------"-------- RA6
unsigned int dns;// down normal stop limit sw. RA7
unsigned int pi1;// pi i/p lsb ------ ------ RB0
unsigned int pi2;// —"-- msb RB1
unsigned int dz;// door zone reed ------ ---- RB2
unsigned int po1;// pi o/p lsb RC0
unsigned int po2;// -----"---- RC1
unsigned int up;// up relay actvn. RC2
unsigned int dn;// dn ----"---- RC3
unsigned int hsu;// high speed actvn.4 up dir. RC4
unsigned int hsd;// -------"---------- dn dir. RC5
unsigned int rs1;// reset c1 call RD0
unsigned int rs2;// reset c2 call RD1
unsigned int rs3;// reset c3 call RD2
void uptravel()
{RC2 = 1;//up relay on
RC4 = 1;//hsu on
if(RA3 && !pups )//upslow reed on -------indicator setting
{pups = 1;
if(RB0 && !RB1)//car at g
{RC0=0; RC1=1;}//pi set to 1st fl.
if(!RB0 && RB1)//car at 1
{RC0=1; RC1=1;}//pi set to 2nd fl.
}
if(RA3==0 && pups ==1)//reset pups
{ pups = 0;}//reset pups // ----------------------"---------------"
if (RA1 && !RB0 && RB1)//car slowed dn at 1st fl 4 1st fl.call
{RC4=0;}//hsu off
if (RA1 && !RB0 && RB1 && RB2)//car stop at 1st fl dz=1
{_Delay(500)
RC2 = 0; RD1=1;//up contctr. off, reset c2 call on------"----------
_Delay(2000);
RD1=0;}//end of 1st fl. call process
if ((RA2 && RB0 && RB1)||(RA6))//car slowed dn at 2nd fl 4 top fl.call with uts
{RC4=0;}//hsu off
if (RA2 && RB0 && RB1 && RB2)//car stop at 2nd fl
{_Delay(500)
RC2 = 0;RD2=1; // up relay off, reset of c3 start ----"----------
_Delay(2000);
RD2=0;}
}//

void dntravel()
{RC3 = 1;//dn relay
RC5 = 1;//hsd on

if(RA3 && !pdns )//dn slow reed on -------indicator setting
{pdns = 1;
if(RB0 && RB1)//car at 2
{RC0=0; RC1=1;}//pi set to 1st fl.
if(!RB0 && RB1)//car at 1
{RC0=1; RC1=0;}//pi set to g fl.
}
if(RA3==0 && pdns ==1)//reset pups
{ pdns = 0;}//reset pups // ----------------------"---------------"
if (RA1 && !RB0 && RB1)//car slowed dn at 1st fl 4 1st fl.call
{RC5=0;}//hsd off
if (RA1 && !RB0 && RB1 && RB2)//car stop at 1st fl, dz=1
{_Delay(500)
RC3 = 0; RD1=1;//dn off, reset RA1(c2) --------------"----------
_Delay(2000);
RD1=0;}
if ((RA0 && RB0 && !RB1)||(RA5))//car slowed dn at g fl 4 g fl.call with dts
{RC5=0;}//hsd off
if (RA0 && RB0 && !RB1 && RB2)//car stop at g fl dz=1
{_Delay(500)
RC3 = 0; RD0=1;//dn relay off,reset at g on --------------"----------
_Delay(2000);
RD0=0;} }

void main(void) {

{
ANSELA =0;//SET ALL PORT A BITS DIGITAL
ANSELB =0;// -----"-----B —"-----

TRISC =0x00; //set port C pins as a digital output pin
TRISD =0x00; //set port D pins as a digital output pin
TRISA =0xFF; //set port A pins as a digital i/p pins
TRISB =0xFF; //set port B pins as a digital ----"—
RD0=0; RD1=0; RD2=0;
while(1)
{if((RA2 && !RB0)||(RA2 && !RB1)||(RA1 && !RB1))//2nd fl.callRA2,1st fl.call RA1
{uptravel;}
if((RA0 && RB1)||(RA1 && RB0 && RB1)||(RB0==0 && RB1==0))//g callRA0,1st fl. callRA1,ind. setting
{dntravel;}

/*RC0 = 1;                  // set RC0 pin to logic High &  turn on 

__delay_ms(1000); //add delay of 1 second
RC0 = 0; // set RC0 pin to logic low & turn off
__delay_ms(1000); //add delay of 1 second
*/

}
return;
}

This is the program I am trying to build on 16f887. But can not build the code. I am very small business man I can not afford to buy dongle or work station now. Pl. see i want to use now for two controller constn. if pic is not free software. I have to try for Arduino or any other free software. how about Arm? Is arduino good for professional work? many people say it is for school projects or hobby work like that. Also I am doing some periferal ckt. since i don’t need to have infinite loop working 24/7, when there is a call it should turn on the MCU and start the loop, after about 10mts. if no call is registered for elevator then MCU shoud stop the loop and stay on standby, is it possible to use sleep mode for this work or can i stop vcc to the MCU if no call is registered with in 10 mts.? Pl. see and solve this issue also.

Waiting to hear from you.

Hi…You should seriously mull over better capacity to the PIC. Carry +5V and GND to the PIC by means of the transports on the proto board then, at that point, associate Vdd/Vss with short wires. Decouple Vdd/Vss as near the PIC as conceivable with a 1uF tantalum cap in corresponding with a .1 clay. Ordinarily, PICs will run OK with practically any hookup however since you are having issues, it’s anything but a poorly conceived notion.

Make certain to really look at the fundamentals, power supply voltage, GND and so on Ensure Vpp can go high without fouling your 5V controller (in spite of the fact that assuming it consistantly programs and checks, it’s likely OK). Check the oscillator is running.

Dear Sir, I am sorry to hear the news about COVID19 situation in USA. Let us pray God to do what is good for USA.

reg. the project:

I could able to resolve the software issue, me & my son deleted 5,6 projects and worked on only one blinking LED and also we reloaded MP LAB5,5, XC8 v 2.32. Now it is working alright. I have some following issues to be clarified from you people.

  1. I am using 16f877a, is it ok, or better to change for a later one?

  2. Do I need MCU to be on power down mode, till any external call comes for elevator then while(1) loop starts? If the cpu is running 24/7, would it reduce the life of MCU? I need design as simple as possible, so pl. suggest me should i include power down mode or sleep mode or keep MCU running 24/7 . power supply saving is not required, since it is fed by mains power not from batteries.

  3. I am using directly port names in if statements is it OK for input ports? or is there any different method to sense state of i/p ports to some user defined names like C1=RA0 etc.? I am attaching the snap shot of the program for more details.

  4. I am attaching some snap shots of the program and error message generated, pl. see how can I build it successfully.

Waiting for your reply,