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

CCS getting started with pic 12f629

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



Joined: 09 Nov 2007
Posts: 12

View user's profile Send private message

CCS getting started with pic 12f629
PostPosted: Fri Nov 09, 2007 2:07 pm     Reply with quote

Hi,
I´m a rookie in using pic controllers and even the simplest program
doesn´t work. For testing i only want to set high the Pins A0, A1 and A2,
but when I connect the pic to the demo board nothing happens.
(I am using the pic 12F629)
I hope you can give me a small start hint:

((.c data:))


#include "C:\Dokumente und Einstellungen\Sebastian.SEPPEL\Eigene Dateien\pic\test2.h"

void main()
{
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_comparator(NC_NC);
setup_vref(FALSE);

OUTPUT_HIGH(PIN_A0);
OUTPUT_HIGH(PIN_A1);
OUTPUT_HIGH(PIN_A2);
}



((.h data))

#include <12F629.h>

#FUSES NOWDT //No Watch Dog Timer
#FUSES LP //Low power osc < 200 khz
#FUSES NOCPD //No EE protection
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOMCLR //Master Clear pin used for I/O
#FUSES NOPUT //No Power Up Timer
#FUSES NOBROWNOUT //No brownout reset
#FUSES BANDGAP_HIGH
#use delay(clock=4000000)

((standard 12F629.h))

Thank you very much!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 2:19 pm     Reply with quote

Quote:
#FUSES LP //Low power osc < 200 khz
#FUSES NOCPD //No EE protection
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOMCLR //Master Clear pin used for I/O
#FUSES NOPUT //No Power Up Timer
#FUSES NOBROWNOUT //No brownout reset
#FUSES BANDGAP_HIGH
#use delay(clock=4000000)

Look at the comment on the oscillator fuse setting.

You need to change it to: INTRC_IO
Sebastian20000



Joined: 09 Nov 2007
Posts: 12

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 2:27 pm     Reply with quote

you mean instead of :
#FUSES LP //Low power osc < 200 khz
=>
#fuses INTRC_IO

can you explain what is the effect of this fuse?
I don´t find it in my manual...


quote: Thank you veryy much :-) it works
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 2:40 pm     Reply with quote

See this thread for an explanation:
http://www.ccsinfo.com/forum/viewtopic.php?t=31698
Sebastian20000



Joined: 09 Nov 2007
Posts: 12

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 2:50 pm     Reply with quote

ok, i got it.
stupid fault
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