Friday, August 21, 2020

DIY laptop: proper backlight

The backlight driver is built with a TI LP8545 boost converter with an external FET for higher output voltage. This part is quite old and was used in original Retina MBPs A1398 back in 2013. Newer Retinas use LP8548, a custom variant of LP8545 that TI is making specifially for Apple, for which there is next to no public information, much less a datasheet. What's more, in newer MBPs this boost converter (located in MBP's body) is controlled by the display controller (located on the narrow PCB hanging off the LCD panel) which in turn gets its orders from the video card or iGFX. I decided against trying to get this setup working, so I used the older part, which I control by I2C from the motherboard with a homebrew SMBus "driver" that maps PCH's SMBus registers into userspace (no i2c-tools on Windows). There were a couple of hurdles to clear before I got the converter working. First, when I first powered it up, I could talk to it via I2C, but every time I tried to turn on the booster it raised an over-current fault and stopped responding to commands. This was peculiar because no load was connected. I checked the PCB for shorts, but everything was fine. I suspected that the problem was caused by the fact that in LP8545's factory settings the external FET is disabled, so I soldered a jumper between the FET's source and drain, and sure enough with the jumper closed the booster turned on and everything was working as expected. I could then enable the external FET and remove the jumper. But this was obviously a bench-only procedure. It is supposed to be possible to update the settings in LP8545's EEPROM — the datasheet explains how to do it — but each time I tried the steps, the settings were not updated. Thankfully, a TI engineer told me that LP8545 raises the over-current protection fault not only in case of over-current, but also when the output voltage is too low for more than 50ms. I was then able to exploit this 50ms grace time and enable the external FET immediately after starting the converter even with the FET jumper open. The other problem was that once I enabled the external FET, the output voltage inexplicably dropped several volts. It did step up and down when I changed the output voltage setting, but even at the highest setting it did not go as high as with the FET disabled. The datasheet did not mention such behavior. This was a real head-scratcher and TI was no help either. Was the part partially busted? Did I make a solder bridge under it? Eventually I proposed that the part was working fine — the boost converter was functioning in a consistent manner — and decided to experiment by changing the feedback resistor divider. Bingo! Apparently, when the external FET is enabled, LP8545 switches the target feedback voltage from (10+VBOOST)V to (11+0.5VBOOST)V, where VBOOST is the setting in register A5h. I made the resistor divider more top-heavy to account for this and the lights went up. I even made a Windows startup task to program the LP8545 so I don't have to do it manually. There is still the nasty issue that as soon as Windows starts up with the Retina attached, all monitors cycle on-off once per second unless Intel UHD Graphics Control Panel is running (!?) It doesn't have to be visible, and Ubuntu doesn't show this behavior, so it's almost certainly a software problem. Perhaps the reason is that ACPI BIOS has no idea that it now has an internal display, but I'm not up to tinkering with the BIOS yet. For now I can just set the UHD panel application to launch at logon.

Next step is the keyboard PCB.

Running with on-board backlight driver.

Thursday, August 6, 2020

DIY laptop: new PCBs with micro-coax cable

Having successfully tested the LCD with the interposer PCB, I routed a lid PCB which is designed to fit into Thinkpad's display enclosure (with some very minimal dremeling of the latter) and connects to the body by a 40-pin 1:1 micro-coax cable using Cabline-CA connectors and a separate 4-pin connector for LCD and backlight power. This PCB carries the backlight boost converter, based on an LP8545, the status LEDs and the lid sensor. I decided on this setup because 50-pin connectors and cables are rare and expensive, and I didn't want to add an extra microcontroller or a port expander to this board just to service the GPIO stuff. The two cables go through the same opening as Thinkpad's.

Donor controller PCB from a busted A1707 and my lid PCB.

For development purposes, I didn't route and order the keyboard PCB straight away, but instead went for a small PCB carrying just the card-edge ACES connector to the motherboard, my two cable connectors, and a breakout pin header. After many hiccups and delays, I was able to assemble enough to test the DisplayPort connections (this time soldering and desoldering everything, including the I-PEX parts, myself, with the aid of a used МБС-1 microscope, which is an early Soviet clone of Carl Zeiss SMXX), and voila:

Up and running (with external backlight power for now).