Ultra-Cheap Microcontroller Powers Addressable 7-segment Display

Since their being revealed to our community over a year ago, the various ultra-cheap microcontrollers in the sub-ten-cent price range have attracted a lot of interest but not so many projects. Their slightly annoying programming and PIC12-derived architectures present a barrier not mitigated by their price, when picking up an Atmel or other processor represents a much easier choice. That’s not to say that they aren’t slowly making an appearance though, and a cracking example comes from [Tim], who’s used a Padauk microcontroller to make an addressable 7-segment display. If you’re used to addressable multi-colour LEDs, this extends the idea into the world of numerical information.

The result is a PCB little bigger than the 7-segment display it serves, with interlocking 0.1″ pin connectors allowing daisy-chaining of modules. The extreme low cost of the parts makes it an attractive solution. Software wise it’s driven in a similar manner to addressable LEDs, and he goes into significant detail on its protocol. The firmware can be found in a GitHub repository. He directs readers to the Easy PDK programmer and the Small Device C compiler, which should be of interest to anyone tempted by these processors.

35 thoughts on “Ultra-Cheap Microcontroller Powers Addressable 7-segment Display

    1. Long story short from the hours of babbling of Davey Jones:

      * A bunch of volunteers ported SDCC to the Padauk uC family (which is near C99 compliant as far as I know, but much more like regular C compared to the “mini C” that Padauk made for their chips.
      * They also reverse engineered the programming protocol and made a programmer for those things.
      * Al the stuff is on github (or at least somewhere else accessible on the web)
      * The Padauk uC’s start at about 3ct each, but they are OTP’s, so not reprogrammable.
      * The original programmer seems to be sold out or hard to find. It also has a built-in emulator, which partially circumvents the OTP nuisance.

      I do not know if the open source programmer has any emulation capabilities. C functions are often largely debuggable on a PC without external hardware, and as intermediate you could also use a completely different uC family for firmware development, as C is pretty much portable between almost any uC family nowaday’s.
      For me, working with these things would be too much of a nuisance, but if you are willing to put up with the above for the low prices for higher volumes, or just for fun, then it’s definitely worth checking out.

      Also, a (few?) year(s) back, Davey had another series of video’s about this uC family. The “mini C” was (still is) a bit of a weird sub set of C, but the way that Padauk integrated it in their IDE was quite smart and novel. Integrated help functions that really work, and direct copy and paste of example functions and snippets directly from the manual to the source edit window.

      1. I’m glad I’m not the only one that has a hard time sitting through his videos. Someone recommended them to me and I didn’t like them because there’s so. much. talking. I actually feel kind of guilty not being into them though, because it seems like everyone else is.

      2. Poking through the repositories on github, there’s at least one that implements a vhdl model of some of the chips. That’s probably meant as the basis of some in-circuit emulator

      3. * Actually, SDCC is closer to C11/C17-compliance than to C99 compliance (since variable-length-arrays are optional in C11/C17)

        * There also is the PMS15A (not available at LCSC) that is about 1 Cent, when bought in quantitites of 10.

        * There are Padauk µC with flash, but they cost more (e.g. the PFS154 at about 6 cent and PFS173 at about 8 cent). Most of the examples on github have been written for Flash devices, and not tested on OTP devices.

        * The Padauk in-circuit hardware emulator is a different device from the programmer. Also, the emulator cannot fully emulate most devices (typically, there are restrictions in clock-speed or instruction set differences).

        * SDCC includes software emulators for one device from each of the pdk13, pdk14, pdk15 families (used for automatic regression testing).

    1. Heh, I used a lot of 7400 ttl back in the day. I dunno what ever became of my old stashes. What is kind of weird is I can even recall what a couple of the boxes of stuff looked like.

      1. There is one small box that eludes me. I too know what it looks like. It has Z80s, support ICs, static and dynamic RAM chips, ADCs, and possibly speech recog and synth ICs. I want to find that one, but hoping that whatever larger box it’s in, also contains a bunch of displays, like a 40 char 8 line LCD, and a kind of breadboard workstation and a few other bits of really neat kit.

        Though just as I’m sitting here writing this, for the first time I just got an inkling that I miiiight have put that IC box inside one of those large sized cookie tins, which may also contain some of the other stuff. I might have been ignoring it on previous searches. Hmmmm

    2. I still have a tube of PIC12F series 8-pin ICs to work through, and I plan on learning the little AVRs too, but another dirt cheap small micro, even OTP, would be interesting if it had a popular enough ecosystem including a Nano-like generic board available, and a hardware reprogrammable emulator.

  1. Once you want to drive more than 3 or 4 digits, you would try to multiplex the display as the cost goes up as you pile on uC per digit. e.g. STM8 that goes on for sale at $0.20 from time to time can drive up to 6 digits multiplexed + UART Tx and Rx. It got a decent open source and free licensed commercial compiler.

  2. I had a similar idea, to use them as serial addressable rgb led controllers/motor controllers/sensors..
    or maby try to program them to act as logic gates.. and build a gigatron clone =)

    1. https://lcsc.com/product-detail/PADAUK_PADAUK-Tech-PFS154-S16_C317613.html

      LCSC is an actual distributor.

      I’m also having a long term suspicion of cartel forming and price fixing for prices of semiconductor components. No matter to what western shop go, and all the big western player must be in it. Mouser, Digikey, RS, Arrow, etc. The way they work are just to similar. You can buy a single 0805 resistor for them for 20ct, while LCSC for example simply does not do that. For such items they have a minimum order quantity of 100 or so, and surprise. 100 resistors from LCSC are about the same price as a single resistor form the west side of this ball of dirt.

      Findchips, Octopart, etc also do not list the “Chinese” stuff at all and I do not know why, but I can think up some reasons. Most likely is because they do not earn money from Chinese parts. Maybe the Chinese are simply not interested in making their databases with components available. When you go searching for datasheets of Li-Ion charger chips, then a surprising number of datasheets are Chinese only. Other datasheets seem to be translated by a 3rd party.

      1. The vast majority of the chips I buy from Mouser do not come from China. Nor do the capacitors, resistors, etc.

        If I buy a dev board, it was probably assembled there. The plastics are likely from there.

        Chinese are definitely not interested in making component databases available; their supply chain, their economy, is based on personal relationships and haggling, not published menus.

        And their parts databases are not even categorized in a compatible way; here a part number is very specific, and applies to an individual manufacturer. In China a part number is only a functional description of what the device does. So nearly any 555 timer is the same, and if you specific a specific one, the strip the rest of the fluff off your part number. That’s part of why assembly is so cheap; you got generic replacements and you didn’t even have to ask for them. And the people making the device think you did ask for them! And if you ask for a cheaper price, they interpret that as asking for less performant parts, they don’t imagine that you’d be asking them to just take a hit and not make their share of the profit.

        So when you order 1 resistor from Mouser, and 100 from China, they’re not the same parts. Even if the invoices list the same parts, they’re not going to be the same. And when you reorder, you have no way of specifying that you want a part from the same original supplier as before. You have no way of controlling the statistical accuracy of the part, even if you specify it.

        Depending on the type of product you’re making, this could all be good or bad. When I buy a TI chip from Mouser, I’m usually pretty confident that the charts on the datasheet will be accurate, not just that it will meet the minimums. And I can probably overclock it if I want.

        It is similar to the cliche about Japanese engineers including the exact specified number of failed parts in the delivery. The misunderstanding just cuts at a different angle. Americans often think that they can just stamp their feet and insist they really want a part from a certain company, but that is like going to a metal supplier in the US and insisting you want to buy steel that came from a certain factory. You may be able to convince the owner to tell you that is where the steel is from, but the fact is he doesn’t know and you can’t order it that way unless you paid the very highest price on the market. And nobody goes to China to pay the highest price.

    1. On the picture from the back, it looks like they are slightly misaligned. This happens easily because the connectors have a bit of play in the holes.

      An easy way to avoid this is to put the connectors in the boards, then mount everything together, making sure the alignment is good, and then solder them.

      1. Yes, me dropping some of the segments while they were connected didn’t help either with alignment :)

        One could probably come up with some addiotional interlocking structures on the pcb to fix and align the segments.

    2. In mechanical engineering no 2 parts can be the same size.
      No need to argue about it. It’s a simple fact.

      I can see a few sensible options for this PCB.
      1. Make it smaller then the display (half a mm would probably be enough)
      2. Make it as small as it can be. The PCB can easily be 5mm narrower than it is now.
      3. Make it higher, give it ears and mounting holes.
      4. Make panel of these with routing and mouse bites to break off the length you need.

      The wobbly connectors are just not very convenient for putting multiple displays in some front panel configuration.
      Another small but useful improvement is to expose some copper in the corners, so the boards can be easily soldered to some kind of framework.

      1. Im curious on your “no 2 parts” comments. I have a degree in mech. engineering and dont know that Ive ever heard that statement. Do you mean that w/ tolerances, nothing is ever exactly the same dimensionaly or is there s design precept I missed?

  3. That’s actually really cool, and got me thinking. Dedicated addressable 16 Segment drivers are pricey, but a few Paduk chips per character would get the job done the same way this works with 7 seg’s

    1. It’s long surprised me that I don’t see more 16-segment displays here.

      I have a couple tubes of them burried in my garage somewhere that I bought at a hamfest several years ago. At the time other sorts of displays were still kind of pricey and I thought I had hit the jackpot. Then between the expense of dedicated drivers, the work of rolling my own and the fact that really cheap character LCDs hit the market a short time later I never did anything with them.

      This may just be the development I’ve been waiting for to actually put them to use.

  4. This project is super-clever. UART to cascaded digits is pretty useful. and there’s great design all around.

    And I love the description of the WS2812 protocol as 1N1 serial instead of some pulse-duration thing. That’s deep!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.