106 points · by unwind · 6y ago · 96 comments
I think most everyone has the technical skills to go through this tutorial but a large chunk of the developing world will not be able to afford pcb manufacturing and all the tooling for SMD components.
Having an 8bit AVR with a through hole form factor democratizes access to electronics for a lot of people around the world.
Any maker can take a 1$ veroboard and build a semi-permanent circuit board with a very crude soldering iron. Whereas if you miniaturize further with SMD formats, then the access to materials and tools becomes an economic barrier.
I can solder qfps and tssop no problem but it's still easier to solder a dip package, they can go in breadboards or perf board and you can bang together a circuit without temperature controlled stations or cad software
One thing that I have found is PTH is much more forgiving than SMD. The copper tracks and pads are typically much heavier and can tolerate a lot more abuse from the less skilled.
For a lot of economies an SMD design immediately prices out a lot first-time makers. Specially if you compare that with a $1 veroboard and a $10 soldering iron.
You don't need any special tooling to solder SMD components, either. A temperature controlled soldering iron and a cheap hot air station are perfectly sufficient.
To make this a bit more concrete, consider that you can get 10 custom two-layer PCBs made for $2: https://cart.jlcpcb.com/quote?orderType=1&stencilWidth=100&s...
SMD only is a huge no-go for someone at the lower bracket of income.
The cost of a perfboard, with a cheap soldering iron and components is a fraction of any kind of equipment you need to create a circuit board from scratch.
I built voltage regulators for my electronics projects, because a regulated lab supply was completely out of financial reach. I couldn't have done it with a breadboard - I needed a permanent fixed board. I couldn't have done it with a copper laminate and etcher - because I couldn't afford $10 for the etch or a $40 dremel drill for the holes.
I didn't have a programmer and I had to reuse the RS232 chips to program ATTiny2313.
If people like you had their way, I would have probably been a barista...
Holes are already drilled in your veroboard, that's what they are for, your job is to solder and you want it to be easy and simple.
SMD is a pain during prototyping and experimenting because they’re harder to use on breadboards (breakout boards are an additional step and possible point of failure). After the breadboarding stage, I think SMD is easier and faster.
I'm not sure that's true anymore. PCB fabrication is dirt cheap from the Chinese fabs. In terms of design, KiCAD is free and perfectly usable. Both design and assembly take some practice, sure, but they are valuable skills to learn.
There's value in DIP packages for breadboarding, so you can get going quickly and iterate the design, but for anything permanent or semi-permanent, I don't see a big impact.
Using KiCAD, then waiting for the equipment and then soldering - that is already a barrier.
Imagine you need a small voltage regulator on your DC supply line, because your cheap power supply spikes randomly... Are you going to wait for your PCB to be printed and a month for delivery(sometimes 2 months) and pay $6+ for a single board for delivery(components excluded, obv)... or you're getting a 10 pack of perfboards for $5, cut our the right size and have your voltage regulator within 10 minutes at a fraction of the cost...
Sure as professionals you might work with $20K oscilloscopes and relatively speaking spending less than $100 on a basic SMD soldering station is peanuts, but we need to appreciate this is simply not the reality for a lot of the world out there.
This has nothing to do with the technical merits of SMD or how easy/hard it is to solder versus through-hole. For a lot of kids and makers in developing countries dip packages and veroboard are the only economically feasible gateway to start to make electronics.
I don't understand why everybody is struggling to accept this. Perhaps it is just a failure to appreciate the economic lottery of where in the world we are born.
To me it is sad that there are kids out there who would stop their curiousity just because of economic barriers, I hope AVR's dip packages continue to be produced for a long time to come.
Instead, I just deleted the SQLite requirement and avoided the whole thing. The only way to win is not play their game. :(
It's actually ironic, as I had learning TCL on my todo list due to interest in CNC machining (some older stuff used TCL).
But not any more. Even going to the TCL language home page, they push people towards ActiveState. That's killed my interest in TCL entirely, and likely permanently.
I still wonder to myself how i can back into this hobby. These kinds of tutorials are nice but they always kind of leave you wondering what else one can do. IMO it takes so much more than just the mC to make something useful/interesting, as it's just the brains of the operation. One still needs to give their project the arms and legs to really do something.
What helped me most was having concrete and doable projects that you'll want to finish. My first project was a digital dice (attiny85, 7 leds, CR2032, button and a small perfboard). Now it's a led strip for a camper (esp8266 w WLED firmware, potentiometer, 5V stepdown converter). I'm also toying with radio transmission over 433Mhz so I can have battery powered sensors (water-well depth, temperature, etc)
They have a bunch of tutorials, aimed at absolute beginners, but they also have a lot of great breakout boards for different sensors and their store is well stocked with weird little trinkets that inspire creativity. Blinking stuff, actuators, sensors, all there.
sparkfun.com is a similar shop.
It's a bit like shopping individual lego parts.
micropythin deserves a shout-out too for getting something happening with minimal toolchain setup overhead.
A question to the fellow Embedded Developers?
How often do you encounter tutorials and "getting-started-guides" of similar quality than you see here (and in similar blog-posts) FROM THE ACTUAL CHIP VENDOR.
I often feel stuck between a rock and hard place with vendor docs and it feels like there is only the choice between marketing material and transistor-level technical docs (excuse the hyperbole).
Funnily enough some Chinese Semiconductor companies who can't effort to develop such fancy SDK Wizards tend to have the more digestible SDKs (just a bunch of simple periph drivers with a Makefile) Unfortunately they also don't afford good / English documentation :\
Semiconductor companies (in my experience) are finally starting to accept the importance of software, so documentation is the next battle. It's coming, but slowly.
They come with a USB boot loader (so you don't need a USB to serial cable). Get 2 and you can also use one as a programmer (probably cheaper than a USB to serial cable).
They're also compatible with the Arduino IDE if get fed up with the low level stuff
AVR has 1.8V to 5V power tolerances. STM32 boards have 1.8 to 3.6V tolerance. (Yes, STM32 boards can have 5V I/O tolerances, but you need the power line to be ~3.3Vs)
This means that you can run an AVR system from 3xAA batteries or Li-Ion without much more thought involved.
STM32 is more complex: 2xAA works, but that's much less energy than 3xAA. Lithium Ion is nominally 3.6Vs, but when charging Li-Ion can be 4.2Vs IIRC, so you're going to need to protect the STM32 from the higher charge voltages, because 4.2Vs is out-of-spec.
This means that STM32 needs an external voltage-regulator module, while the AVR can just happily accept the 4.2V voltage-under-charge under a Li-Ion setup.
-------
The 5V that ATTiny or ATMega supports can also deliver more power from its I/O pins. STM32 is pretty impressive with 15mA source/sink from 3.3Vs, but ATTiny and ATMegas are specified with up to 20mA at 5Vs, both source and sink. That's a lot more potential wattage you can source (and sink) from a raw I/O pin.
----------
So consider what you need to do if you have a 5V line (3x AA batteries): you'll need to create a safe 3.3V line for your STM32, you'll need to have a reference 5V voltage that your ADCs are based off of, and you'll need a voltage-converter to handle all of your 5V electronics.
Or, you can just throw an ATMega or ATTiny at the problem, and just run your entire system off of 5V (ADC, I/O pins, everything).
In my experience, the higher voltage (5V instead of 3V) has a lot better op-amps, and other such devices, that you can work with. Having more voltage is an advantage in electronics design: it really makes things a bit easier to design electrically. (Less noise, less hysteresis issues, etc. etc).
A rail-to-rail OpAmp still only has +/- 2.5Vs at the 5V level, but that's a lot more voltage to work with than +/- 1.65Vs at 3.3Vs, especially if the rail is losing 0.2Vs as is typical. (+/-2.3V once you lose 0.2Vs, but only +/-1.45V on the 3.3V system). Traditionally, OpAmps operated at +/- 12Vs for a reason, the larger voltage just gives you more room to play with. Throw down 100mV to noise
5V also opens up the possibility of running off of a USB line without any voltage-regulation. An important-trick for sure.
Part of it is the voltage flexibility that dragontamer mentioned — two run off USB power and include 5V SPI LEDs, and one runs off unregulated 3×AA.
The other part is simplicity and directness — I can just write *PORT=0x42 rather than rely on some vendor BSP that doesn't address my use case and will be deprecated next month.
They're fine for very cash-strapped beginners, but it would behoove new developers to leave them behind quickly. They are more expensive and less efficient than modern options, and you won't find many well-paying jobs asking for AVR/Arduino experience.
STM32 chips are a much better option, IMO, especially for beginners. They come in sizes ranging from <$1 Cortex-M0 chips up to dual-core Cortex-A/Cortex-M processors, and they use the same sorts of peripherals across all of those product lines. So you can start small, and incrementally learn about more complex parts and topics.
And if you really need a breadboard-friendly chip, an MSP430 is probably a better option. It's a 16-bit MCU focused on power efficiency, and it has GCC/Arduino ('Energia') support. Some of them also have non-volatile FRAM memory.
But I don't really see why to use that, there are loads of breakout boards for the others in the similar series, attiny3217 is good.
I prefer with PIC, as they offer real time very predictable execution. All instructions have same execution time.
You are probably not implementing a gdb stub on that while still having meaningful resources (memory, peripherals, execution time) left for your an application complex enough to warrant that level of debugging support. :)
That said, it seems these cores have some on-chip hardware debugging support. See the data sheet [1] section 30 ("Unified Program and Debug Interface (UPDI)"). Features include:
- Memory mapped access to device address space
- Unlimited number of user program breakpoints
- Two hardware breakpoints
- Run-time readout of CPU Program Counter (PC), Stack Pointer (SP), and Status register(SREG) for code profiling
- Program flow control (Go, Stop, Reset, Step Into)
- Non-intrusive run-time chip monitoring without accessing system registers
This interface is the one that is described in the article, and accessed over a single pin on the chip package. I think it sounds pretty neat, makes me want to have a look at AVRs again! :)
[1] http://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny406-Da...