I'm using the PIC 18F4680 in college for my project. I have a simply piece of code below for toggling a port;
I tested the pin at the time with a multimeter and the pin was pulsing between 0V - 5V. Im just wondering is there a way of finding that pin using the code above. When I add 0x55 + 0xAA = 0xFF which means that all the ports are on. But I remember at the time that I was only getting that pulse on one pin.
Thanks.
Moderators note: Please use code tags for pieces of code
Code:
void main() {
TRISC = 0x00; //When you invert the tri-state, it turns on all outputs on the board
while(1){
PORTC = 0x55; // Hex number for 8 LED's (01010101 in Binary, corresponding to LED position)
Delay_ms(1); // Delay of 1000ms or 1 sec
PORTC = 0xAA; // Hex number for 8 LED's (10101010 in Binary, corresponding to LED position)
Delay_ms(1); // Delay of 1000ms or 1 sec
}
}
Thanks.
Moderators note: Please use code tags for pieces of code
Last edited by a moderator: