Jump to content
Sign in to follow this  
Prefekt

PortA question

Recommended Posts

Hello,

I've a simple question about the porta. I've making six LED's on the porta of a PIC16F876. The code is the follow:

trisa=00000000b;

porta=00111111b;

 

On the output, the LED 1,2,3,4,6 are on, but the LED 5 (RA4) is off, why?

 

Regards Prefekt

Share this post


Link to post
Share on other sites

The RA4 pin has a different output circuit to the other pins on port A. The other pins have a sink/source capability, while RA4 can only sink current.

 

To turn you led on on RA4, connect it between 5V and the pin, then set the pin output to 0 to turn the LED on, and 1 to turn the LED off.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...