Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

Wow! So much fun. Microcontrollers.

PaulC

Coder
In my day job I do high enterprise Java Big Data stuff. I used to work in high through put, low latency C code for stock exchanges, we would have long calls with customers discussing and increase in latency of anything more than 5 microseconds. I obviously get bored of Java.

So for hobby, I work with microcontrollers and home automation.

With standard "PC" tools you could go for a Raspberry PI, but that's not the level of embedded I'm talking about. I'm talking about OS-less, raw code.

The next most accessible option is Arduino and it's eco system. It's a recommended start point as it has expanded into so many other architectures, such as the STM32, the ESP8266/32 et. al.

The beauty of these "little USB dev board MCUs" is how quick and easy they are to set up, write code for and debug.

Consider this... as someone learning C and PC architecture or assembler.

The STM32 Bluepill or Blackpill cost about a $5 a piece. However, with an ST-Link programmer connected and the STM32CubeIDE (Eclipse) IDE software, you can not only insert breakpoints on lines of code, but on individual lines of assembler and... at the same time view live registers and even edit registers.

So if you wanted to say learn ARM Assmbler or ARM optimised C, a $5 USB board could have you stepping instruction by instruction through you ASM or C code watching the registers change.

Working on devices with such small memory and high parallel peripheral processing capabilities is a lot of fun. It will force you to make efficient use of your memory.

The fact that ARM Cortex M cores have a direct hardware connection to the core CPU state make it so awesome for learning.

Take a look at this, or go via the Arduino Eco System if it's easier.
 
The "Hello World" of embedded MCUs is "Blinky". You flash the onboard LED at an interval to prove to yourself the board works.

I tried a few different approaches on the smallest board I had. STM32F030F4. 48Mhz 4kb RAM, 16kb flash.

Using the "high level" C "Toggle PIN" function, it produced a output of 400kHz.
Using the "high level" C "Set / Reset" functions it produces an output of 1Mhz.
Using Assembler direct register writes it produced and output of 6Mhz.
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom