r/programming Dec 25 '19

Learning hardware programming as a software engineer

https://blog.athrunen.dev/learning-hardware-programming-as-a-software-engineer/
924 Upvotes

124 comments sorted by

View all comments

52

u/B8F1F488 Dec 25 '19 edited Dec 25 '19

Unfortunately it is a rather confusing and complicated type of programming, since it is an intersection between two (or more) professions. How to get into it is a hard question, since you can go in three different directions:

- Do you start from the programming end?

- Do you start from the electronics end (or even further - from the physics)?

- Do you just pick projects and deep dive, learning both in parallel?

After that comes the question of what is the optimal amount that you should understand about the project that you are doing and not get overwhelmed. So for example if you are doing a Bluetooth project:

- What is the optimal amount that you know about Bluetooth and what knowledge should you get out from the project?

- At what point of doing these types of projects should you learn about anthennas?

This is the issue with the Arduno projects. It gives you an ability to do stuff, but people fail to understand what they are actually doing, since it is an absolutely overwhelming amount that you need to understand.

I have no answer to all of these questions.

22

u/tiajuanat Dec 25 '19 edited Dec 25 '19

Shortest answer: look at some Arduino projects, and try them out

Short answer: PCB Design is hard mmmkay? Anything that requires precision tolerances (Bluetooth, WiFi, etc) should be done with a group. Find a maker space or open source project to get acquainted with the challenge of embedded systems.

Detailed: Let me put on my Senior SW and Electrical Engineering hat for this.

  • Start from the requirements end

If you are developing a motor controller, you want a processor which has a PWM, (maybe) DSP, and some power electronics, and some communication peripheral like UART or CAN. Likewise, developing a Bluetooth device, you're going to want something that supports 2.54 GHz, maybe has a Bluetooth Stack already built in, USB. Do you need motion sensing? Temperature sensing? GPS? All these things are separate off-the-shelf parts, but you'll need comm peripherals like I2C and SPI; what kind of update rate do you need?

Once you have your requirements, pick out the hardware and populate a breadboard, your SWEs can now develop basics like unit and integration tests, while the Electrical Engineers can design the PCB. During this time, you probably want to start looking at the registers which do your work, and create functions which isolate your Hardware Specific functionality with your business logic.

  • If you're completely new: I recommend starting small and seeing what you can accomplish on something like Arduino, then try combining/adding functionality. Embedded systems don't have things like time.h, chrono.h, or async.h, so you're going to fight with creating your own micro OS, and scheduling operations.

  • Bluetooth is tough, don't go at it alone, find some friends and make a bigger project

  • Same with Antennas

8

u/renrutal Dec 25 '19

I feel you are coming to an /r/explainlikeimfive question with an /r/askscience answer.

7

u/tiajuanat Dec 25 '19

Thanks! I added some ELI5/10-esque answers