Hi
I'm trying to run this program from the C18 examples which sends value to PortB
the program is as follows
but the value read from PortB not as expected
i tried to change the written value but here the results:
0x5A --> 0x40
0xFF --> 0xE0
0xAA--> 0xA0
i can't understand why the output looks like that?
I'm using MPLAB IDE with c18
I'm trying to run this program from the C18 examples which sends value to PortB
the program is as follows
Code:
#include <p18cxxx.h>
#pragma config WDT = OFF
void main (void)
{
/* Make all bits on the Port B (LEDs) output bits.
* If bit is cleared, then the bit is an output bit.
*/
TRISB = 0;
/* Reset the LEDs */
PORTB = 0;
/* Light the LEDs */
PORTB = 0x5A;
while (1)
;
}
i tried to change the written value but here the results:
0x5A --> 0x40
0xFF --> 0xE0
0xAA--> 0xA0
i can't understand why the output looks like that?
I'm using MPLAB IDE with c18