0
votes

I would like to learn how to write embedded code. Unfortunately, I am not very experienced programmer, and I haven't got a clue on how to start.

The project I'm working on is a PCB with a movement sensor and a microprocessor, and I want to control the settings of the sensor by programming the microprocessor.

What kind of hardware and software do I need? I have read that I need a JTAG/development board and a programming environtment. I would be glad for a reference to any book/website that would tell me (preferrably as basic as possible) on how to get started. So far I have found only sources that are not readable for me as a beginner.

The microcontroller (STM32F101RC, Core: ARM 32-bit Cortex™-M3 CPU) communicates with the sensor using SPI. The PCB contains both a USB and a JTAG connection (10 pins). Also, I'm using a Windows laptop to do the programming.

3
It really depends on exactly what processor you have, what interfaces there are on the board, and what development platform you are using - can you add more detail ?Paul R
Any interfaces on the board ? USB ? Ethernet ? JTAG ? Serial ?Paul R
had any thoughts of running some kind of operating system on your boards? This will greatly influence your choice of toolsmarko

3 Answers

1
votes

It depends on what particular configuration you have - probably it's an ARM or AVR board. In both cases, you can grab a GCC-based (GNU) toolchain and start writing your C/C++ code as you would normally do - you just won't be able to use features which require an OS (i. e. file operations, using standard I/O - you have ports and SFRs instead), etc.

1
votes

Toolchain:

  • Software: I recommend Yagarto for a smooth start.
  • Hardware: you will need an on-chip debugger. I do recommend J-Link ECU

You may/should:

  • Acquire at least quite some knowledge on embedded software/hardware (the book AVR Microcontroller and Embedded Systems: Using Assembly and C is great!)
  • Understand the basics of the ARM Cortex-M3 architecture (google it! There are many resources, books, etc. there)
  • Acquire some C experience
  • Consider usage of RTOS if your product actually needs one.
  • Take a look on CMSIS if you are going to use ARM Cortex-M3.
  • Check you chip manufacturer if they provides any software libraries, bootloaders,... for the chip.
  • Not doing a custom PCB at first, use a development board to prototype your project

Important note:

I don't know the criteria you chose the target processor on, but consider using an AVR 8-bit microcontroller if the project don't need the ARM M3 (32-bit) processing power. AVR is much easier and cheaper to start with especially for beginners. The rule here is to not use a microcontroller with capabilities that are too much higher than your product/project needs.

1
votes

To learn embedded systems programming , it is better to start with a simple 8 bit board and free ide. u may start with avr / 8051 family /pic family etc the main problem with embedded programming is setting up the startup configuration / initialization suitable to your board features. if u start with your own board it will be difficult to cross this stage on your own. If you start with a readily available kit , then the given examples will walk u through this process easily. once u cross this stage u will gain enough confidence to handle bigger things. I am not advocating any one processor family here. One more thing is to be a good embedded programmer, one has to be fairly familiar with hardware also. In bigger projects where multiple team members work on an embedded project , u could get roles involving pure c and logic w/o much h/w knowledge , but to be versatile u have to be familiar how the board is designed how it is supposed to work.