Need simple uC for DAC startup configuration.  - Page 1
Forum section: electronics / general

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 20, 2025, 02:26:57 am
content: I am a beginner in this domain though I worked more than a year programming in assembly language 4 decades ago.I want to provide for free DIY users ES9018K2M which needs a controler to format it. I thought the STM32 with USB stick that can load the program.See the picture bellow.The DAC needs I2C type input.Do I plunge in learning using this uC?

author: ledtester
author_rank: Super Contributor
timestamp: September 20, 2025, 03:53:53 am
content: For simple applications the Arduino environment might be enough:Program STM32 Blue Pill (STM32F103C8T6) with Arduino IDEhttps://youtu.be/G57F7GOM7n8The Arduino environment presents a simplified view of the underlying hardware so its easier to become familiar with. Here's an example of some Arduino code interacting with an LCD display over I2C:https://wokwi.com/projects/365421666018061313The I2C interaction is in the LiquidCrystal_I2C.cpp file.You can find more info on using STM32s in the Arduino environment on stm32duino.com.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 20, 2025, 04:14:03 am
content: Avoid that one. It's the infamous and notorious "Blue Pill", and a bunch of years ago many copies started to appear and with a lot of different uC's on them. You're kind of lucky that this one specifies the CK variant, but I would not trust you would get that when it finally arrives. And the clones are "different". Some of them have extra functions, others are missing some functions. And although they all "mostly work", figuring out what and where the incompatibilities are can be a huge time sucking nightmare.Also, the STM32 line of uC's is pretty complex. You need to configure PLL's for the clock at startup, and there is a huge thread here on how bad the "STM Cube" software is.For a simple uC that can work with I2C, almost anything would work. I would avoid all the 32 bit ARM uC's and use an 8-bitter. The 5V capable (not tolerant) uC's seem to have better ESD protection, but that may depend on the brand too. A good old choice is the ATMEGA328 (also used in the "original") arduino. There are also chinese clones of these chips, especially when you buy the cheapest chinese boards in "DIP" format (I think that's arduino nano, but I'm not sure).When I started with uC's some 30 year ago, I dabbled a bit with the pic16f84. That was the first one with FLASH and the start of the cheap uC's (Before that there were UV erasable development versions in expensive ceramic packages. Back then a small uC costed around EUR30. I found the asm for that thing quite horrible, an so I switched to the at90s2313 (now obsolete) as it was programmable in C (and C++) with GCC. From that I progressed to the ATMEGA8 and ATMEGA328. These processors are simple to set up. Combined with the compiler, you also get header files, and it took years before I knew there were things like startup code and linker scripts. It "just worked". And GCC works with Linux too. Not all of the small uC's have tools that work properly with Linux (Important for me, I don't know if it's relevant for you).

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 20, 2025, 04:47:50 am
content: Thank you very much for directing me to a suitable uCIs this one good? Via USB, can the program be uploaded?

author: magic
author_rank: Super Contributor
timestamp: September 20, 2025, 04:53:29 am
content: Usually such setup is done by the same thing which will be feeding samples into the DAC.

author: ledtester
author_rank: Super Contributor
timestamp: September 20, 2025, 05:09:40 am
content: Quote from: Kokoriantz on September 20, 2025, 04:47:50 amYes - the board contains a USB-serial adapter which is also how the firmware is loaded.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 20, 2025, 06:14:17 am
content: Thanks a lot, now I know where to start.Magic, indeed it is as simple as loading sample data, even simpler. On start up after short delay, it needs to load information in its registers 29 in total, I need only 5 or 6. It needs to send first in 1 byte the address and one byte the data. In total 12 bytes kept in memory than it goes sleep as I wil not use any real time adjustments.