5 ms·
> it's not competitive with the expensive avrs when it comes to mixed-signal peripherals and 1.8-volt support. you get 3.3 to 5 volts, a 10-bit adc (1.7 megasam
by dragontamer 2y ago
> it's not competitive with the expensive avrs when it comes to mixed-signal peripherals and 1.8-volt support. you get 3.3 to 5 volts, a 10-bit adc (1.7 megasamples per second with a ±2% bandgap reference), and an op-amp (so you can do differential input to the adc and set its gain), a basic set of digital peripherals, and that's about it. that's still better than an atmega328 or an stm32f103 but not in the same league as the stuff you're talking about
Yeah, the features you just talked about are definitely more akin to what AVR Dx or Ex have to offer (albeit the ch32v003 is cheaper and has less features).
I do like this modern trend of making incredibly powerful peripherals that most mixed-signal designs need (ex: adding OpAmps to a device, or in the AVR case, adding Differential ADCs to explicitly support more use cases). This design trend didn't exist back in the day when ATMega328pb was designed however, so you don't get it with the old chip.
-----------
OpAmps seem to be one magic device that really should be in more of these designs. There's so much you can add with one OpAmp (or a team of 3x OpAmps). So I love it when people point out chips with an OpAmp (or two or three) that come with a uC.
I've seen some pretty silly designs, like using the OpAmps to sense Voltage (or current), hooking up the output of those OpAmps to the Analog Comparator that triggers an interrupt + internal state, and that state controls a Timer-waveform / PWM output that controls a Voltage-Controlled Current-Controlled battery charger that's feeding a MOSFET + inductor to create effectively a software-controlled buck-boost converter. I doubt its as good as any "real" solution, but if you've got a bunch of these uCs lying around, it might be a better solution than adding more SKUs of the specialized power chips.
Just a hobbyist here btw. Not a real engineer. The real engineers might look at my previous paragraph with horror!
- kragen 2y agoyeah, i think software control of buck and boost converters is a mainstream thing to do at this point, and if you think about it, that's what you're doing every time you control a motor with a pwm signal, even if the motor's windings are the only inductor. building discrete dc-dc converters turns out to be the main purpose for the 184-picosecond-resolution high-resolution timer included in chips like the stm32g484. i was reading this appnote yesterday: https://www.st.com/resource/en/application_note/an4539-hrtim-cookbook-stmicroelectronics.pdf https://www.st.com/resource/en/application_note/an4539-hrtim... incidentally, even the old attiny chips that don't have adcs at all do have analog comparators, so you can do tricks like that with them too i'd be happier with the on-chip op-amps if they also included on-chip analog multiplexers, resistors, and capacitors sufficient to build something like a sallen–key filter in software, but so far only the cypress psoc line seems to be doing that, and it's probably a lot of chip real estate to sacrifice for an inferior version of a couple of 0.3¢ external components i'm not an ee either, i just play one in ngspice