Welcome to the frustrating world of pic, nice to have you.
You have set the GP0 output to 1, but first you need to set the GP0 pin to be an output.
This can be done by setting the appropriate bit in the TRISIO register to 0.
So your code will look something like:
[code lang="c"]
#include
void main(){
//init GPIO pins
TRISIO = 0b00001000; // All GPIO pins as outputs (except GPIO3)
GPIO = 0b00000000; // Set all GPIO pins low
while(1){
GP0 = 1; // Set GP0 pin high
}
}[/code]
Refer to the header file at ...microchipxc8v1.10docspic12f629.h and the datasheet for more info.
Hope this helps.
Regards,
Sean
You have set the GP0 output to 1, but first you need to set the GP0 pin to be an output.
This can be done by setting the appropriate bit in the TRISIO register to 0.
So your code will look something like:
[code lang="c"]
#include
void main(){
//init GPIO pins
TRISIO = 0b00001000; // All GPIO pins as outputs (except GPIO3)
GPIO = 0b00000000; // Set all GPIO pins low
while(1){
GP0 = 1; // Set GP0 pin high
}
}[/code]
Refer to the header file at ...microchipxc8v1.10docspic12f629.h and the datasheet for more info.
Hope this helps.
Regards,
Sean