|
|
View previous topic :: View next topic |
Author |
Message |
Guest
|
|
Posted: Fri Jul 16, 2004 12:10 pm |
|
|
A program as simple as the following by have the program error like I posted as the beginning, is not a problem of program as I guess, it is about some setting. So far I have not gotten any very good suggestion to make it work, anyone, please, I kind of frustrated with my self talking to myself, struggling myself here for more than one day without a solution!
please
Code: |
#if defined(__PCM__)
#include <12F675.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
void main()
{
while(1)
{
output_high(pin_a1);
delay_ms(250);
output_low(pin_a1);
delay_ms(250);
}
}
|
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jul 16, 2004 3:27 pm |
|
|
If you did a search on the forum for 12F675, you would see lots
of posts. In almost all of these posts, you will see a sample program.
At the beginning of the sample program, they always turn off the
comparators, so that the pins can be used for normal i/o. This should
be considered an important clue, regarding the operation of the chip.
If you have a recent version version of the compiler, then the following
CCS function should turn them off successfully:
setup_comparators(NC_NC_NC_NC);
If you have an older version of the compiler, the built-in function
may not work. In that case, look at the previous posts for a method
of turning off the comparators. (Search the board for 12F675 to find
these posts). |
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Mon Jul 19, 2004 7:29 am |
|
|
THank you all guys:
By struggling for a while, I finally what caused the programming errors. Just as my first guessing, it is hardware configuration, however this time it is not because of software programming, it is caused by hardware wiring. for the PICEasy2, I have to set the jumpers on board to 8PIN position, which I have nevere thought about.
Best wishes for you all! |
|
|
|
|
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
|