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

Plz help me with INTERNAL OSC

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



Joined: 23 Feb 2008
Posts: 35

View user's profile Send private message

Plz help me with INTERNAL OSC
PostPosted: Tue Aug 26, 2008 11:05 am     Reply with quote

Plz Help me to config 18f2525 to use Internal oscillator at 8MHz and 32MHz.
Here is my test code.
I tested with Proteus to simulate my program.

Code:
#include <18F2525.h>
 #fuses NOWDT, HS, NOPUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP
 #use delay(clock=8000000)
 
 void main()
 {   setup_oscillator(OSC_8MHZ|OSC_INTRC|OSC_PLL_OFF);
 set_tris_a(0x00);
 output_A(0x00);

while(1)
{
   output_high(PIN_A6);
   output_low(PIN_A7);
   delay_ms(500);
   output_high(PIN_A7);
   output_low(PIN_A6);
   delay_ms(500);
}
 }
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Tue Aug 26, 2008 12:17 pm     Reply with quote

Try changing your HS fuse to INTIO2. That will enable the internal oscillator with regular I/O on pins RA6 & RA7.

Also, setting the TRIS does nothing unless you also specify FAST_IO.

Ronald
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Aug 27, 2008 8:06 am     Reply with quote

rnielsen wrote:

Also, setting the TRIS does nothing unless you also specify FAST_IO.


I would note that few programmers need either TRIS or FAST_IO. Just let the compiler take care of things with the default STANDARD_IO unless you see a need to change it.
_________________
The search for better is endless. Instead simply find very good and get the job done.
HTAluvBeBeo



Joined: 23 Feb 2008
Posts: 35

View user's profile Send private message

PostPosted: Wed Aug 27, 2008 10:55 am     Reply with quote

INTIO2 is an invalid fuse with 18F2525
My complier version is 4.020

I found the answer:D
the correct fuse probably is INTRC_IO
Is it right?:D
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Tue Sep 02, 2008 8:34 am     Reply with quote

Sorry, I simply looked at the spec sheet and it stated INTIO2 as the fuse. After looking at the .h file it states to use INTRC_IO so you're correct. I guess the two don't always use the same wording.

Ronald
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