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 CCS Technical Support

18F24j10 Delay time Error

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



Joined: 09 Sep 2006
Posts: 8

View user's profile Send private message

18F24j10 Delay time Error
PostPosted: Fri Sep 07, 2007 5:28 am     Reply with quote

I use PIC 18F24j10 with CCS 3.249 and MPLAPIDE 7.4

I try to use 18F24j10 with 20MHz Crytal and simple code like this

Code:
#include <18F24j10.h>

#fuses PRIMARY, HS,NOSTVREN,PROTECT,NOFCMEN,NOFCMEN,NOIESO, NOWDT

#use delay(clock=20000000)

#define LED_Load     Pin_B4

void main(){

   while(True){
      Output_low(LED_Load);
      delay_us(500);
      Output_high(LED_Load);
      delay_us(500);

   }

}


The problem is , I try to delay_ms(1000) for delay 1 second but it very long and long time no any change. So I try to change delay and finally set it to delay_us(500). Everything it ok, delay time is 1 second. I don't know why. I try to change this crytal to other pic path no(PIC18F86j15) , everything ok speed correctly. I assambly new broad and new path for 3 units and testing the problem it same.

I'm not sure, can problem on MPLAB configulation bit ? I configulation like this.


Watchdog Timer Enable : Disable
Stack Overflow Reset Enable : Disable
Enhanced CPU Enable : Disable
Code Protect Enable : Enable
Oscillator Select : HS OSC
Default/Reset System Clock Select : Clock Select by FOSC
Fail Safe Monitor Clock Enable : Enable
Internal External Switch Over Enable : Disable
Watchdog Timer Postscale : 1:32,768
CCP2 Mux : CCP2 I/O Muxed with RC1


Please advice me. How to do it with corretly.
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