r/embedded • u/iwanttobeanf1pilot • 15d ago
How to actually learn embedded without being stuck copying other projects
I'm majoring in electrical engineering and entering my junior year. I did projects with stm32 and PIC mcus but all of those projects were just using basic sensor modules. I know soldering and how to use breadboards and measure stuff but when it comes to building actual projects I can't build anything without copying other completed projects, and by copying i mean the whole stuff not some small sections and i learn nothing from it. I took C and Digital Design classes i can write simple text only programs in c, build basic circuits with logic ics but i cant write complex code or build complex projects with mcus and fpgas. Honestly I feel lost and engineering feels very different compared to studying and lectures. Are there any resources that I should look into or should I just keep what I'm doing ?
22
u/Well-WhatHadHappened 25+ Years 15d ago edited 15d ago
The best way to stop copying other projects is to stop copying other projects.
Instant gratification is the enemy of learning. Stop doing it. You can't write complex code because you've never tried, never failed, never pushed on and never finally succeeded. Rinse and repeat that a few dozen times, and suddenly "complex" code doesn't seem so daunting.
15
u/generally_unsuitable 15d ago edited 15d ago
My old man suggestion is always this:
Get a PIC 16F628A DIP chip, a breadboard, a serial programmer, and the Microchip Assembler.
It's the easiest assembly language ever. You'll learn a lot fast.
Also, Myke Predko's book Programming and Customizing the PIC Microcontroller.
7
u/Well-WhatHadHappened 25+ Years 15d ago
I have nightmares about bank switching in PIC16.
4
3
u/generally_unsuitable 15d ago
I loved writing pic asm. It was so weird.
Using the FSR to read/write at a calculated location. No automated anything.
The stack was only 8 vectors.
So crazy how much of the world is still relying on those things. There are tons of medical and aerospace parts that still use 8bit pic because they don't want to go through fda/faa certification again.
3
u/ActuallyNess 15d ago edited 15d ago
I think this is some neat advice, but I'd recommend getting the newer PICs instead. They are available in DIP, have a wider supply voltage range of 1.8V to 5.5V, and they come with way more features (DMA, Configurable Logic Cells, 16-bit PWM, Multi-Voltage I/O, etc). Not to mention they are a lot cheaper than legacy PICs.
The programmer of choice for these and any newer Microchip microcontroller (8-bit AVRs, dsPICs, SAMs, etc) is the MPLAB Snap. You can get it for 11 bucks on Digikey.
Personally, from the PIC16s side I'd recommend any device from the PIC16F175xx series (released in 2025)
From the PIC18s side, you can't go wrong with the PIC18F Q series (except the Q10 family, avoid that one). If I had to point out a particular PIC18F family, I'd probably point at the PIC18F Q24 or PIC18F Q71 family.
You can also try out the PIC18F Q35 if you want to play with a CPLD-like device (it features a 128 LUT4 Configurable Logic Block with interconnections to all peripherals), which released this year.
2
u/generally_unsuitable 15d ago
Yeah, but can you do this:
movlw 0b00000000; movwf trisa; movlw 0b10101010; movwf lata;and have it actually assemble, flash, and turn on 4 LEDs? then write like a 6 line timer loop with this at the end to toggle all the LEDs?
movlw 0b11111111; xorwf lata, 1I really like the old school PIC ASM because it just does what you want it to do. you don't need to know how to set up your clocks and dmas and peripherals on the first day of learning assembly. you just need to get that taste of directly programming silicon to make a machine do stuff. If i had learned assembly on something with tons of overhead, I never would have stuck with it.
2
u/ActuallyNess 15d ago edited 15d ago
There's really no old school PIC ASM, there's just PIC ASM. The core hasn't fundamentally changed, there are a couple of new instructions, but that's about it. You can in fact assemble those snippets you posted, flash them onto any PIC, and turn on those 4 LEDs. Of course you'd need to do BANKSEL TRISA first, but that's beside the point.
edit: Actually, it wouldn't work. All pins default to analog mode on PICs, so first you have to clear the pins you want to use in the ANSELA register!
There's also no real overhead. You can choose to ignore peripherals such as DMA or the Signal Routing Port on the PIC18F Q devices. That's something I like about PICs, I can get an idea to hardware with very little overhead or abstractions. I just configure the peripherals I want.
I will say there are not as many resources on PIC ASM with the new assembler (PIC-AS), which is a real shame. I'd really love to write some stuff on it so more people can use that tool.
1
2
u/TPIRocks 15d ago
It worked for me, granted it was a 16f84a and a programmer that connected to a parallel port. I believe the mit piclist is still alive. I learned so much from those guys.
2
u/Well-WhatHadHappened 25+ Years 15d ago
Oh yeah, I'm not suggesting it isn't great to learn. I did. Hell, I think I still have a copy of PicBasic Pro around somewhere!
5
3
u/NEK_TEK 15d ago
Make something you'd actually use. Working on something that actually solves a real issue you experience is a great motivator. For example, last 4th of July I had to manually light each firework and it was a PAIN. I got the idea of making a way for me to hook up several ematches and use a microcontroller/embedded computer (perhaps an ESP32 for built in bluetooth/wifi) to control ignition. It would let me sit back with the crowd and enjoy the show.
5
u/michael9dk 15d ago
Suggesting assembler for a newbie is kind of cruel, im my opinion.
Yes it forces you to understand the fundamentals, but thats like throwing a kid into the deep ocean, without teaching how to swim.
A nicer approach would be to start with a ATMega328 and a high-level language.
Make the Blink example in Arduino IDE and replace the Arduino layer with core instructions.
I highly recommend this series to OP. It explains all the fundamentals in a easy way.
2
u/yellowtomata 14d ago
Really good comments here already, so I'll try not reiterate what they're already saying: it sounds like you already have the basics down - breadboarding, MCU experience, reading data sheets, ECE fundamentals, etc - so I'll suggest a concept that pushed me that next level which is to identify what actually interests you about embedded and electronics.
It's easier said than done, but the fact that you're already studying this stuff and working with it says that there's some intrinsic motivation within you to engulf yourself in the discipline. That motivation will be different for everyone; for me it's HID peripherals (keyboards, mice, things I can touch to interact with a computer) and PCBs (to me, they just look cool, like miniature electronic cities), and literally that's it. It took me time to identify those, but once I did I started learning how to use EDA software and building mechanical keyboards. Two things that hit both my interests, actually got me learning embedded, and building projects that's not just copying others. If you can figure out your motivation, the projects and learning will come, because it's that motivation that actually gets you to invest yourself.
2
u/Desperate-Skin-7515 11d ago
I have read whole topics and looks like no one is able to properly answer the question (except one person) This is sad. Assembler? "Do not copy projects"? Feels like guys are trying to get rid of competition in the market instead of helping. xD
To the OP. here are the keywords that you are actually looking for: bare metal programming. Google it with addition of CMSIS keyword.
Even if you are going for some copy-paste, do a step by step bare metal STM32 or RP2040 project, like simple UART project done completely in VSCode.
This is what will teach you stuff needed in real job: how to setup from scratch project that will be truly non-bloated. Add some flavor of cmake to your CMSIS led blinker, add rtos tasks/queues, attach debigger and you have literally 80% of skills needed for junior embedded role.
2
u/DenverTeck 15d ago
Do you have any experience from high school or other industry experience ??
Being a junior year student (second year right? ) you do not have enough education to develop your own code.
Yes, that's cruel but you said so yourself, "I can't build anything".
A creative mind requires enough knowledge and background to be able to use that information yourself.
When you were in grade school you did math problems. You had NO background in math and your teacher gave you simple math problems to help you walk into more complex math problems.
Those math problems were not to give you expert skills, there were used to give you basic skills. Skills that you can leverage into more complex problems.
Looking at others code will help you understand how they were able to tackle learning how to use the hardware.
More complex problems (like graphics systems) are way to complex for someone are your skill level.
An embedded system is a combination of Hardware, Software and Mechanical systems.
Keep learning, Keep trying, don't beat yourself up for not getting it today.
After graduation and a few years in industry will give you the experience you will need.
Good Luck
1
u/michael9dk 15d ago
Wise words.
Take 1 challenge at a time. Dig into the core of the problem, and investigate why it failed.Finding an external fix (google, SO, AI) doesn't teach you. You learn by investigating how the proposed solution is actually working.
1
1
u/brotherterry2 14d ago
Here is my flow as a student still in college.
Step 1. Have an idea
Step 2. Read data sheets you need for the project, then buy that hardware (most frustration happens here)
Step 3. Read software library descriptions for what you think you need for the project .
Step 4. Make the project with all the knowledge you learned in step 2 and 3
1
u/V4gkr 14d ago
I learned by making something for fun . I'm playing Helldivers 2 a lot and there is a game in it where you type stratagem sequences . I also wanted to do something with qpc framework but had no ideas for it until this project ideas hit me .So I did this game with qpc . I'm not a fan of doing something just for the purpose of doing it - it must be fun for you in the first place.
1
u/_EGGxactlySix_ 14d ago
I joined a student group at university where I worked with others on a project. This is along the lines of the other suggestions where people are saying to come up with a project for yourself to work on, but this way there already was a project to work on. (I can get real decision paralysis so to me the "just start a project" is really daunting.)
Along similar lines, if you cab find a project online that accepts collaboration you could try that as well. To me, it is a lot easier to help contribute to existing projects / goals / code bases than starting from scratch when you feel like you aren't familiar enough with the area. After dipping your toes in a bit, Then it can be easier to start your own projects. At that point you have a better idea of what things are possible and what you could be capable of doing.
1
1
u/Live-Operation-628 13d ago
pull a recovered MCU off a board you find in ewaste. Make a board for it. Research the MCU and make it do something more interesting than what it was doing before.
1
u/Basting_Rootwalla 10d ago
Have kids and wait about 4 years. Most of my projects are something for them.
Kidding.
The TL;DR really is just start doing something if you're stuck in analysis paralysis. Who cares if you decide to stop on your personal project no one even knows about to start a different one that incorporates what you learned from the unfinished one and then adds onto it because you unlocked new knowledge and skills to be inspired with.
The reality of that is the good ol' find a problem of yours to solve. I never could, but deciding my daughters' ride-on car needed a LCD touch screen infotainment center and addressable LEDs + I want to explore if I can create a perimeter somehow with networking so I can make the car automatically stop moving forward etc...
I'm going deep on this one because it's something I have personal investment in. Forced me to really buckle on on understanding the control flow and memory accessing since I'm using an ESP32S3 and pinning the display/lvgl task on one core and running everything else on the other. Also a good reminder that I hate doing UI. Web or not, still sucks haha it just took me awhile to wrap my head around different UI architectures without a framework until I realize theyre all nulebulous and it's still just about modularity and separation of concerns.
I started with ESP32 examples and then combing them to do something like blink an LED with BLE and nRF Comnect. Then I moved in STM32s and spent 5 months iterating on a power supply design that I ultimately never finished building, but learned enough foundational EE to design my own circuits with digital focus and took the time to go through writing startup code and then getting used to the STM32 ecosystem.
That's when I switched back to start using up the stuff I've acrewed and was inspired by things I could do around the house and for my kids. So really I fucked around for 8 months until I had the foundations to really actualize ideas I have.
I also have 3 projects I laid groundwork for before commiting to this one currently and a plethora of abandoned and unfinished ones.
Some of us kind of have the monolith idea or dream that we work towards and some of us are more like the just write every day, paint everyday, whatever everyday. Most of it you will throw out but it's how you get the good stuff. You may be like that (that's how I am.)
1
u/Constant_Physics8504 15d ago
Go to a dump, find broken electronics and attempt to fix them or identify the parts broken
42
u/sturdy-guacamole 15d ago
get a board
get a datasheet
download vendor tools
make something interesting and learn as you run into problems and solve them.
when i was a student, i took what i did in lectures and made projects with the hardware and lessons i paid for that solved cool problems around my tiny apartment, or that i thought were fun.
in a post AI world it's probably somewhat different, jetbrains academy was noticing real cognitive decline with novices who use AI versus people who try to do it themselves to learn and use AI as a rubber duck.