Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
I don't know about CCS C, but if you look in the tutorial in my signature, you can see a macro called FLIP_PORT that does toggling, it can be used for either high/low or input/output
On an ATMEL/AVR chip you use the Data Direction Register to control whether a pin is an output pin or an input pin. Not sure what the equivalent is with a PIC but after a quick look at the datasheet then assuming you are using PORTA then the equivalent direction port is TRISA where a 0=output and 1=input. So if you are using PORT A pin 2 then:TRISA |= (1<<2) ; will make PORTA pin2 an inputTRISA &= ~(1<<2); will make PORTA pin2 an outputThis is only a guess - as I dont have any PIC experience.