digital input not working in dspic33ep512mu810

Status
Not open for further replies.

raman00084

Full Member level 6
Joined
Nov 29, 2010
Messages
362
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
4,006
if i configure a pin as digital input it is not working. if i configure the same pin as output it is working correctly. my device is dspic33ep512mu810 ccs compiler version is 5.045.

Code:
void main() 
{ 
delay_ms(10); 
set_pullup(TRUE,PIN_A2); 
delay_ms(10); 

while(TRUE) 
{ 
delay_ms(10); 
if(input(in_1==0)) 
{ 
output_high(pin_b7); 
delay_ms(100); 
output_low(pin_b7); 
delay_ms(100); 
} 

} 
} 



#include <33EP512MU810.h> 

#build (stack=512) 
#FUSES NOWDT //No Watch Dog Timer 

#FUSES NOCKSNOFSM //Clock Switching is disabled, fail Safe clock monitor is disabled 
#FUSES NOBROWNOUT //No brownout reset 
#FUSES NOJTAG //JTAG disabled 
#FUSES PUT128 //Power On Reset Timer value 128ms 
#device ICSP=1 
#use delay(clock=96MHz,crystal=12MHz) 
#use FIXED_IO( B_outputs=PIN_B7,PIN_B6 ) 

#define in_1 PIN_A2
 

Analog function disabled ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…