Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top