On Aliexpress I am finding many cheap development boards with ATtiny167 and a USB connector.

From what I can gather these boards permit USB programming through USB emulation. Can anybody point me to more information on how this works?

I imagine, there needs to be a bootloader that does the USB emulation part? Is the code for it available anywhere?

I have been searching but could not find any useful information. I think I must be using the wrong keywords...

EDIT 1: justme asked for links to an example of the boards I am referring to.

One example would be this Aliexpress offer:

enter image description here

  • 1
    \$\begingroup\$ We have no idea what dev boards are you talking about and how they work unless you provide a link to a specific example. \$\endgroup\$ – Justme May 11 '19 at 8:45
  • \$\begingroup\$ @Justme I added a link to an example offer on aliexpress. I thought this would be a well-known use case for the ATtiny167. I did not realise this functionality was manufacturer specific. \$\endgroup\$ – ARF May 11 '19 at 9:52
  • \$\begingroup\$ obdev.at/products/vusb/prjprog.html You have to put a V-USB bootloader on the board via ISP first (which the retailer maybe did) on from that on, you can re-flash it via that bootloader and USB. \$\endgroup\$ – Janka May 11 '19 at 9:53

The USB bootloader used for these is probably Micronucleus. You will find that one of the supplied configurations supports the 167 - don't know if the pin assignments need to be fixed for this specific board, but chances are, there is a preconfigured bootloader already on the board. Since ATTiny doesn't have a protected bootloader area, it is possible to shoot down the bootloader from the application firmware, so it's good to have the bootloader source around.

The board appears to be a 1:1 clone of Digispark Digistump Pro. You should be able to use Digistump's board library in the Arduino IDE to talk to it.

Note that since relatively high frequency of 16 MHz is needed for USB emulation, the ATTiny runs at 5V rather than 3.3V, while USB signalling is 3.3V. The level shifting and USB presence detection implemented with diodes and resistors is anything but compliant and robust, and there can be timing issues too, whether it will work with any given USB port or hub is largely up to chance. If you need robust USB support for your project, keep in mind that STM32 platform also has Arduino cores and you can get ultra cheap boards often nicknamed "blue pill" in the community.

  • \$\begingroup\$ Thanks for the explanation and the warnings. My question was mere curiosity; i.e. how the **** does this work... I did not have an application in mind. Thanks also for the hint regarding the blue pill. These are incredibly competitive devices. From a quick look, I am not quite sure how the ATtinys are still competitive. Though admittedly I only looked at the prices of the development boards... I am sure at some point I will find use for one of them. \$\endgroup\$ – ARF May 11 '19 at 16:30
  • \$\begingroup\$ The whole Microchip group survives largely on legacy products and designer inertia for a large swath of the product lineup, as chip prices haven't been competitive with numerous other chipmakers for a while. The new $1.50 blue pills often contain a knockoff chip, CS32F103C8T6, not a genuine STM, but it seems to work fine. Some chips seem to lack Boot0 serial bootloader but work with ST-Link. Then again, genuine IC is dirt cheap too (<$1 at volume, $1.70 single), thus its high proliferation in modern Chinese products, which in turn caused clone ICs to appear. \$\endgroup\$ – Siana May 12 '19 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.