Hello,
I have written a simple C program for PIC18F4550, using C18 compiler. The program job is to make PORTB displays the values from 0 to 254.
The problem is that, during the debugging, nothing is shown on PORTB, unless the values: 32, 64, 96, 128, 244.
This is the program:
#include <p18f4550.h>
void main(void)
{
unsigned char z;
TRISB = 0;
for (z = 0; z <255; z++)
PORTB = z;
while(1);
}
Despite the value of z is changing, PORTB has no change.
You can see the attached photo showing the problem.
So what is the problem? Is there anything missing?
I have written a simple C program for PIC18F4550, using C18 compiler. The program job is to make PORTB displays the values from 0 to 254.
The problem is that, during the debugging, nothing is shown on PORTB, unless the values: 32, 64, 96, 128, 244.
This is the program:
#include <p18f4550.h>
void main(void)
{
unsigned char z;
TRISB = 0;
for (z = 0; z <255; z++)
PORTB = z;
while(1);
}
Despite the value of z is changing, PORTB has no change.
You can see the attached photo showing the problem.
So what is the problem? Is there anything missing?