Jump to content
Sign in to follow this  
kf00115

Plugin Don't Work Correctly

Recommended Posts

If i do: set_bit(porta,0) ,set_bit(porta,1) ,.....set_bit(porta,5) in debug mode with led block (8), leds fro 0 to 5 work correctly

 

If i do set_bit(porta,6) or set:bit(porta,7) led 6 and 7 of leds block (8 leds) plugin dont' go ON

 

 

#include <system.h>

#include <boostC.h>

 

.............

......................

void main( void )

 

{

//Configure port A OUT

trisa = 0x00;

 

set_bit(porta,0); turn ON LED 0

set_bit(porta,1); turn ON LED 1

set_bit(porta,2); turn ON LED 2

set_bit(porta,3); turn ON LED 3

set_bit(porta,4); turn ON LED 4

set_bit(porta,5); turn ON LED 5

 

set_bit(porta,6); nothing on LED 6

set_bit(porta,7); nothing on LED 7

 

where is then problem?

Share this post


Link to post
Share on other sites

Hi

 

What target device?

Are you sure that there are no analog functions active that might be overriding your I/O settings?

 

 

Best egards

Jorge

Share this post


Link to post
Share on other sites

Hi

 

Pic16F876

i think i have no analog functions

Maybe you don't, at least the kind we are discussing here, but the PIC certainly has. :unsure:

 

All of PORTA bits have AN functions.

This functions must be disabled before you use the PORTA pins as digital. HINT: Look for ADCON or ANSEL registers in your datasheet.

 

Also PORTA pins have lots of alternate functions, including clock related, so you beter take care of a full configuration of the PIC (CONFIGURATION WORDS) before trying to test anything.

As a matter of fact I would use any other port. As a rule of thumb for PICs, PORTA is the least suitable for this kind of quick test because of its multiple functions.

Usually the best port is the one with the higgest designator, that is allways the one with the simplest internal hardware, hence the simplest to configure.

 

Best regards

Jorge

Edited by JorgeF

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum 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  

×