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 support@ccsinfo.com

RA4 can't turn ON/High for PIC16F628A

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



Joined: 03 Mar 2008
Posts: 8

View user's profile Send private message

RA4 can't turn ON/High for PIC16F628A
PostPosted: Thu May 01, 2008 7:03 am     Reply with quote

i have a problem of turing ON/High RA4 for PIC16F628A. RA4 pin is always at Low or 0V.
As i know, this pin (RB4) also can function as T0CKI and CMP2.
i think the problem might be due to by default this pin(RA4) is set to other function but not as I/O pin.
So is anyone can help me to change this pin (RA4) to I/O pin, so that i am able to set this pin to turn High or Low.Tx.
Below is my source code and circuit's picture, please kindly refer it. Tx.

Code:

#include <16F628A.h>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP,INTRC_IO
#use delay(clock=4000000)
void main()
{
   set_tris_a(0b00000000);
    output_a(0b00000000);
      while (true)
    {         

   output_a(0b11111111);
    }
}

Circuit picture link:http://www.imagehosting.com/show.php/1726932_pic16f628a.JPG.html
mskala



Joined: 06 Mar 2007
Posts: 100
Location: Massachusetts, USA

View user's profile Send private message

PostPosted: Thu May 01, 2008 7:15 am     Reply with quote

RA4 is open drain, you will need to pull it up.
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Thu May 01, 2008 7:19 am     Reply with quote

Look at the data sheet for this PIC RA4 is open drain. If you are not aware of this then that will probably be your issue. This board has numerous postings about open drain pins.
Gerhard



Joined: 30 Aug 2007
Posts: 144
Location: South Africa

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

PostPosted: Thu May 01, 2008 7:20 am     Reply with quote

Is the other pins on port working correctly or are you having problems with the whole port?
EricKoh1985



Joined: 03 Mar 2008
Posts: 8

View user's profile Send private message

PostPosted: Thu May 01, 2008 11:15 am     Reply with quote

Quote:

RA4 is open drain, you will need to pull it up.

i connect 5V supply to a 1k resistor then series connection to LED. Another end of LED is connect to RA4.
Thanks for your advice. My problem solved.

Quote:

Is the other pins on port working correctly or are you having problems with the whole port?

So far I only try with port A, and only RA4 has a problem of turning it High. So, it should be the "open drain output" problem (as other people mention).
Thanks.
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