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.

PIC -unstable output at I/O pin

Status
Not open for further replies.

kotsam

Member level 1
Joined
Nov 16, 2005
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,606
PIC

Hey guys ,

urgent help other wise i would in truoble ;

what make the i/o pins not stable ,

I'm talking about PIC18F4550 , this code not working as expected , RD4 should be high all the time , but working high for some seconds and then it switched to be low and then it goes to be high again .

i would so thankful for the help , its so urgent




Code:
	 void main()
{
//****************port configuration********************
	 LATE			= 0x00;
	 PORTE			= 0b11111111;
	 LATB 			= 0x00;           //Clear port b 
	 TRISB 			= 0x00; 			// port b as output 		
	 LATD 			= 0x00;    		//clear port d 
	 TRISD			= 0x00;			//port d as output 
	 TRISC 			= 0b10011111;    //config RC6 rx as input 
	 LATA 			= 0b00000000;           //Clear port b 
	 TRISA 			= 0b11111111; 			// port b as output 

//******************usart configuration********************** 
	 OpenUSART(USART_TX_INT_OFF & USART_RX_INT_ON & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_LOW, 64);

//*****************adc channels configuration***************** 
	 OpenADC( ADC_FOSC_8 & ADC_LEFT_JUST & ADC_0_TAD,ADC_CH7 & ADC_INT_OFF,0b1111 );

//*****************Code Start Here****************************
while(1)
	{
		if (DataRdyUSART())    //check if there is interrupt
		{
    	 USARTREC();
		}//end if
			LATDbits.LATD0 = 1; //u/d High



			LATDbits.LATD4 = 1; //u/d High
	 		Delay1KTCYx (500);
			putsUSART(error);
			Delay1KTCYx (500);

		 
		



			 
	}//end while
	
} //end main
 

Re: PIC

oki to explain what i have more , if i'm config RD4 as output , and his status is high it gives me 2.79 volt instead of 5 volts ?? and the same when its low
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top