Search code examples
cpic18xc8

no chip name specified; use "PICC18 --CHIPINFO"


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?


Solution

  • 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 !