#include <18f2550.h>
#use delay(clock=48000000)
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN, NOPBADEN
void main()
{
set_tris_b(0x00);
while(true)
{
output_high(PIN_B5);
output_low(PIN_B4);
delay_ms(500);
output_high(PIN_B4);
output_low(PIN_B5);
delay_ms(500);
}
#include <18f2550.h>
#fuses HS,NOWDT,NOPROTECT,NOPUT
#use delay (clock = 20000000)
#use fast_io(B)
void main()
{
set_tris_b(0x00);
while(true)
{
output_high(PIN_B5); //enciende LED1
output_low(PIN_B4); //apaga LED2
delay_ms(1000);
output_high(PIN_B4); //enciende LED2
output_low(PIN_B5); //apaga LED1
delay_ms(1000);
}
}
clock=speed speed is a constant 1-100000000 (1 hz to 100 mhz).
This number can contains commas. This number also supports the following denominations: M, MHZ, K, KHZ. This specifies the clock the CPU runs at. Depending on the PIC this is 2 or 4 times the instruction rate. This directive is not needed if the following type=speed is used and there is no frequency multiplication or division.
Son dos LEDS que encienden intermitentemente, ya volví a ajustar y puse un Crystal de 20Mhz externo y el problema es que quiero que encienda 1s y tarda 4s aproximadamente, lo cronometré
Este es mi nuevo codigo:Código: [Seleccionar]
#include <18f2550.h>
#fuses HS,NOWDT,NOPROTECT,NOPUT
#use delay (clock = 20000000)
#use fast_io(B)
.....