2

I did a simple program to light a led.

#define _XTAL_FREQ 19660800
#define USE_AND_MASKS
#include <xc.h>
#include <pic18f46k22.h>
#include <stdio.h>
#include <stdlib.h>

void main(void) {
    TRISA=0;
    PORTA=0;
    PORTA=0x5A;
    while (1)
    {   
    }
}

I use a PIC18F46k22 and a XC8 compiler. The issue is that when I compile the program the compiler gives the message no chip name specified; use "PICC18 --CHIPINFO"

Do you know where is the problem?

Mekap
  • 2,065
  • 14
  • 26
keating
  • 23
  • 1
  • 3

1 Answers1

1

When you compile, add --chip=18f452 to your compilation flag. That should do the trick.

Basically you need to tell your compiler what kind of chip you're willing to work with, since XC8 can build for different kinds of chip.

Have fun with thoses chips anyway !

Mekap
  • 2,065
  • 14
  • 26
  • I´m using MPLAB IDE v8.83 and I´m not sure where I should to add this command, In build options? Thank you for your help and encouraged – keating Apr 28 '15 at 14:17
  • I did not use MPLAB but i'd sugest you should look into the build option and for "compiler arguments", and then add the line i wrote. Here, look there for adding the option : https://microchip.wikidot.com/mplabx:configure-project-build-options – Mekap Apr 28 '15 at 14:18