Live data from Hacker News

Emulator of Original Dell Charger Using ATTINY85

github.com

41–50 of 57 posts

Re: Emulator of Original Dell Charger Using ATTINY85

#41
post #40
post #8

Earlier quoted context omitted.

Do you use a USB programmer, or did you buy ones that have a USB programmer built in?

The 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 micr…

Ok, 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=W...

Re: Emulator of Original Dell Charger Using ATTINY85

#42
post #7

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. L…

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.

Re: Emulator of Original Dell Charger Using ATTINY85

#43
post #11
post #7

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. L…

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.

I think what the parent is getting at is that, because the ATtiny85 has so few pins, programming it usually requires it to be removed from the target circuit.

Re: Emulator of Original Dell Charger Using ATTINY85

#44

Earlier quoted context omitted.

Really? 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…

Update: looks like you were right[0], although it doesn't affect my 2013 Latitude, if Linux's cpufreq diagnostics are anything to go by. # Running on battery power. cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq 3500000 3500000 3500000 3500000 # No-name charger inserted. cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq 3500000 3500000 3500000 3500000 # Genuine charger inserted. cat /sys/devices/sy…

Try applying load to the CPU and see what cpuinfo_cur_freq reports. If I boot my ThinkPad W530 (workstation laptop with a large power envelope) with no / dead battery, it will say full speed is available, but it will remain at the minimum speed until the battery is partially charged and I reboot.

Re: Emulator of Original Dell Charger Using ATTINY85

#46
post #8
post #3

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.

Do you use a USB programmer, or did you buy ones that have a USB programmer built in?

I flashed the Arduino bootloader on mine by using my Arduino Uno as a programmer

Re: Emulator of Original Dell Charger Using ATTINY85

#47
post #14
post #9

Earlier quoted context omitted.

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,…

In 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 som…

Nice 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.

Re: Emulator of Original Dell Charger Using ATTINY85

#48
post #41
post #40

Earlier quoted context omitted.

The 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 micr…

Ok, 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=W...

There 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.

Re: Emulator of Original Dell Charger Using ATTINY85

#49

Earlier quoted context omitted.

What? 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.…

So do you jam the chip into the parallel port? Or do you...use an adapter?

I don't see the difference if it's just a parallel cable. Do you jam an STM32 into a USB port?

Re: Emulator of Original Dell Charger Using ATTINY85

#50
post #47
post #14

Earlier quoted context omitted.

In 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 som…

Nice 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 fi…

To 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/auxym/nim-on-samd21

And I've used and contributed to 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.

Post reply on HN