This generic black PCF8574 I2C LCD backpack uses pin 11 to control the backlight

Flenser

Senior Member
A while ago I bought one of these generic black PCF8574 I2C LCD backpacks on ebay:
25362

A couple of days ago I went to use it for the first time with an 18M2 chip and a 16x2 LCD.
I connected power and I got the expected line of blocks on line 1.

So I got AlleyCat's 'I2C Bus Search' program from here https://picaxeforum.co.uk/threads/picaxe-to-serial-converter.31940/post-332388
and it reported finding a chip at the PICAXE format $4E address, exactly as expected.

Then I gotHippy's I2C-LCD.txt test program from here https://picaxeforum.co.uk/threads/lcd-i2c-display-with-14m2.31934/post-331937
but when I downloaded it to my 18M2 the backlight went off and the display appeared to be blank. :unsure:

A web search quickly found the following schematic and if you look at the picture of my backpack you'll see the transistor next to the LED backlight jumper.
25363

So my PCF8574 backpack has pin P3 on the PCF8547 chip controling the LCD backlight and if pin P3 is not set high the backlight will be off.

To work with this type of backpack Hippy's code needs to have the backlight pin set to 1, like this:
Symbol bitBL = bit11
bitBL = 1
 

Technoman

Senior Member
Hi,
.... and the display appeared to be blank
: the backlight (LED) is a separate circuit and should not interfere with the display except... if the voltage of the power supply goes under 5V when you turn on the backlight. How do you power the display (batteries?)?
Backlight is an option as a jumper has to be fitted to connect the anode : you can remove it to see is the display works again.

Moreover, I notice the unexpected connection of Q1 as if P3 would be an open drain output. The only open drain output on PCF8574 is /INT...
 

Flenser

Senior Member
Backlight is an option as a jumper has to be fitted to connect the anode : you can remove it to see is the display works again.
The display on with the P3 pin set to 1 and the jumper connected:
25364

The jumper connects the LED to 5V, so with the jumper removed the backlight goes off.
If you look closely you can still see the characters faintly by the natural light.
25365

Moreover, I notice the unexpected connection of Q1 as if P3 would be an open drain output. The only open drain output on PCF8574 is /INT...
I've done simple continuity tests with a multimeter and the circuit does appear to match the schematic above:
- one pin of the transistor is connected to pin 7 (P3) on the PCF8574T chip
- one pin of the transistor is connected to GND
- the third pin is connected to the 5V jumper pins (I didn't trace which resistor this connection travels through).
- the 4k7 resistor is connected between 5V and the same transistor pin that is connected to pin 7 on the PCF8574T chip

Except for missing a resistor on the connection to the base, the transistor circuit above matches the standard circuit for using a transistor as a low-side switch:
25366

Analogue electronics is not my field of expertise but I can't explain why there is a resistor pulling the base up to 5V or why there is no resistor to limit the base current.
 

Flenser

Senior Member
technoman,

A bit of web research comes up with the following two possible explanations for this backlight transistor circuit.

The comment in this post is about the necessity of using a pull-down resistor but the same explanation applies to using a pullup resistor to hold the backlight off during the microcontroller reset "The pull down is absolutely necessary, during reset all pins are input and without the pull down, the transistor base will float."

This post asks the question: I also read here that "You can generally connect the base to a microcontroller’s pin directly without a current limiting resistor because the current from the pin is low enough" but every other source I've read seems to advise using a resistor.

and gets a reply: The reason the author of that page says you can "get away with it" is because a microcontroller I/O pin is really just a MOSFET (high or low side) that acts as if it were a resistor, already. Something on the order of 100 Ohms, perhaps a little less or a little more. However, the reason you still CANNOT get away with it is that there is more than one I/O pin assigned to an I/O port and the port itself has a separate limitation often given in the "ABSOLUTE MAXIMUM RATINGS" heading. The dissipation can fry the port, if you play games like this. "You can be a pig, but hogs get slaughtered."

In this case it would depend on what the the effective resistance of the circuit of the output pins on the PCF8574T chip and the absence of a base resistor could be because the designer was able to minimize the cost to maximize the profit from sales of this PCB.
 

Flenser

Senior Member
Possibly it is a "digital transistor"? With an integral base resistor.
I came across this type of transistor in my web searches yesterday but I could not match the transistor making "L6" with a digitial transistor.

and the absence of a base resistor could be because the designer was able to minimize the cost to maximize the profit from sales of this PCB
I now believe that I probably owe the designer a grovelling apology for this ill-informed comment.

After I confirmed that the schematic appeared to be correct I was prompted to check what the output current specs were in the PCF8574T datasheet and this is what I found:
25370

It turns out that this chip has a current source on the high-side of the output pins:
25368

and my understanding of this is that if you connect the transistor as a low side switch to one of the output pins then:
- When the output is low the transistor base current is zero (or I guess just the leakage current)
- When the output is high the transistor base current is limited to somewhere between 30 uA & 300 uA according to the chips spec:

So what appeared at first to be a missing base resistor now looks to me to actually be an intelligent use of this feature of the PCF8574T chip and a base resistor would actually be completely redundant in the design.
 

Technoman

Senior Member
@Flenser : the capability to directly drive a LED is a feature in the data sheet.... not specified in only current sinking mode. Thank you for your search, that explain the unusual design at first look.
 
Top