how do I output on GPIO (12F675)?

Status
Not open for further replies.

k7michal

New Member
Hi. I've been programming PICs quite a lot but when I tried the 12F675 the old methods of adressing the ports just don't work the same as in the 16F84.

I tried this:

bsf status,rp0
clrf trisio
bcf status,rp0

movlw 0xff
movwf gpio <<<----- this one should work right?
bsf gpio,1 <<<----- this as well right?

yet non of them work. so far I've tested it on MPLABSIM, and I've actually burned it into a chip and it seemed that the GPIOs were not doing anything..

I've also had no results with HI-TECH Clite

Please Help.
 
Never mind. I've figured it out. But here is the answer for those interested anyway.

this is the initializing GPIO command:

bcf status,rp0
clrf gpio
movlw 0x07
movwf CMCON <<<--- by default this register turnes the i/o to comparator
bsf status,rp0
clrf ANSEL <<<--- (default) turns gpios to analog inputs
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…