Jump to content
Sign in to follow this  
mityeltu

Delay Timing

Recommended Posts

I have run into this in the past, but I can't remember exectly what I did to fix it. I am finding that the delay_s(4) gives me exactly half the time I specified. I seem to remember that I fixed this by making sure the _XTAL_FREQ was properly defined and that the osccon register was properly set. I have both set for 8MHz. I also have made sure that the configuration bits are set correctly for internal oscillator. but I am still getting 2 seconds delay from the instruction above. Is there something else I need to do? hat have I missed? I'm using pic18f4620 if it makes any difference.

Share this post


Link to post
Share on other sites

Dangit. Never mind. found the problem. the pragma is not properly set for CLOCK_FREQ. I was using the _XTAL_FREQ as a defined constant in the code. I hate it when I do this. My bad.

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×