I'm having trouble getting GP2 to become an output on an PIC10F200.
GP0 and GP1 work fine as outputs, but GP2 appears to still be an output. Here is my code:-
I haven't found the include file so that I can use friendly names for the registers, but register 6 is the IO.
I realise that there is no comparator on a PIC10F200, so writing to CMCON (register 7) shouldn't be needed, and I haven't found it makes any difference as GP2 isn't an output whether I write to that or not.
This code is putting out square waves on GP0 and GP1, but GP2 is still floating.
Any ideas what I'm doing wrong?
GP0 and GP1 work fine as outputs, but GP2 appears to still be an output. Here is my code:-
Code:
nop
nop
nop
nop
clrf 5 ;osccal
movlw 0b11110001
movwf 7 ;cmcon
movlw 0x00
tris 6
loop
bsf 6, 2
nop
bsf 6, 1
nop
bsf 6, 0
decfsz 0x10, f
goto $-1
bcf 6, 2
nop
bcf 6, 1
nop
bcf 6, 0
decfsz 0x10, f
goto $-1
goto loop
I haven't found the include file so that I can use friendly names for the registers, but register 6 is the IO.
I realise that there is no comparator on a PIC10F200, so writing to CMCON (register 7) shouldn't be needed, and I haven't found it makes any difference as GP2 isn't an output whether I write to that or not.
This code is putting out square waves on GP0 and GP1, but GP2 is still floating.
Any ideas what I'm doing wrong?