peterl
Joined: 09 Oct 2009 Posts: 13 Location: SF,BG
|
12F675 configure ports |
Posted: Fri Oct 09, 2009 2:28 pm |
|
|
hi guys,
I use PIC-C compiler version 4.074. I want to make PIN_A0, PIN_A2 as input and PIN_A1 as output. To enable PULLUPS resistor of PIN_A0, PIN_A2, I wrote this :
Code: |
#include "D:\Dimer V.2\main.h"
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_comparator(NC_NC);
setup_vref(FALSE);
set_tris_A(0b10110000);
port_a_pullups(TRUE);
}
|
Am I right? Because I tried it, but pullups resistor does not work. My second question is: if I use INPUT() function in this way is it necessary to use set_tris_x to configure which pin is input/output?
Thank's a lot ! |
|