|
|
View previous topic :: View next topic |
Author |
Message |
pokiko
Joined: 27 Jul 2007 Posts: 33
|
disable undesired outputs on P1A, P1B, P1C and P1D |
Posted: Wed Jul 09, 2008 1:32 pm |
|
|
hi
i am using pic18f4520 with 16Mhz osc. i have an input from the TOCKI pin that i use for ccp. Also keypad is connected to portD.
when i push on some of the buttons on keypad, some undesired inputs appear on the LCD. port_d pins of d5,d6,d7 causes this situation, these three pins must configured as input.
I guess P1A,P1B,P1C and P1D cause this situation ,which are for ECCP, all have to be shutdown, . so how can i disable them. i want to use ccp module in compare mode but i dont want to use eccp module.
thanks.
Code: |
setup_oscillator(OSC_16MHZ);
SETUP_TIMER_0( RTCC_EXT_L_TO_H | RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DIV_BY_16,250,15);
output_low( PIN_E0 );
setup_comparator(NC_NC_NC_NC);
setup_CCP1( CCP_COMPARE_INT );
setup_CCP2( CCP_COMPARE_INT );
disable_interrupts( GLOBAL );
enable_interrupts(INT_TIMER0);
enable_interrupts(INT_CCP1);
enable_interrupts(INT_CCP2);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
SETUP_ADC(ADC_CLOCK_DIV_32);
setup_adc_ports(AN0_TO_AN3);
set_timer0(65535); // Arm external trigger
CCP_1=maxPERYOD;
CCP_2=CCP_1 + 5000; // Second pulse 1ms after pulse 1
set_timer1(0); |
Last edited by pokiko on Thu Jul 10, 2008 1:27 am; edited 3 times in total |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jul 09, 2008 2:18 pm |
|
|
Post your compiler version. |
|
|
pokiko
Joined: 27 Jul 2007 Posts: 33
|
|
Posted: Wed Jul 09, 2008 3:45 pm |
|
|
My compiler version is 4.049.
I have got the solution. It was about the connections of portD. they are also connected to LCD. I added a delay_us then it worked.
thanks PCM programmer. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|