Hola. esto tratando de configurar el pic18f2550, uso un cristal de 20 Mhz para manejar el modulo usb y para las operaciones del pic uso el oscilador interno. para observar el correcto funcionamiento deje un led que debe encender y apagar cada 500 ms, el problema es que tarda como 15 seg en realizar el ciclo y la unica forma de llevarlo a los tiempos que deben ser es bajando el delay clock a 1Mhz no se donde esta el problema. creo q debe ser el compilador estoy usando ccs 4.104.
estos son los fuses que me genera:
estos son los fuses que me genera:
Código:
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES INTHS //Internal Oscillator, HS used by USB
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //No brownout reset
#FUSES BORV20 //Brownout reset at 2.0V
#FUSES NOPUT //No Power Up Timer
#FUSES NOCPD //No EE protection
#FUSES STVREN //Stack full/underflow will cause reset
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT //Program memory not write protected
#FUSES NOWRTD //Data EEPROM not write protected
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES PBADEN //PORTB pins are configured as analog input channels on RESET
#FUSES NOWRTC //configuration not registers write protected
#FUSES NOWRTB //Boot block not write protected
#FUSES NOEBTR //Memory not protected from table reads
#FUSES NOEBTRB //Boot block not protected from table reads
#FUSES NOCPB //No Boot Block code protection
#FUSES MCLR //Master Clear pin enabled
#FUSES LPT1OSC //Timer1 configured for low-power operation
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES PLL5 //Divide By 5(20MHz oscillator input)
#FUSES CPUDIV1 //No System Clock Postscaler
#FUSES USBDIV //USB clock source comes from PLL divide by 2
#FUSES VREGEN //USB voltage regulator enabled
#use delay(clock=20000000)
y el codigo es el siguiente:
#use fast_io(B)
void main()
{
set_tris_B(0x00);
output_B(0x00);
delay_ms(100);
while (true) {
output_B(0XFF);
delay_ms(500);
output_B(0x00);
delay_ms(500);
}
}
Última edición por un moderador: