8 ms·
Emulator of Original Dell Charger Using ATTINY85
- bavell 5y agoI 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 5y agoThey'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 :)
- auxym 5y agoIn case you're interested, there's a new project underway that aims to make running Nim on AVR (and eventually other micros through BSPs) as easy (but leaner and more performant) as Arduino: ratel.peterme.net Nim can already run on most MCUs (I've experimented with samd21 and rp2040), it just requires a few compiler flags or linking steps that are not super well documented. Ratel aims to automate that and provide some high level interfaces for hardware access (gpios, etc).
- girvo 5y agoNice work! I've been trying to stand up nesper/nephyr, the Nim overlays for ESP32 and Zephyr, but had quite a few issues (not all of which are those library's fault, the ESP-IDF toolchain is horrid in a lot of ways). I wonder how difficult it would be to extend Ratel over to ESP32 if I have a working toolchain already. I might have a crack at it, we're big on Nim at work and are trying to get away from C++ for our firmware development wherever possible.
- auxym 5y agoTo be clear: Ratel isn't my project, just something I'm following due to interest. In the interest of shameless self promotion :), my own experimentations are : https://github.com/EmbeddedNim/svd2nim https://github.com/EmbeddedNim/svd2nim https://github.com/auxym/nim-on-samd21 https://github.com/auxym/nim-on-samd21 And I've used and contributed to picostdlib (https://github.com/beef331/picostdlib https://github.com/beef331/picostdlib), the rp2040 support library. All just as a hobby, but it's interesting to learn that some companies are actually looking into Nim for firmware! Embedded seems like such a slow moving industry. I believe the author of Nesper and Nephyr also developed them for professional work.
- girvo 5y agoAs an update, after ditching the project/build tooling setup that Nesper required, I got Nim working wonderfully (with Nesper's library itself as a dependency) within PlatformIO and ESP-IDF on an ESP32 :) I even have hardware UART support and have a working SIM7000 modem connection going (though only with AT commands, not PPPoS yet, though I'm planning on that next). Nim is the future of firmware development, of that I am sure.
- girvo 5y agoIncredibly slow moving, buggy and badly documented! Embedded is a fun challenge but rough. Nim I believe is an answer to it though, and embedded being slow moving with a C target is perfect for it!
- alexk307 5y agoAwesome 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 5y agoDo you use a USB programmer, or did you buy ones that have a USB programmer built in?
- unwind 5y agoThe ATtiny85 is a rather small 8-bit microcontroller, and controllers in that size range generally don't have peripherals on the complexity level of USB. So no, there are no 85s with USB programming support built in. Truth be told, the 85:s are a bit old now, it was released around 2005. But even the more modern "[012]-series" [1] don't support USB, it is kind of the point. The linked Wikipedia page says: ATtiny microcontrollers specifically excludes various common features, such as: USB peripheral, DMA controller, crypto engine, or an external memory bus. [1]: https://en.wikipedia.org/wiki/ATtiny_microcontroller_comparison_chart https://en.wikipedia.org/wiki/ATtiny_microcontroller_compari...
- titzer 5y agoOk, thanks. (I meant a USB programmer integrated onto a board with the ATTiny85 soldered on). To answer my own question, there are these[1] USB boards that you can pop the ATTiny85 in to program it. I wrote an AVR emulator back in the day, and yeah, they definitely don't have USB :-) [1] https://www.mouser.com/ProductDetail/SparkFun/PGM-11801?qs=WyAARYrbSnY7wU%2FagggNyw%3D%3D&mgh=1&gclid=CjwKCAiA9tyQBhAIEiwA6tdCrIEfq-9YLObacBDGsyEpDIOdQaPPKZxCvPw86AIBU1Qf-1xBqTrhjBoCeDEQAvD_BwE https://www.mouser.com/ProductDetail/SparkFun/PGM-11801?qs=W...
- garaetjjte 5y agoThere are AVRs with USB, in XMEGA series. But that's probably dead market segment, if you want something more complex than ATtiny/mega you usually go to ARM Cortex-M nowadays.
- tgflynn 5y agoI 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 ?
- kube-system 5y agoI believe the old Dell chargers simply have a data pin, which I presume would carry the data generated by this project
- tgflynn 5y agoI guess it would also be helpful to know what range of laptops this is for. I was assuming it was for relatively recent models. I have an Inspiron that's about 5 years old and it has a barrel connector for power. It's not obvious that it contains a third pin. I have at times had problems with the laptop refusing to recognize various power adapters though.
- dec0dedab0de 5y agoIt'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.
- tgflynn 5y agoIf the connector on the left represents the output of a generic power supply then I still don't see how you would connect this on the laptop side. EDIT: On further thought I think that connector must be intended to represent the laptop input and Vcc is the output of a generic power supply (with sufficient voltage and current capacity). It was not clear to me because my Dell laptop doesn't appear to have a 3-pin power connector so maybe this only applies to certain models.
- 5y ago
- bxparks 5y agoThe 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.
- auxym 5y agoAll 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.
- hwh 5y agoAn MCU is a chip in a package that just cannot interface with anything your consumer PC or notebook comes with. You'll need an adapter in any case. That said, lots of current MCUs come with UART, I2C and/or USB bootloaders allowing to erase/program (if not disabled). This bootloader is typically included in factory ROM, not to be programmed by you or a third party.
- sidewndr46 5y agoWhat? Why couldn't an MCU interface with my computer? It's not like it has special electrons or something in it. I regularly program atmega chips with a cable I made that plugs into the parallel port on the back of any computer that has one. If you have a couple GPIO pins on a motherboard, you can probably program almost any MCU with with it. The only exception is if the motherboard GPIO was say 3.3v and you had a 1.8v only MCU, but level shifters aren't exactly expensive.
- ticklemyelmo 5y agoSo do you jam the chip into the parallel port? Or do you...use an adapter?
- londons_explore 5y agoI 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.
- tpmoney 5y agoThe 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?
- londons_explore 5y agoThe 328 is also available in dip...
- bavell 5y agoI 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.
- nanomonkey 5y agoThe 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-laptop-power-adapter/ https://hclxing.wordpress.com/2014/02/06/hacking-the-dell-la...
- tentacleuno 5y ago> 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.
- flashingleds 5y agoIt goes further than warnings though - at least circa 2012 using an unofficial charger (or official charger where this fragile extra wire is broken) would underclock the cpu dramatically. It happened silently, such that I didn’t realize what was happening and why my laptop was so slow until stumbling upon a random forum post about it. I was pretty sour on Dell after that experience.
- tentacleuno 5y agoReally? I have a 2013 Latitude and I haven't experienced that yet (or never noticed). I still have the no-name adapter here, so I'll have to check (I only just got a proper 130W). If that is the case, part of me wants to play Devil's advocate and say that Dell have erred on the side of caution: these no-name adapters really are quite terrifying with thermals, which makes me wonder what wattage they're actually rated for. I was frequently in WTF mode because the adapter block was too hot to keep my hand on. I didn't really have a choice either, as my battery was at like 38% capacity. This official 130W is barely warm under load. Aside: one thing that really eek'd me out about that no-name adapter is that it has a green LED inside it. The only thing is, you can only (just barely) see it through the slits on the sides because the plastic isn't clipped together properly. The manufacturing quality is atrocious.
- rektide 5y agoI 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.
- kennywinker 5y ago> 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.
- Evidlo 5y agoSee also the from-scratch Thinkpad battery with an ATTiny85: https://github.com/iam4722202468/ThinkpadBattery https://github.com/iam4722202468/ThinkpadBattery
- Koshkin 5y agoIs this safe though? (Aren't chargers the way they are for a reason?)