Referring to assignment 3.f question 3 (what do you need to change in the program to make all 8 LEDs flash), I changed to code to:
// set all b output
movlw 0b00000000
movwf _trisb
When I implement the code B5 is not flashing. On page 564 is the fact that B5 is used for debugging is not mentioned. More, on page 564 figure 474 makes it more confusing.
Referring to my first mail (I should have included the code, so I will do now).
// configure as output
trisa = 0b00000000;
trisb = 0b00000000;
trisc = 0b00000000;
trisd = 0b00000000;
trise = 0b00000000;
porta = 0;
portb = 0;
portc = 0;
portd = 0;
porte = 0;
while (1)
{
porta = 0b11111111;
portb = 0b11111111;
portc = 0b11111111;
portd = 0b11111111;
porte = 0b11111111;
delay_ms(200);
porta = 0b00000000;
portb = 0b00000000;
portc = 0b00000000;
portd = 0b00000000;
porte = 0b00000000;
delay_ms(200);
};
If I use this code only the LEDs on port B with exception of B5 flash, all other ports stay dark. Is this the result of illegal code ?
But when I use:
asm
{
movlw 0b00000000
movwf _trisa
movlw 0b11111111
movwf _porta
}
Changing the code for ports A, B, C, D and E compiling etc ...
A6 and A7 stay dark, you explained why
B5 remains dark, you explained why
C3, C4 and C5 stay dark, you explained why
On port D all LEDs burn
On port E only E0, E1 and E2 burn, you explained why
So this seems to be normal, now I'm confused ...