VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » Knowledge, science, education » GreatScott!
I tried the Cheapest Arduino Alternative (that Nobody heard of)

I tried the Cheapest Arduino Alternative (that Nobody heard of)

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
we will be having a look at another Arduino Microcontroller alternative: the Holtek Microcontrollers from Taiwan. These are some of the cheapest microcontrollers you can get and they offer lots of useful features. So how easy are they to program and would I recommend using them Let's find out! Useful Websites for Holtek Programming: Thanks to JLCPCB for sponsoring this video. Visit to get professional PCBs for low prices. 0: 00 I need a CHEAP uC! 1: 40 Intro 2: 30 What features do we need 3: 42 HT66F002 Feature Overview 4: 17 How to Program it 5: 15 Output Feature Blink 7: 07 Input Feature 7: 48 PWM Feature 9: 04 ADC Feature 10: 07 Sleep Mode (Low Power) 10: 45 I2C Problem! 11: 53 Verdict
Date: 2024-03-10

Comments and reviews: 20


Silicon Labs EFM8BB10F8G (16-20 pin soic/qfn) is under 60 cents at some distributors, if you order 100 or more. Has more ram and space for code compared to Holtek chips.
Second suggestion (besides trying Risc-V) would be to find a PIC16F microcontroller under a dollar as one can usually easily switch to other part numbers in the same family for higher pin count when needed, and also programmerrs for these are now available for under 40-50 dollars and you can reuse the programmer with hundreds of controllers.
I would also like to mention the slightly outdated but very informating The amazing one dollar microcontroller by jay carlson where he compares and views and benchmarks multiple microcontrollers that were priced at around one dollar at the time of the article (a few years ago)

reply

While you spent some time learning the syntax to code these chips, the good news is you can create your own reusable wrapper libraries that are compatible with Arduino code and make future projects easier and faster to build.
Arduino was originally based on Atmel microcontrollers, which have had really nice opensource tools for a long time. You can easily build your own programmer for them as well. You can still buy these chips independently and use them in your projects.
Fun project and demonstration of the power of more generic microcontrollers. Thanks for sharing!

reply

Making pauses in code is a bit off. It's better to count and use a variable. Mode 1 is the first 20. 000 or whatever.
Main_loop:
If c40000 then
c=0
endif
Now you can run a clock or whatever on displays and whatnot in between.
if mode=1 then
blink(x, y, z)
endif
if mode=2 then
blink(x, y, z)
endif
if clocktime or secret_project then
a _bunch_of_code(x, y, z)
endif
goto main_loop (or your way of doing it, maybe while true)
This is to help yourself, not me.

reply

I have been using Holtek MCU for decades. It was the most popular MCU for DIY and electronic enthusiasts before Arduino was launched. The downside of Holtek MCU is the price of their emulator. Holtek MCU is ideal for project that involve mass production, but not for end user who only need one or two MCU for their circuit design. And for the e-link emulator, a bare board version will only cost around USD20 if you can find it in Taobao. Hope this info will help for those who would like to know more about this MCU.
reply

If you are dealing with a new chip the first thing you should do is to blink led, but the second should be a memory bridge (remote memory accesses through UART) to a PC.
If you have a bridge and python running, you can read and write any memory location of any chip with python doing all dirty job of output formating. You can do OOP with python just like in micropython because all scripts are running on PC side.
A bridge is just simple firmware than can read and write memory via UART.

reply

Is programming hardware interface protocol really proprietary
For I2C, could do it in software, much like it is available in Arduino when you want to use non-standard GPIO pins. Perhaps take a look at the Arduino library and adapt it for this MCU.
I've gone register level programming in Arduino to speed up an EEPROM programmef project that was a takeoff from one of Ben Eater's projects.
How about one of the PIC chips They're pretty popular for projects like this.

reply

Actually the i2c master is much easier to implement than a slave, you could easily do it via bit banging. That is the reason why most cheap controllers don't support it directly. Doing a slave via bit banging is much more difficult, sometimes even impossible on high level controllers running proper operating system. It is a pity that you gave up so quickly: ) otherwise a nice video considering you are not a software engineer. greetings from Slovakia!
reply

I have heard, but never tried of some really cheap ARM microcontrollers. They are new and extremely capable yet very cheap. And from what I also heard you can program them with any SWD even made from RPI pico (no dedicated programmer! (at least as much as I know. There are for example Cortex M0 from PUYA - PY32F002. It is just amazing how much they packed there and it is so cheap.
I would love to see some tutorial on how to get started with ARM.

reply

8 cent: PY32F002/PY32F003 from PUYA for microcontrollers with an ARM Cortex M0 core clocked at 24/32MHz.
PY32F002 20kB FLASH, 3kB RAM, SPI, USART, I2C, ADC, timer. nothing to complain about.
PY32F003 additionally DMA and a few more timers, there is also an additional memory selection.
It is an SWD interface that does not require a special exotic programmer.
Power supply 1. 7V. 5. 5V, TSSOP, to small QFNs or DFNs.

reply

for less you could've gotten an arm based PY32F002A from puya. which has an ADC, (secretely also has DMA because it's a 030 on the inside) and many other goodies, it also runs at a 24mhz base clock. that holtek mcu seems wildly outdated to be honest. If you want to get something as cheap as possible then you could just get a PMS150 from padauk but even these are kind of a pain to work with nowadays.
reply

It seems you have spent more than $1. 80 x 14 in just time to figure out how to use the cheap’ MCU. You stated a couple times that it took half a day to chase down problems. Just get one of the cheap arduino compatible MCU’s, use the quality IDE, and pull from the huge library of code already written (some by you.
Seems like a lot of brain damage for nothing unless you just needed a challenge.

reply

How fast can that distance sensor update and how accurate is it I had a project in mind for a height sensor under a vehicle that would need to work whether
it was in slow traffic or 70mph on the motorway. Could it detect a 1 / 25mm drop I know it would need to average the height as the suspension dips on the bumps etc.
but thought it may work reliable enough. Any thoughts Thanks.

reply

Embedded hardware engineer here.
w95 interface is mostly an industry standard. It wont lag and will run on any crappy pc anyone could have.
For an i2c - you can always make soft-i2c through bit-banging. Thats always worth the time spend, because it allows our clients to pay us once for making it possible, than to spend lots(20-40%) of money on every device they'll need.

reply

Stop using term Arduino microcontroller. There is no such thing. Arduino boards (even the official ones) use various dissimilar MCUs many times of completely utterly ridiculously dissimilar architectures.
E. g. Arduino UNO R3 uses Atmel AVR Atmega328p and R4 uses Renesas ARM Cortex M4 based RA4M1. Even the basic computation model of those architecture is different.

reply

Next time you load a Chinese IDE, may I suggest doing so in a virtual machine dedicated to the task. Just to keep anything infectious away from your working environment. (Not that I expect Chinese IDEs to intentionally to include malware, but sometimes their developers don't practice proper security themselves and pass on what's on their systems)
reply

Great video! It is important to show failures sometimes to highlight the thinking and work involved with solving novel problems.
I also liked it because I came across the same family of controllers while adding wireless control to a toilet seat warmer recently, so I could turn it on as soon as someone walked toward the bathroom.

reply

Why not just bitbang the I2C implementation, if you only have 1 i2c device it shouldn't be too hard to do. If you don't want to deal with that the ATTiny202 does everything you want with a price of $0. 47 USD, note the datasheet specs it has SPI and TWI but as stated in Microchips device doc TB3181 TWI is i2c compatible.
reply

Try an attiny402.
Costs 0. 38 here, should be available in germany but price may vary.
Upto 20mhz5v
2x uart ports
1x i2c
1x spi
2x interrupts
4x pwms
5x gpio(all can do analog or digital readings)
Can use at once:
1 uart spi
1uart i2c
2 uart ports
5 gpios
Edit: added reasons.

reply

It was so close to programming in raw assembly code that you might have been able to bit-bash your I2C functionality. Even on the smaller chip.
The watchdog was the first thing that came to mind when I saw the way the LED was behaving. Every time you move to a new microcontroller there's a bit of a learning curve.

reply

Did you try to implement i2c master in bit bang fashion (master decides when SDA/SCL goes high when goes low, when send start condition on pair of signal, when receive an ack, ) I made this way on all MCU like c51 In early days when c51 does not support any kind of i2c buses. Btw thanks that show me new type of MCU
reply
Add a review, comment






Other channel videos