CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

delay function problem on 18F452

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
filjoa



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

delay function problem on 18F452
PostPosted: Wed May 05, 2010 9:17 am     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed May 05, 2010 11:28 am     Reply with quote

The typical reason for this problem is that your bootloader core program
was programmed for one frequency, and your application program is
set for a different frequency.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group