filjoa
Joined: 04 May 2008 Posts: 260
|
delay function problem on 18F452 |
Posted: Wed May 05, 2010 9:17 am |
|
|
hi
Today I try make this simple program with an 18F452 at 20Mhz, but when I write delay_ms(1000) comand my led flash quickly and not with +- 1sec.
Have any problem on 18F452 library?
Code: |
#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,BROWNOUT,STVREN
#use delay(clock=20000000)
#use rs232(baud=115200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
#build(reset=0x200)
#build(interrupt=0x208)
#org 0x0000,0x01ff
void bootloader() {
#asm
nop
#endasm
} // Reserve space for the bootloader
void main(void)
{
while(TRUE)
{
output_high(PIN_B7);
delay_ms(1000);
output_low(PIN_B7);
delay_ms(1000);
}
}
|
Best regards |
|