Dell Inspiron charging

Part #9 of the "Roger Writes" series - December 2023

What?

I recently upgraded my laptop to a Dell Inspiron 3593 and found that it uses a smaller 4.5mm x 3.0mm 3-pin connecter. I rummaged through my stash of spare PSUs and found some HP and Dell ones with the bigger 7.4mm x 5.0mm plug, so I found a source of cheap adapters to convert from the larger to smaller connectors. Plugged in the laptop via the adapter cable, and it powers up, but won't charge! Even with a real Dell PSU (via the adapter).

Why?

After a bit of searching I found a few websites mentioning that the Dell PSUs use the 3rd pin for a 1-wire interface that can report the power rating of the supply. Some Dell laptops (including my model) use this to decide what performance and charging profiles to use. I inspected the connector adapters that I'd brought, and although the 3rd pin is present the socket and plug 3rd contacts are not connected together, instead there is a pull up resistor between the plug centre pin, and +ve rail.

How?

So instead of the adapters I found a "4.5mm x 3.0mm Male Plug DC Power Adapter" that had the 3-wires visible in the on-line picture. I cut the end off of a Dell PSU (with the larger plug), and wired them to the end of the new cable. Success! The laptop charged.
Re-using a real Dell charger is fine for the AC side of things, but I use a DC:DC (12V car to laptop) adapter, so needed to fake the Dell PSU. So it was time to look at the signals.

Basic 1-wire info

The 1-wire interface is a novel design. It uses 1 signal/power wire & ground (hence the name!).
Info:
This is the signalling/timing:

Reading a Dell power supply

I used the basic 1-wire commands from a fake host to read from a real Dell PSU, I started with a "Read ID" sequence:
Fake host sends: Reset
PSU returns: An ACK
Fake host sends: 33 - This is the "Read ID" command
PSU returns: 11 63 4D 8B 00 00 00 14 - Family code, then 6 bytes of ID code, then 1 byte checksum

A family code of 11 isn't documented, but the NV RAM / EPROM / EEPROM devices all support the same basic commands, so I tried the "Read All" then "Read Data" sequence:
Fake host sends: Reset
PSU returns: An ACK
Fake host sends: CC - This is the "Read All devices" command
Fake host sends: D0 00 00 - This is the "Read Data" command, from the address 0x0000
PSU returns: 19 - (clocked by the host) This the the checksum of the read command bytes, as this is correct, it indicates that the device supports the command
PSU returns: (clocked by the host)
44 45 4C 4C 30 30 41 43 DELL00AC
30 39 30 31 39 35 30 34 09019504
36 43 4E 30 4B 44 38 48 6CN0KD8H


If we split this down, we get:
00: 44 45 4C 4C 30 30 DELL00 - Manufacturer ID
06: 41 43 .. .. .. .. AC.... - Device type = AC charger
08: 30 39 30 .. .. .. 090... - Power rating = 90W
0B: 31 39 35 .. .. .. 195... - Voltage = 19.5V
0E: 30 34 36 .. .. .. 046... - Current = 4.6A
11: 43 4E .. .. .. .. CN.... - Country of manufacter code
13: 30 4B 44 38 48 .. 0KD8H. - Start of the batch / serial number

Commands from a Dell laptop

It's one thing to read the PSU, using the generic 1-wire memory commands, but another to see what sequence/commands the laptop actually uses. Using the Dell PSU & 3-wire cable, it was easy to monitor the commands that the laptop issued as the PSU was plugged in.

From my laptop:
Laptop sends: Reset
PSU returns: An ACK
Laptop sends: CC - This is the "Read All devices" command
Laptop sends: D0 06 00 - This is the "Read Data" command, from the address 0x0006
PSU returns: B3 - (clocked by the host) This the the checksum of the read command bytes, as this is correct, it indicates that the device supports the command
PSU returns: (clocked by the host)
41 43 30 39 30 .. .. .. AC090...
We can see that the laptop is reading 5 bytes from byte 6, so the adapter type, and power rating!

From a friend's (older) laptop:
Laptop sends: Reset
PSU returns: An ACK
Laptop sends: CC - This is the "Read All devices" command
Laptop sends: D0 08 00 - This is the "Read Data" command, from the address 0x0008
PSU returns: 6F - (clocked by the host) This the the checksum of the read command bytes, as this is correct, it indicates that the device supports the command
PSU returns: (clocked by the host)
30 39 30 31 39 35 .. .. 090195..
We can see that the laptop is reading 6 bytes from byte 8, so the power rating and voltage!

Note: With the 1-wire disconnected from the PSU, we can see the laptop looping the Reset sequence, looking for a device to ACK it. It does this at about 500ms intervals.

Faking it!

I've used the PIC microcontrollers for a lot of projects, and an 8-bit SOIC is a good size to fake a PSU.
I chose to decode 3 commands, 0xCC "Match all", 0x33 - "Return ID bytes", 0xF0 - "Read data".
I used "FakeID" as the ID bytes, and "FAKE00AC065195033CN123456789012345678A65" for the data bytes. This claims to be a 65W, 19.5V, 3.3A supply.

The PIC code uses my portability libraries (in the open_*.h files) that should allow it to build on just about any of the 14-bit (10F, 12F, 16F) PIC devices. For the initial work I used a 16F15325 (as that what was already on my breadboard), for the final design I use a 16F15313 (which is the 8-pin device in the same family). But it should work with any device that has an internal 32MHz oscillator.

Here is the Code including the portability headers. The code includes the fake host 1-wire reader code, if you want to read from a real Dell PSU (don't forget the pull up!).
The main functions are:
void ow_device_ack_reset(void)
Reset acknowledge sequence (should be within 100us or so of end of reset pulse from host)
void ow_device_reset_wait(void)
Wait for a reset pulse (rejecting any too short, as they are probably clocks/data for other devices)
bool ow_device_receive_byte(BYTE *pValue)
Receive byte from the host
bool ow_device_send_byte(BYTE value)
Send a byte to the host (host sends the clock pulses)
Code overview:
Notes:

Building / flashing

I use MPLABX v6.05 and XC8 v2.40 with the optimiser set to /O2 (the highest for the free version!), and for the 16F15313 device it uses 119 bytes (46%) of data RAM and 670 words (33%) of instruction space. Removing the serial debug output, reduces the instruction count to 562 words (27%).
You will need a programmer to program the device, the PICKit 2 (and clones) are the cheapest, but the PICKit 3 (and clones) are not a lot more and support most devices, the PICKit 4 (no clones yet) are needed for the latest devices.

Wiring

Rather than try to power it from the 1-wire I used a 78L05 regulator to drop the 19.5V down to 5V.
I put a 470R resistor between pin 2 and the centre cable to the laptop, this is to limit any current into the PIC if the centre pin is shorted to the supply pin, and seems low enough for the signalling to be detected.


The Roger Writes series

I research / dabble with lots of things, and figured that if I write my notes here, I can quickly reference them, also, sometimes, they are useful to others!
Here is what I have so far:





Homepage.
This page was lasted updated on Sunday, 17-Dec-2023 16:27:43 GMT

This content comes from a hidden element on this page.

The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.

Click me, it will be preserved!

If you try to open a new Colorbox while it is already open, it will update itself with the new content.

Updating Content Example:
Click here to load new content