top | item 30454796

Emulator of Original Dell Charger Using ATTINY85

125 points| tentacleuno | 4 years ago |github.com | reply

56 comments

order
[+] bxparks|4 years ago|reply
The ATtiny85 is nice, with 8kB flash, 512 bytes RAM & EEPROM, 5-6 GPIO pins, they are just enough to do something interesting. But I don't use the ATtiny85 as much as I want to, because flashing requires a separate programmer hardware. It's enough friction to get in the way of rapid software iteration. I once made the mistake of inserting the ATtiny85 upside down into the programmer, and it promptly cooked it dead. Lesson learned.
[+] MarioMan|4 years ago|reply
The Digispark[1] and its clones use the ATTINY85 and offer flashing over USB via the Micronucleus bootloader[2] using V-USB[3]. It comes at the cost of a significant chunk of flash storage, but the convenience is excellent. Plus, V-USB support means you can emulate all sorts of USB devices. I've used it to build a DIY NES controller adapter, but it's commonly used as a cheap Rubber Ducky[4]. For projects where USB interfacing makes sense, it can be a good fit.

1: http://digistump.com/products/1

2: https://github.com/micronucleus/micronucleus

3: https://www.obdev.at/products/vusb/index.html

4: https://shop.hak5.org/products/usb-rubber-ducky-deluxe

[+] russdill|4 years ago|reply
In circuit programming is just such a huge step forward. You still need separate programming hardware, but you don't need to pop the chip out.

Beyond that, a few hundred bytes is usually enough for a simple bootloader. That tends to accelerate things even more. And writing bootloaders tends to be fun. I've done a tinyusb bootloader on an attiny45 with the user program sharing the v-usb stack in the bootloader and also a CEC bootloader. The CEC one of course took several minutes.

[+] auxym|4 years ago|reply
All micros require separate hardware to flash it, no? Some is cheap (stlink), some are a few hundred dollars, but still.

Unless you have a USB bootloader programmed on the chip, but you still need the adapter to flash the bootloader in the first place.

[+] puzzlingcaptcha|4 years ago|reply
You can use Attiny412 with a simple USB-UART adapter for programming. Half the flash/SRAM but much more modern peripherals. $0.50 a piece, and unlike many other uCs recently tends to be in stock.
[+] nanomonkey|4 years ago|reply
The old Dell barrel jack power supplies use 1wire communication to identify the power supply's capabilities. It would likely be cheaper to purchase a compatible 1wire memory module.

Here is an article on reverse engineering the memory module. https://hclxing.wordpress.com/2014/02/06/hacking-the-dell-la...

[+] tentacleuno|4 years ago|reply
> and the battery will not charge (the picture is from internet but it has almost identical information)

Yikes! I used a no-name charger on my Dell Latitude for quite a while, and it never stopped me from charging. Just annoyed me about it (press F1 to continue on boot) whenever I took the battery out (wiping the CMOS) and didn't turn off the AC warnings in the BIOS. The one I was using didn't have a serial chip in it, so the laptop flagged it as unknown.

[+] userbinator|4 years ago|reply
The original source linked from that article has unfortunately disappeared, but the archive still remembers:

http://web.archive.org/web/20100329110047/http://www.laptop-...

An explanation of (one of) the design flaws:

http://web.archive.org/web/20100412160453/http://www.laptop-...

Not only is it clearly hostile to the aftermarket, but putting a chip that has 12V absolute maximum ratings in an environment where it could easily be shorted to the 19-20V output of the PSU seems almost like "engineered unreliability" to me.

On the other hand, when IBM/Lenovo had to solve the problem of identifying the wattage available, they used a simple and robust solution of a single resistor:

https://www.thinkwiki.org/wiki/Power_Connector#Signal_Pin

https://www.thinkwiki.org/wiki/Power_Connector#Signal_Pin_2

The only improvement I could make upon that scheme would be to make the correspondence between resistance and wattage monotonic, but otherwise it's an example of non-overengineering and aftermarket-friendly solution.

[+] bavell|4 years ago|reply
I have a strip of ATTINY85's at hand for misc electronic projects and they've been really great for beginner-level circuits and learning embedded programming. I'm a dev by trade but have a bit of electronics knowledge and these are cheap enough to not worry about frying them and still get the job done.
[+] ericwood|4 years ago|reply
They're such a nice starting place for embedded dev! I'd messed around with Arduino things for a long time, and recently started messing with the chip itself without the abstraction. The ATTINY series is powerful enough for many things while having a relatively small and easy to work with footprint (from a physical and register standpoint). It's actually possible to go through the entire datasheet and understand it, then poke all the right registers. It's also satisfying to be able to plop it onto a breadboard!

I'm excited for the Rust + AVR world to move forward a bit so I can keep playing with it without the currently required hacks :)

[+] rektide|4 years ago|reply
I just learned this week that my old Dell Venue 11 Pro's will happily accept 19/20V if given, without any sideband communication. The laptop has a custom Dell charger, and usb-micro input, which could negotiate via a custom protocol to a higher power level.

But folks are reporting that if you make a 20V USB-micro, they'll charge. Sweet. Riskier than this links careful negotiation over 1-wire, but so convenient. I'll probably rip apart one of my usb-c to 20v barrel jacks & make a cable, in case I want to go back to these units. The need for a custom charger has been a huge barrier to ever wanting to use them again, very nice that these old systems will just work, when given power.

[+] tgflynn|4 years ago|reply
I assume the purpose of this would be to build a Dell compatible charger but this repo doesn't appear to provide much information on how to actually do that. I get that the microcontroller provides the signalling the laptop needs to identify the charger, but assuming you built this circuit, how would you actually use it to charge a laptop ?
[+] zelon88|4 years ago|reply
In schematic.png you can see on the left there are 3 pins and the right there are 2 pins. The 3 pins on the left represent the laptop and the two pins on the right represent the power supply. The chip in the middle attaches to the ID pin on the laptop and reports the charger to the laptop.
[+] kube-system|4 years ago|reply
I believe the old Dell chargers simply have a data pin, which I presume would carry the data generated by this project
[+] dec0dedab0de|4 years ago|reply
It's a bit over my head, but the schematic in the readme seems to have a shared ground, with one pin going to the attiny microcontroller, and the other going to a generic power source. With a big warning that your power source needs to be up to spec.
[+] stavros|4 years ago|reply
Looks like you connect the data pin of the ATTiny to the data pin of the charger jack. The schematic only has two components, the ATTiny and a power regulator for it, then the input is charger power and the output is charger power + data.
[+] londons_explore|4 years ago|reply
I don't understand why people use the attiny85... The Atmega328 based boards have far wider software support in the arduino ecosystem, so you will typically be able to prototype a project in minutes instead of hours, and the dev boards cost the same, but the 328 ones have more of pretty much everything.

The only benefit of the attiny seems to be that you can save a few millimeters of board space, but if that's your concern there are plenty of far smaller, cheaper and more capable microcontrollers in BGA packages.

[+] bavell|4 years ago|reply
I wanted to gain experience in embedded programming at a lower level than Arduino (i.e. pure C & bitbanging). They're dirt cheap and also simple enough that I can read through the whole datasheet and pretty much understand everything.

It's also kind of a fun challenge working within the limitations on both the HW and SW side.

[+] tpmoney|4 years ago|reply
The obvious answer would probably be the size and the dip formfactor. Sure you can get more capable BGA packaged chips, but how many hobbyists have the ability to properly solder in a BGA?
[+] alexk307|4 years ago|reply
Awesome work. I just dove into the world of AVR programming and bought a bunch of ATTINY85's. Super easy to work with, extremely versatile, and low power consumption.
[+] titzer|4 years ago|reply
Do you use a USB programmer, or did you buy ones that have a USB programmer built in?
[+] Koshkin|4 years ago|reply
Is this safe though? (Aren't chargers the way they are for a reason?)
[+] kennywinker|4 years ago|reply
> If you connect an unoriginal adapter, the laptop refuses to charge the battery.

I'm generally against capital punishment, but for whatever exec pushed this through - I think we could make an exception.