Jump to content

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?

Link to post
Share on other sites




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


Edited by JorgeF
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.

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.

  • Create New...