Plugin Don't Work Correctly
Posted 02 November 2012 - 07:05 PM
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
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?
Posted 05 November 2012 - 12:26 PM
Maybe you don't, at least the kind we are discussing here, but the PIC certainly has.
i think i have no analog functions
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.
Edited by JorgeF, 05 November 2012 - 12:27 PM.
Reply to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users