View previous topic :: View next topic |
Author |
Message |
Sebastian20000
Joined: 09 Nov 2007 Posts: 12
|
CCS getting started with pic 12f629 |
Posted: Fri Nov 09, 2007 2:07 pm |
|
|
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
|
|
Posted: Fri Nov 09, 2007 2:19 pm |
|
|
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
|
|
Posted: Fri Nov 09, 2007 2:27 pm |
|
|
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
|
|
 |
Sebastian20000
Joined: 09 Nov 2007 Posts: 12
|
|
Posted: Fri Nov 09, 2007 2:50 pm |
|
|
ok, i got it.
stupid fault |
|
 |
|