Code:
#include <P18F458.h>
void main(void)
{
char mynum[]= {+1,-1,+2,-2,+3,-3,+4,-4};
unsigned char z;
TRISB = 0;
for(z=0;z<8;z++)
PORTB = mynum[z];
while(1);
}
The PIC Micro controller book by MAZIDI show the output=1= FFH, 2=FEH, 3=FDH, 4=FCH ..
but am confused for it. because according to me
1=10000000 its following RB0 to RB7
2=01000000
3=11000000
because when i sent only Z=10 to PORTB
i get the simulation in proteus as given below
10=01010000 RB0 to RB7
please correct me and explain me as well,
am beginner level student ..
Regards,