Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top