Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools......

How do you get into embedded programming?
How do you get into embedded programming?
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Thread Tools Search this Thread
Old 22nd May 2019, 09:52 AM   #11
analog_sa is offline analog_sa  Europe
diyAudio Member
analog_sa's Avatar
Join Date: Aug 2002
Location: Cascais
How do you get into embedded programming?
Originally Posted by bogdan2011 View Post
For example, I once needed to generate some signals using a MCU, and for that I needed to manipulate some registers
And yet Arduino is great for such tasks. Compared to most other environments it takes the least effort to get a working solution. Of course it has limitations but it doesn't sound like you have already reached them.
  Reply With Quote
Old 16th June 2019, 09:33 PM   #12
johnsurnamerobinson is offline johnsurnamerobinson
diyAudio Member
Join Date: Nov 2018
I used to program single board computers manufactured by TDS in Forth and assembler.The primary difference is you are often programming in real time ie a conditional loop.I know a lot of products are programmed in C BUT C on a single board computer or chip is Not the same deal as C on a pc.My best advice is learn by doing,It`s cheap these days and actually a lot of fun!!!
  Reply With Quote
Old Today, 01:32 PM   #13
johnego is online now johnego  Indonesia
diyAudio Member
Join Date: Dec 2017
Originally Posted by bogdan2011 View Post
I've done projects with Arduino, I can understand how code works but I felt that I haven't learned much. For example, I once needed to generate some signals using a MCU, and for that I needed to manipulate some registers and go really down and dirty with it. It felt so frustrating that I didn't know how all works.
I understand your frustration. Some of my friends experienced the same thing. Arduino can be 'mastered' in relatively very short time. But advanced robotics requires advanced programming. What students usually don't understand is that unlike 'mastering' Arduino, mastering programming takes a lifetime. If you start learning programming at the same time you start learning Arduino, yes, you will have difficulties. Sorry
  Reply With Quote
Old Today, 02:15 PM   #14
FauxFrench is offline FauxFrench  France
diyAudio Member
Join Date: Dec 2017
Location: The mountains, calm and quiet.
I did embedded programming many years ago. My main interest has always been hardware but I needed to design some test instruments. In those days it was the Philips 8051 micro-controller designs with many spin-off versions. I started with a very simple 8051 teaching kit just to get a feel of it. Soon, I did assembler programming to control measuring instruments. Assembler programming leaves you the best control of what is going on in the hardware and if you are skilled, the most efficient code. It was fun. I temporarily used a Pascal compiler but was hampered by flaws in that compiler and irritated over the loss of absolute control.

Today the micro-controllers and CPUs are much more sophisticated. Working in assembler is only for the most simple versions.
My experience is you first need to decide what kind of constructions you will design. If more complex, decide for your programming language. C++ is very versatile but you will be working with libraries made by others that may include flaws. C++ is about finding the libraries you need in the huge public pool and try to make them work. You never have full control.

Programming is much more deterministic than building analog hardware. There is right and wrong. Analog hardware design is very often working in the gray-zone with better or less good moves.

Enjoy, it can be great fun and you learn to think in structures.
  Reply With Quote
Old Today, 02:43 PM   #15
abraxalito is offline abraxalito  United Kingdom
diyAudio Member
abraxalito's Avatar
Join Date: Sep 2007
Location: Hangzhou - Marco Polo's 'most beautiful city'. 700yrs is a long time though...
As a few others have suggested, learning by doing is the most interesting and fun way. I'd suggest as you have STM32 boards already and don't want to go the C route, get Mecrisp-Stellaris Forth for the board you have. That's an interactive system so you can play around with it, there are also a few helpful books on learning Forth. As Mr Evil says - give yourself a problem to solve - the trick is in making it challenging enough but not too hard. Forth lets you build it and run it as you go - fun comes because its so interactive.
I know you think you understand what you thought I said but I'm not sure you realize that what you heard is not what I meant - Alan Greenspan
  Reply With Quote
Old Today, 03:48 PM   #16
Tubelab_com is offline Tubelab_com  United States
diyAudio Member
Tubelab_com's Avatar
Join Date: Jul 2005
Location: West Virginia panhandle
I built my first "computer" in 1975. It used a Motorola MC6800 running at 921 KHz, with a big 2 KB of static memory. Programming was assembler, or assembler. To do that you had to learn the CPU inside and out knowing what each register did and why......fortunately, at that time there weren't too many registers and all I/O was memory mapped ( a port was written just like a memory address). It took two of us several months of learning, trying, and starting over just to get a crude image of the Starship Enterprise on our DIY 8 bit memory mapped graphics card.

Today's chips range from simple 8 bit microcontrollers that can still be programmed in assembler, to full blown 32 bit ARM core chips that are very complex, often requiring several dozen register writes just to start them up.

The first step in any embedded system task is to figure out what you want to do, then figure out what chip best suits the task, then assemble the necessary hardware, and finally write, test and debug the code.

In most cases you can start writing some code, but you must have fully functional, verified hardware before you can get very far down the test-debug cycle. How do you verify the hardware without code?

I spent 20 years in cell phone or two way radio design teams where this was a tough question to answer, and usually required some simplified hardware and test specific code to be made. I was often the hardware "maker" guy.

Today there are hundreds of Single Board Computers (SBC's) available, as well as EValuation Boards (EVB's or EVM's) from the chip manufacturers.

The Arduino is the most popular SBC, and there are plenty of "Arduino Compatible" boards with chips from the usual chip vendors on them. Yes, you can program an Arduino to do a lot, without learning the details of what's going on.

The Arduino Integrated Development Environment (IDE) can be used to hide the details such that an inexperienced programmer can make something. It can also be used to write that "test code" needed to verify that the hardware for a particular project is functional. Much of that test code can be reused in the final project.

Underneath the hood of that IDE hides the Gnu GCC compiler which can also function as a full blown C / C++ compiler. There is nothing to stop a user from writing C code to tickle any single bit in a chip, if the details of how to do this is known.

How does one learn all of these details? That is a large daunting task on today's 32 bit ARM chips. The college level text book I got for the chip on the Teensy 3.2 Arduino compatible that I used on my music synthesizer project is over an inch thick. Much of it is beyond my skill level and I have a Computer Engineering degree from 1993. Things have grown far more complex since then. I can dig through that book, and the 600 page document from NXP on the specific chip used on the Teensy to find what I need, then test it in my code.

The point here, is that by using the Teensy Arduino compatible, I know that my hardware works. I have built some simple test programs using routines on the Teensy website, and from elsewhere on the web to get the hardware functioning well enough to make sound. Then I set out to modify, rewrite or create new code to make it do what I want.

Do I completely understand everything that's going on when it runs? No, do I need to? No. I guarantee you that there is nobody on the planet that can explain exactly everything that is going on inside a modern LTE cell phone.

Similarly it is nearly impossible to understand all the details under the hood of a modern 32 bit processor, you just need to get a handle on those that matter to your particular task.

If you want to understand the basics (recommended) start with a simple 8 bit Arduino (far less to learn). Get a book that explains the inner details of the particular chip it uses. Download the data sheet for that chip. Connect up some simple hardware, maybe a couple pots, some LED's and maybe a speaker on one of the PWM pins. Download the IDE, and get "Blink" to work, then make it blink two LEDs, adjust the blink speed by the pots.

Then try to write your own "blink" in "C" by directly manipulating the registers. Try to read the internal A/D converters directly (let the Arduino code set them up). These simple tasks can be frustrating to learn, but fortunately the Arduino is so popular that information can be found.....some of it may not be completely accurate though.

I don't know if it is possible to write assembler code for an Arduino and run it through the Ardino IDE since every chip has it's own register set, and they are all different. I have not tried to use assembler in quite some time, and it's really only needed in some (usually timing) specific tasks.

The "C" language can be pretty complex as I learned it in the early 90's. A lot of the complex stuff can be ignored, and that's exactly what the basic Arduino sketch does. You can get started this way, then add in the complex parts of C as you learn them.
Tubelab, it's 5 year mission. To explore strange new tubes, to seek out new circuits and topologies, to boldly go where no tube has gone before......
  Reply With Quote
Old Today, 08:05 PM   #17
bogdan2011 is offline bogdan2011
diyAudio Member
Join Date: Apr 2015
Thank you everyone for the advice. I started playing around with stm32 and got some stuff running. It's certainly much easier today than it was a few years ago when I tried it out, the (free, open source) development tools have matured and there's more APIs and libraries, not to mention microcontroller boards.
Indeed, everytime I was successful in programming an mcu I had a specific task that I needed to accomplish. Now I just need to find something to build.
  Reply With Quote
Old Today, 09:50 PM   #18
randytsuch is offline randytsuch
diyAudio Member
Join Date: Jan 2003
Location: LA
Originally Posted by Tubelab_com View Post
I built my first "computer" in 1975. It used a Motorola MC6800 running at 921 KHz, with a big 2 KB of static memory. Programming was assembler, or assembler.
One of my first projects out of college was with a system running on a 6800. Then we migrated it to a 6809 and that processor was sooo much better. I also learned to write assembly language programs, that's what HW types liked to program with, didn't have to bother learning C

Glad I'm not the only dinosaur around here.

Back on topic, I've done a few projects lately with ESP's, ESP8266 based boards. Basically an Arduino with built in wifi. The ESP-01 is cheap, but kind of worthless because it doesn't have enough IO available. But the slightly more expensive ESP's like a D1 mini are pretty cool. Amazing what you can get for less than $10.
I have a few around the house for IOT appliances.

My system is here
  Reply With Quote


How do you get into embedded programming?Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedded images jkuetemann Forum Problems 2 15th July 2016 03:39 PM
How to program on a embedded DSP BastienF miniDSP 2 24th February 2012 05:06 PM
How to power on/off an embedded pc?? cuibono PC Based 22 15th August 2010 03:53 AM
Gainclone Embedded rjm Chip Amps 28 26th July 2009 05:37 PM

New To Site? Need Help?

All times are GMT. The time now is 10:59 PM.

Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.00%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Copyright ©1999-2019 diyAudio