Hola, aquí adjunto el código de mi archivo main.c. Supongo que los "configuration bits" deberían estar definidos en el apartado DECLARATIONS pero como se aprecia no hay nada. Estoy un poco confuso porque en la primera página del post se comenta que los "Configuration bits" vienen definidos por defecto en el código pero es que en el que yo tengo no los veo por ninguna parte.
/*********************************************************************
*
* Microchip USB Bootloader Version 1.0
*
*********************************************************************
* FileName: main.c
* Dependencies: See INCLUDES section below
* Processor: PIC18
* Compiler: C18 2.30.01+
* Company: Microchip Technology, Inc.
*
* Software License Agreement
*
* The software supplied herewith by Microchip Technology Incorporated
* (the “Company”) for its PICmicro® Microcontroller is intended and
* supplied to you, the Company’s customer, for use solely and
* exclusively on Microchip PICmicro Microcontroller products. The
* software is owned by the Company and/or its supplier, and is
* protected under applicable copyright laws. All rights are reserved.
* Any use in violation of the foregoing restrictions may subject the
* user to criminal sanctions under applicable laws, as well as to
* civil liability for the breach of the terms and conditions of this
* license.
*
* THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
* WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
* TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
* IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
*
* Author Date Comment
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Rawin Rojvanit 11/19/04 Original.
********************************************************************/
/** I N C L U D E S **********************************************************/
#include <p18cxxx.h>
#include "system\typedefs.h" // Required
#include "system\usb\usb.h" // Required
#include "io_cfg.h" // Required
#include "system\usb\usb_compile_time_validation.h" // Optional
/** V A R I A B L E S ********************************************************/
#pragma udata
/** P R I V A T E P R O T O T Y P E S ***************************************/
/** V E C T O R R E M A P P I N G *******************************************/
#pragma code _HIGH_INTERRUPT_VECTOR = 0x000008
void _high_ISR (void)
{
_asm goto RM_HIGH_INTERRUPT_VECTOR _endasm
}
#pragma code _LOW_INTERRUPT_VECTOR = 0x000018
void _low_ISR (void)
{
_asm goto RM_LOW_INTERRUPT_VECTOR _endasm
}
#pragma code
/** D E C L A R A T I O N S **************************************************/
#pragma code
/******************************************************************************
* Function: void main(void)
*
* PreCondition: None
*
* Input: None
*
* Output: None
*
* Side Effects: None
*
* Overview: Main program entry point.
*
* Note: None
*****************************************************************************/
void main(void)
{
byte temp;
temp = ADCON1;
ADCON1 |= 0x0F;
//TRISBbits.TRISB4 = 1; // Reset value is already '1'
//Check Bootload Mode Entry Condition
if(PORTBbits.RB4 == 1) // If not pressed, User Mode
{
ADCON1 = temp; // Restore reset value
_asm goto RM_RESET_VECTOR _endasm
}//end if
//Bootload Mode
mInitAllLEDs();
mInitializeUSBDriver(); // See usbdrv.h
USBCheckBusStatus(); // Modified to always enable USB module
while(1)
{
USBDriverService(); // See usbdrv.c
BootService(); // See boot.c
}//end while
}//end main
#pragma code user = RM_RESET_VECTOR
/** EOF main.c ***************************************************************/
Por otra parte yo compilo con el mplab pero uso un programador ajeno para grabarlo en el PIC, ¿en este caso puedo definir directamente los "configution bits" en la pestaña "Configure/configution bits" o debo definirlos en el código obligatoriamente?
Gracias