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

Internal OCS and 18f1220 not working as expected

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



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed May 23, 2007 2:15 pm     Reply with quote

Your program is too complicated for a test program. Try the program
shown below. Assuming that your PIC is running at +5v, this should work.
It will toggle an LED on pin B0. (The LED should have a series resistor.
Use a value from 220 to 470 ohms).
Code:

#include <18F1220.h>
#fuses INTRC_IO, NOWDT, BROWNOUT, PUT, NOLVP
#use delay(clock=8000000)

void main()
{

while(1)
  {
   output_high(PIN_B0);
   delay_ms(500);
   output_low(PIN_B0);
   delay_ms(500);
  }
}
jimcbride



Joined: 05 Apr 2006
Posts: 23

View user's profile Send private message

PostPosted: Wed May 23, 2007 2:28 pm     Reply with quote

This code also works and puts me at 7.95 MHz. I will poke through the fuses one ata time and see where the problem was. Is it possible to now use the 4x multiplier to get ~ 32MHz from the internal clock?
Ttelmah
Guest







PostPosted: Wed May 23, 2007 2:44 pm     Reply with quote

Not on this chip. Some others, do allow the PLL to be used with the internal oscillator (The 18F1330 for example), but on the 1220, the PLL is only available when using the external oscillator.

Best Wishes
jimcbride



Joined: 05 Apr 2006
Posts: 23

View user's profile Send private message

PostPosted: Thu May 24, 2007 3:38 pm     Reply with quote

Thanks much for your help. I have found that the debugger will give me slightly different mcu speed reading when connected in different circuits. i.e. my demo board shows it runs at 8MHz, where my actual circuit shows 7.95 MHz. This explains some of my previous confusion. 18F1330 samples are on order, thanks for pointing that chip out. I like the idea of running at 32MHz with no xtal. Now if I can just get these 1-wire chips talking to each other I will be the hero...
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