AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Arduino timer interrupt fan12/29/2023 My main concern is programming those little suckers out in the field. It's mostly a desire to keep the main microcontroller free of low-level hacks that mess with the arduino libraries, whereas the libraries are mostly redundant if the chip's function is just to read the serial line and set the PWM output to a certain duty cycle. Some of you might be asking why I'd be ok with high-frequency PWM from the ATTiny and not from the 328P. Then I started looking more closely - I could control two fans with a single one and have enough pins left over for an I2C (or workalike) interface. The thought of wasting a microcontroller just to act as a PWM generator didn't sound right. One person lamented that an ATtiny would be cheaper than any dedicated PWM solution. Literally every other PWM IC I found either included feedback circuitry for switch-mode PSUs or beefy power output capabilities, to drive big LEDs and small motors. This bugged me to no end, so I looked around a bit. However, pricing has to be favorable - I don't see much of a market beyond 50 bucks (your favorite currency). It'd be fine for a personal project, but I would like to try to sell a few. I'm looking at 3.40€ apiece, with the monitoring 74s totaling 3.27€. They're not very beginner-friendly, either, being TSOT-23 parts exclusively. Each of them costs as much as the entire monitoring circuitry for four fans. So, where's the big cost, 328P aside? It's the damned LTC6992-1s. On the monitoring side, it's just a bunch of 74-series stuff: One SN74LV8154 dual 16-bit counter per two fans (8 bits would be enough for 99% of users, but the dual 16-bit design is more compact than the alternatives I examined), a single SN74LV166A parallel-load shift register and a single SN74LV137 3-to-8 decoder. My current design is more or less as follows: The main microprocessor is an ATmega328P, which outputs low-frequency PWM to an LTC6992-1 PWM modulator (it takes a constant voltage, nominally, but its response is essentially flat up to 10% of the output frequency, at a nominal 25kHz output). ![]() ![]() That last point is where I'm having some trouble.
0 Comments
Read More
Leave a Reply. |