Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC minimum I(IH)

Status
Not open for further replies.

qtommer

Member
the datasheet does not state the Input High Current (minimum) required by the PIC to register a Logic 1. I tried with very 5V but a very low current and the pin does not register the input. I had to go through a 2n2222 transistor with at least 20mA for the pin to register a HIGH.

Anyone knows where I can get a resource on finding this pic electrical parameter?
thanks
 
the datasheet does not state the Input High Current (minimum) required by the PIC to register a Logic 1. I tried with very 5V but a very low current and the pin does not register the input. I had to go through a 2n2222 transistor with at least 20mA for the pin to register a HIGH.

Anyone knows where I can get a resource on finding this pic electrical parameter?
thanks

It's a CMOS chip, it requires almost no current at all - certainly a 1 megaohm resistor pullup to 5V is more than enough to switch it.

I suspect you were doing something VERY wrong, try posting your schematic and code.
 
the datasheet does not state the Input High Current (minimum) required by the PIC to register a Logic 1. I tried with very 5V but a very low current and the pin does not register the input. I had to go through a 2n2222 transistor with at least 20mA for the pin to register a HIGH.

Anyone knows where I can get a resource on finding this pic electrical parameter?
thanks
hi,
Its CMOS technology, so the input impedance is very high.
To get the result you are stating suggests that you are doing something wrong in the test..

Make sure the pin is set as an input.

EDIT:
Nigel you beat me too it, those pills must be working.!:rolleyes:
 
Last edited:
Maybe he wasn't over 1.3 volts or like to closes to it **broken link removed**
 
hi burt,
For the test result he found, the threshold voltage would not be a factor.
Even with 1meg from the input pin to +5V, the pin would pull up high. close to +5V.

I would guess he had the pin set as an output.
 
Hi Eric
I played with my new tool and couldn't see a pin taking 20 ma to be logic high

He has to have it set as output put Like Eric, Said or some kind voltage divider
 
Last edited:
hey guys

thanks for the great replies. Indeed it was a TRIS overlook on my part. Thanks for catching it for me!=)

I am actually using my PIC to communicate with a Handphone. Everything's working okay and I'm adding a handshaking mechanism now. Attached is the connection diagram between the RTS pin of the handphone all the way to the PIC pin RB0.

I programmed RB0 to detect whenever the input goes LOW (modem gets disconnected) , that the RB0 interrupt would trigger , go to an ISR and at the ISR wait for RB0 to go high again before going back to the main program. At the point of disconnection in the ISR, an indicator ERROR LED lights up and goes off when RB0 goes high again.

The program works fine when I disconnect at point A, RB0 gets pulled down to GND and a good Logic 0 is detected. However, when I disconnect at point B (dislodging the phone from the cable head), the program does not work at all. I know for a fact that the RTS pin goes through the MAX3232 (internal to the cable) before going to RB0. If the RS232 input is left open (phone gets dislodged) , I probed the voltage and got approximately -1V.

Any ideas on how I can properly interface so that although I disconnect at point B, a good Logic '0' goes into RB0?



im attaching my ISR code just in case it's a software bug:)

Code:
IntServ:

		btfss	INTCON,INTF
		goto	notRB0

		bcf		PORTB,1			;off CONNECTED LED

		movwf	old_w
		swapf	STATUS,w
		movwf	old_status


waitconnectback:
		btfsc	PORTB,0                            ;wait for modem to connect again,else
		goto	connected_again                ;on ERROR LED
		bsf		PORTB,2
		goto	waitconnectback

connected_again:
		bsf		PORTB,1			;on CONNECTED LED again
		bcf		PORTB,2			;ERROR LED cleared

exitISR:
		swapf	old_status,w
		movfw	STATUS
		swapf	old_w,f
		swapf	old_w,w

notRB0:
		bcf		INTCON,INTF
		retfie


this is the ISR initialization

Code:
		BANK1
		bcf		OPTION_REG, INTEDG		;Interrupt on falling edge of pin. (modem disconnected)
		
		BANK0

		bsf		INTCON,GIE		;enable global interrupt
		bsf		INTCON,INTE		;enable RB0 interrupt


thanks a million!
 

Attachments

  • Untitled picture.png
    Untitled picture.png
    74.1 KB · Views: 163
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top