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
Posted: Thu Jul 15, 2010 2:44 pm
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.
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