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

New to PIC12F. OSC and pullup questions

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



Joined: 24 Nov 2008
Posts: 2

View user's profile Send private message

New to PIC12F. OSC and pullup questions
PostPosted: Thu Jul 15, 2010 2:27 pm     Reply with quote

This is my CCS / PIC12F510 project. The program logic is OK. I am having trouble with setting up the the following.
1. Setting the oscillator to 4MHZ.
2. I have not enabled the a/d or timer functions. Do I need to disable anything to use the pins as general purpose.
3. I need to to set the MCLR as general purpose I/O.
4. Does output_high or output_low set the tris register?
5. I found setup_WDT(WDT_576MS); and restart_wdt();. Anything else to

My basic problem is I am not used to the CCS compiler so I am having switch from direct control of registers to the CCS way.
jbmiller



Joined: 07 Oct 2006
Posts: 73
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jul 15, 2010 2:44 pm     Reply with quote

Here's the 'front end stuff I use for my 12F683 projects...
Code:

#include <12f683.h>
#fuses INTRC_IO,NOWDT,NOPUT,NOPROTECT,NOMCLR
#use delay(clock=4000000)                // 4MHz xtal
// end of processor specific stuff

...it should help you a bit
the #fuses options are as follows
use internal RC osc allowing xtal pins to now be I/O pins
do NOT use WatchDogTimer
do NOT use PowerUpTimer
do NOT protect pgm memory
do NOT use external MClr allowing that pin to be an I/O pin

hope this helps

remember start with small programs first 'led blinking, hello world' stuff then test and add 'modules' as required.

hope this helps
Jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 15, 2010 2:59 pm     Reply with quote

Use the forum's search page to search for 12F510.
There are several threads that can help. Example:
http://www.ccsinfo.com/forum/viewtopic.php?t=33435
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