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

MCLR problem??

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








MCLR problem??
PostPosted: Fri Jun 24, 2005 7:33 am     Reply with quote

Hi all, i am very new to PIC, and have got a small problem. I have got a PICF877A. I am, for now, trying to flash a LED. I have got a 4MHz resinator, and the MCLR pin is high with a 10k and a .1uf cap. I have check for +5 on MCLR and it is OK. When i power on, the LED just stays on. I can make the thing work by touching the OCS1 pin with my bare hand, but when i let go, it will stop. I have also used a 20MHz crystal and a PICF84A without much luck. Here is my code just incase i am doing somthing wrong.


#include <16F877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)

void main() {
while (TRUE) {
output_high(PIN_A0);
delay_us(500);
output_low(PIN_A0);
delay_us(500);
}
}


Thank you very much

Mark Demczuk
Guest








PostPosted: Fri Jun 24, 2005 7:53 am     Reply with quote

The first thing I would do would be to change the delay_us to delay_ms since 500 us is .5 milliseconds - very fast. It would probably appear to be ON all of the time.
Markdem



Joined: 24 Jun 2005
Posts: 206

View user's profile Send private message Send e-mail

PostPosted: Fri Jun 24, 2005 8:08 am     Reply with quote

Thank you so much, i cant belive i did that. Set time to 2000 and it works

Mark
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Jun 24, 2005 10:42 am     Reply with quote

@4MHz you should be using XT instead of HS
Guest








Re: MCLR problem??
PostPosted: Thu Jan 26, 2006 2:27 am     Reply with quote

Anonymous wrote:
Hi all, i am very new to PIC, and have got a small problem. I have got a PICF877A. I am, for now, trying to flash a LED. I have got a 4MHz resinator, and the MCLR pin is high with a 10k and a .1uf cap. I have check for +5 on MCLR and it is OK. When i power on, the LED just stays on. I can make the thing work by touching the OCS1 pin with my bare hand, but when i let go, it will stop. I have also used a 20MHz crystal and a PICF84A without much luck. Here is my code just incase i am doing somthing wrong.


#include <16F877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)

void main() {
while (TRUE) {
output_high(PIN_A0);
delay_us(500);
output_low(PIN_A0);
delay_us(500);
}
}


Thank you very much

Mark Demczuk
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Jan 26, 2006 9:13 am     Reply with quote

The Guest phantom Quote poster has struck again....

One reason to get rid of Guest posting. Evil or Very Mad
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