I am completely new to Microcontrollers and Electronics, however a made some progress and just got stuck at the point where i want to turn on all LED's Red color with the "PORTX.FX" command (led 1,3,5,7 stays black). If i try to turn on all Red LED's separately it will work with no problems. Here's the Code:
I am using MikroC compiler, with a PICkit 2. I appreciate every help here ;-).
Rich (BB code):
void main()
{
TRISA = 0b000000;
TRISB = 0b000000;
TRISC = 0b000000;
TRISD = 0b000000;
PORTA = 0b111111;
PORTB = 0b111111;
PORTC = 0b111111;
PORTD = 0b111111;
ANSEL = 0b000000;
ANSELH = 0;
PORTA.F2 = 0;
PORTA.F5 = 0;
PORTB.F2 = 0;
PORTB.F5 = 0;
PORTC.F2 = 0;
PORTC.F5 = 0;
PORTD.F2 = 0;
PORTD.F5 = 0;
}
Attachments
-
28 KB Views: 26
-
42.9 KB Views: 19