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

pic18f452 and 184520 please help

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



Joined: 23 Aug 2005
Posts: 22

View user's profile Send private message

pic18f452 and 184520 please help
PostPosted: Fri Mar 10, 2006 8:40 am     Reply with quote

Hi,

I am using the PIC18F452-I/P chip, I have the CCS PCWH compiler, and in the devices folder there is no device header file for the 18F452, there is only one for the 4520.

I have used the 18f4520 header anyway, and my program isn't running (i'm also trying to use the internal oscillator for the first time so perhaps this might the cause, i've written a very simple program and it doesnt run), I know that there are difference with the ADCON1 and so on, what do I do?? Is there a way to get the 452 header file?

Thanks.

My code for the simple test program
Code:

#include <18F4520.h>
#fuses NOWDT,INTRC_IO, NOPUT, NOMCLR, BROWNOUT, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
#use delay(clock=4000000)

void main()
{

setup_oscillator(OSC_4MHZ);
setup_comparator(NC_NC_NC_NC);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);


   /***start test sequence***/

   while(TRUE)
   {
      output_high(PIN_A0);
      delay_ms(1000);
      output_low(PIN_A0);
      delay_ms(1000);
   }

}

qleyo



Joined: 23 Aug 2005
Posts: 22

View user's profile Send private message

PostPosted: Fri Mar 10, 2006 9:25 am     Reply with quote

Ok apologies, I found the 18F452.h file. It doesnt seem to have setup oscillator parameters i.e. OSC_4MHZ I copied and pasted the defines from another header file.

However, my code still does not work.
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Fri Mar 10, 2006 9:27 am     Reply with quote

I don't think the '452 has an internal oscillator.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Mar 10, 2006 11:29 am     Reply with quote

The 452 does Not have an internal oscillator. It requires and external clock source of some kind. If you have the Compiler IDE, look at Valid Fuses, in the View menu, to see what fuses you can use.

Ronald
qleyo



Joined: 23 Aug 2005
Posts: 22

View user's profile Send private message

PostPosted: Tue Mar 14, 2006 7:32 am     Reply with quote

:'( oh my goodness

So i need an external RC :'( I'm losing my mind!
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Tue Mar 14, 2006 1:57 pm     Reply with quote

Well why don't you just use the 4520 then? They are similiar enough, and Microchip wants you to use the 4520 for new designs instead of the 452
qleyo



Joined: 23 Aug 2005
Posts: 22

View user's profile Send private message

PostPosted: Thu Mar 16, 2006 4:30 am     Reply with quote

I would have sworn I ordered the 4520 but obviously got the 452, uni pays for all this stuff so I can't exactly just order another one :(

On the contrary they had a 4mhz crystal lying around, and I managed to get a millenium board off the component store, so I chucked that in and now working on a prototype before I revisit trying to get my hardware to work.

And to think I've been looking at the 4520 datasheet for the last 3 months :s
Now to my AT commands problem :'(
SLomas
Guest







PostPosted: Thu Mar 16, 2006 5:39 am     Reply with quote

If the cost of buying the 4520 is a problem then try samples from Microchip. This service is provided to allow us to evaluate the devices. The price is right (gratis) and the delivery is normally pretty good. Just don't abuse the service otherwise they might restrict it.
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