I am looking for a 'cheap MCU' that can be firmwareed using 'Arduino IDE'

I am looking for a 'cheap MCU' that can be firmwareed using 'Arduino IDE'.

[Reference URL]

[Function performance details]

  1. ADC 2ch: Check input voltage value, check NTC temperature value
  2. PWM 1ch: MOSFET output
  3. GPIO 2ch: Switch, LED

We are going to use 'ATmega8' to perform the above function.

[What's being planned]

  1. MCU: ATmega8
  2. CLOCK: Internal clock 8MHz

[What I'm curious about]
Q1) Is there a cheaper ‘MCU’?
I am currently thinking about 'ATmega8'. Please recommend.

1 Like

Cheapness is a relative concept and depends on the state of the market and the season, on region where you live, depends on whether you are ready to buy clones and how long you are willing to wait for delivery... etc...

1 Like

How much memory do you need?

2 Likes

1 pc or 1000+ pcs?
If you are looking for ordering just few from aliexpress, you might find that some arduino or stm32 devboard is costing less than bare chip.

4 Likes

you should draw up a requirements-specification
this should give you an idea of the processor requirements in terms of computing power,
memory (flash and SRAM), IO (I2C, SPI, GPIO, Canbus, ADCs, DACs, etc), WiFi/Bluetooth/LoRa connectivity etc
you then select a microcontroller to meet the requirements allowing some room for expansion (when prototype is operational end-users always ask for more functionality)

1 Like

[Specifications I want]

  • ADC 2ch: Check input voltage value, check NTC temperature value
  • PWM 1ch: MOSFET output
  • GPIO 2ch: Switch, LED

@jim-p
This is the answer I want.

@b707

  • You are right.
  • In general, I would like to be recommended something cheap.

@2112
It is very simple, like the ‘specs and functions’ above.

  1. Check button
  2. Temperature measurement
  3. MOSFET control
    I don't think memory needs to be considered. Source code and variables are small.

@kmin

  • I planning 'Atmega8' or 'ATTINY402'.

@horace
Because the function is simple, the comparison criteria are simply as follows.

  1. It has to be cheap.
  2. The firmware must be installed through ‘Arduino IDE’.

you didn't answer the question, for one pc or 1000+ pcs?

For example Stm32c0 could be only $0.3, but not in amazon...

2 Likes

Are you looking for a CPU chip or an assembly such as the Arduinos? There is a big difference. I know of no cheep CPUs but I know of inexpensive ones. I have seen CPUs in the sub $0.20 price range but they were purchased in the millions. That same part was about a buck in small volume.

The general design process is to determine the needs then shop for the parts. It appears you are trying to do it backwards, that takes a lot more time and will cost more.

2 Likes

ATmega8 has nice compatibility with Arduino (was the original Arduino chip, in fact.)
How much are you paying for them? They tend to run about $1 each from Aliexpress, especially for the SMT versions. Digikey wants $3 each (for DIP), making them more expensive than the default ATmega328P or (new and improved, but a bit riskier WRT Arduino support) AVR16DD28.

There are assorted "very cheap" CPUs once you give up Arduino. Down to about $0.03... (well under $0.50 for RISC-V, ARM, or 8051)

2 Likes

Stm32C0 (ARM) is supported in Stm32 arduino core. Personally not tried yet...

1 Like

Everyone, thank you for your answers.
@kmin

  1. That's right.
  2. We will produce more than 1000pcs.

@gilshultz

  1. I want to code with ‘Arduino IDE’.
  2. MCU: ATTINY402 / Seems cheap.

@westfw

  1. ‘ATmega8’ seems good.
  2. However, when comparing prices, 'ATTINY402' seems to be cheaper.

@kmin

  1. 'Stm32C0' seems to be more expensive than 'ATTINY402'.

Price of a chip depends on among other things

  • how many they make and sell
  • how many pins and what package
  • the core
  • memory space
  • features

By the time you develop a product, there may be a better fit so what about that development investment?

With AVR families like ATmega8 to 328 there is some sense to develop with the biggest and see which is smallest that can hold and run the final code. Within a family, all are pin compatible so you can develop a prototype board along with the code and the smaller, slightly cheaper chip will work.

However --- there may be a board that will do, already made in the millions, tested to death that you may never beat the price.
USBASP is one such example. Develop for that saves big in many ways especially if what you want to do is small and won't take long to finish.

1 Like

@GoForSmoke

Thanks for the advice.

1 Like

I think they are costing around same $0.4, but STM32C011 is 32bit and has way more flash and ram.

1 Like

@kmin

  • You are right.

  • There may be some parts I didn't explain properly.

The coding is really simple.

  1. What if I press the button? SYSTEM ON
  2. If ON, turn on the LED.
  3. Temperature measurement
  4. If it is greater than the temperature, ‘MOSFET ON’, if it is less than the temperature, it is ‘MOSFET OFF’.
  5. What if I press the button? SYSTEM OFF
  • So, I want something cheap to consider.

If there is only one temperature threshold, you don't even need microcontroller to build that.

1 Like

Sorry I missed that question.

The I/O pins are multiplexed with different signals or functions.
PWM is output on the WOn pins (Waveform Output -n).
You need to look at the table in section 5 of the datasheet to see which physical pins are used for WO.

1 Like

A digital pin can be turnrf ON and OFF to make "soft-PWM" when you have cycles to spare which there should be plenty of.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.