Dec 5, 2012 #1 K kle0ps Junior Member level 2 Joined Nov 12, 2012 Messages 24 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,426 Hello guys. Does anyone know how to pull up only RB1 on PIC18F2520? I use C18 compiler Thank you
Dec 5, 2012 #2 jayanth.devarayanadurga Banned Joined Dec 4, 2012 Messages 4,280 Helped 822 Reputation 1,654 Reaction score 791 Trophy points 1,393 Location Bangalore, India Activity points 0 Do you want to connect a pullup resistor to RB1? Just connect one end of 10K resistor to 5v and the other end to RB1.
Do you want to connect a pullup resistor to RB1? Just connect one end of 10K resistor to 5v and the other end to RB1.
Dec 5, 2012 #3 K kle0ps Junior Member level 2 Joined Nov 12, 2012 Messages 24 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,426 Hello mate I know that, but i want to connect my pic18f2520 with arduino. i want to sent HIGH (3-5V) from RB1 to arduino only when I want, not continuously
Hello mate I know that, but i want to connect my pic18f2520 with arduino. i want to sent HIGH (3-5V) from RB1 to arduino only when I want, not continuously
Dec 5, 2012 #4 jayanth.devarayanadurga Banned Joined Dec 4, 2012 Messages 4,280 Helped 822 Reputation 1,654 Reaction score 791 Trophy points 1,393 Location Bangalore, India Activity points 0 Then write the code to make pin RB1 high or low according to your need.
Dec 5, 2012 #5 K kle0ps Junior Member level 2 Joined Nov 12, 2012 Messages 24 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,426 jayanth.devarayanadurga said: Then write the code to make pin RB1 high or low according to your need. Click to expand... I set PORTB as ouputs and i set PORTBbits.RB0==1; (HIGH) but when i measure the voltage on RB0 was zero - - - Updated - - - Finally i fix it. I change PORTBbits.RB0==1 to PORTA=0b00000001; Thank you mate!
jayanth.devarayanadurga said: Then write the code to make pin RB1 high or low according to your need. Click to expand... I set PORTB as ouputs and i set PORTBbits.RB0==1; (HIGH) but when i measure the voltage on RB0 was zero - - - Updated - - - Finally i fix it. I change PORTBbits.RB0==1 to PORTA=0b00000001; Thank you mate!
Dec 13, 2012 #6 Tahmid Advanced Member level 6 Joined Jun 17, 2008 Messages 4,756 Helped 1,798 Reputation 3,588 Reaction score 1,656 Trophy points 1,413 Location Berkeley, California Activity points 30,586 When you want to write to a bit or a register, you use only = , not ==. Like you used Code: PORTBbits.RB0 = 1; If you want to check/compare, then you use == instead of =. Code: if (PORTBbits.RB0 ==1){ } if (PORTD == 255){ } Hope this helps. Tahmid.
When you want to write to a bit or a register, you use only = , not ==. Like you used Code: PORTBbits.RB0 = 1; If you want to check/compare, then you use == instead of =. Code: if (PORTBbits.RB0 ==1){ } if (PORTD == 255){ } Hope this helps. Tahmid.