New hardware and PCB design course on mixed-signal embedded systems just released! ⏵Course content: www.phils-lab.net/courses ⏵Course sign-up: phils-lab-shop.fedevel.education
@Pure_engineering5 сағат бұрын
I found this channel when I was searching for pcb design in kicad tutorial, found the best, stayed for the digital control implementation and code design. Now software design. Everything you will ever need as a control systems engineering graduate. 10/10 channel. Thank you. Happy new year (2025)🎉.
@evanlane16903 жыл бұрын
Really great content. Thanks for this process breakdown... it's hard to find videos that are a bit more involved than "how to program Arduino Uno with blink LED" and still show the process for people new to the concept.
@TheStuartstardust3 жыл бұрын
Only thing missing is all the failures to get to the press compile and it works - or is it just me that never can program correct the first time 🤔🤓😬🤣 Anyway - agree great content and detail level! 💪👍🤓
@PhilsLab3 жыл бұрын
Thank you very much, Evan - glad you liked it!
@amandioreal22933 жыл бұрын
I agree with you. It's time to raise the level of knowledge. Not every thing must be done for dummys.
@Basicguy17982 жыл бұрын
I will be super duper honest! This is the best tutorial I have come across that literally is like a tour of how a low level fw engg works on a typical day, at least ideally(unless pulling out one's hair when trying to copy/paste/adapt a pre-written driver) when he/she has a new sensor to bring up. Fantastic explanation and the way you keep going back and forth to the datasheet helps a lot. I was confused about how to know the sensor-specific init sequence since other stuff like data read/write via SPI & I2C is common knowledge but sensor-specific sequences are sometimes a mystery. Thank you for a zillion times!!
@PhilsLab Жыл бұрын
Thank you very much, Debasish - very glad to hear that it was helpful!
@adaminsanoff3 жыл бұрын
About two years ago I bought the evaluation board of this sensor. Since then I had no time to play with it. Now the time has come. As always, Phil has made an exceptionally useful video.
@PhilsLab3 жыл бұрын
Thank you very much, Adam - hope you got to play with the evaluation board since!
@KarthikArumughamАй бұрын
Excellent getting-started guide for firmware! I just received my upgraded Little Brain ++ boards, featuring the new ICM42688P sensor for IMU and ICP20100 for Baro. This video was invaluable in helping me write my first firmware and successfully test the values-it worked perfectly. Thanks so much, Phil!
@Dakomos27 күн бұрын
Phenomenal video! Great explanation and walkthrough the whole process of navigating through the datasheet. I was very lost on how to approach writing my own driver but now it seems very easy. Very good job!
@Phil6593 жыл бұрын
Your voice makes me feel like I'm getting smarter
@PhilsLab3 жыл бұрын
Haha thank you :)
@Leezorc3 жыл бұрын
Again clear, concise straight to the point. I havent written in C in a long time. When I heard struct it strucked me a little.
@666aron3 жыл бұрын
Well this video certainly is handy right now, since I'm struggling with an INA219 interfacing. For some reason even after all these years of electronics I2C is the bane of my existence.
@PhilsLab3 жыл бұрын
Thank you, Aron - hope you figured out the INA219 driver!
@Jucmaluco3 ай бұрын
Hey Aron, did you manage to figure out how to set up and use the INA219 with STM32? Do you have a link to the driver / code used?
@user-wm9io9gd4i4 күн бұрын
one of the best videos i found as a beginner in this i really couldn't find anything with such detail out there thank you very much for producing such wonderful content
@chadkrause65743 жыл бұрын
This simplifies things so much! I appreciate a walkthrough. I always see data sheets and gets intimidated by them. Thanks!
@kenwallace64933 жыл бұрын
Phil, like Jakob Sorber, is a gold standard for organizing and writing C programs. I'm not a fan of HAL but he temps me to grit my teeth and try it.
@PhilsLab3 жыл бұрын
Thank you very much, Ken!
@micheleabolaffio75273 жыл бұрын
Incredible quality and detail of content! You are my go to reference for pcb design and STM32 programming! Keep up the good work!
@PhilsLab3 жыл бұрын
Thank you very much, Michele!
@moosthuizen423 жыл бұрын
Truly awesome stuff. Thanks for making videos that distill your experiences for the rest of us. Please keep doing what you are doing - I'm off to binge some more.
@PhilsLab3 жыл бұрын
Thank you, Michael! Many more videos to come :)
@bgitego3 жыл бұрын
The adxl series accelerometer has some of the best datasheets I've ever read.
@sayantanmaiti25133 жыл бұрын
Any datasheet from Analog Devices is a pleasure to read
@PhilsLab3 жыл бұрын
I agree. I love the Analog Devices stuff.
@omaralkassab90793 жыл бұрын
As always, liked before watching
@andrefigueiredo45112 ай бұрын
Fantastic video. I would love to watch more videos about writing drivers. Your explanation was great and very detailed.
@buscoparan17723 жыл бұрын
every new video of your channel doubles my knowledge, keep em coming!
@PhilsLab3 жыл бұрын
Very glad to hear that, thank you :)
@Avraforlaura3 жыл бұрын
I love your videos. Perfect format and method of delivering quality learning. Kudos from Denmark.
@PhilsLab3 жыл бұрын
Thank you very much!
@EmbeddedEnigma3 жыл бұрын
amazing video. Really help novice engineers like me to learn and always get amazed by how intelligent you are.
@PhilsLab3 жыл бұрын
Thank you very much!
@simeonshaffar33742 жыл бұрын
Great! I understood the first 30 seconds then had absolutely no clue what you were talking about after that
@rocketrocks8363 жыл бұрын
This is SO useful,thank you so much! i think it would be a very good idea to start a series about how to write drivers.
@PhilsLab3 жыл бұрын
Thank you!
@mawoodmain3 жыл бұрын
Great video, very professional job. Only comment I would give is that this structure is not particularly portable, when I write drivers like this I tend to declare my i2c read/write functions as private statics in the module or in a separate module of its own in larger projects and contain all the hal specific code in there. Specifically I would not use the st Hal's status enum as this is platform specific. If you do this you can trivially reuse the driver on multiple microcontrollers with only a few minutes of work.
@crosswick2 жыл бұрын
Interesting - could you please talk about what you mean by 'module' in this case? Is it a combination of .h and .c files?
@Seandotcom3 жыл бұрын
Really thorough and well-explained. Good shit, dude
@PhilsLab3 жыл бұрын
Thanks, Sean!
@lucvanhove96393 жыл бұрын
Super 5 star education. Thanks a lot because I had a problem with a driver that I change for stm32 but failed. Now I have more details to find the problem 😊👍👍👍👍👍👍
@PhilsLab3 жыл бұрын
Thank you very much, Luc!
@bona-fide3 жыл бұрын
Awesome and detailed. You can actually use the Microsoft calculator for bit conversion/manipulation. Just set it to programmer mode. Very useful and handy
@Kefford6663 жыл бұрын
Yeah it’s really useful! The macOS calculator has the same programmer mode too. Find myself using it a lot.
@bfournier18843 жыл бұрын
or even better, use GCC's 0b notation instead of 0x when the number corresponds to bits in registers
@johnproctor4643 жыл бұрын
Thank you for taking the time to do this. good job.
@PhilsLab3 жыл бұрын
Thanks for watching!
@soufiane_krem3 жыл бұрын
Great video , this really helped me understand how a driver works.
@PhilsLab3 жыл бұрын
Glad to hear that, thank you for watching :)
@musenzerob21813 жыл бұрын
great work bro.i have been waiting for this.you haven't updated us on progress the course.
@andriilogoshko88813 жыл бұрын
Indeed. I'm also waiting for the updates on it.
@10e9993 жыл бұрын
Great videos. I think it would be interesting to create a second video about writing a non-polling driver.
@t77321559803 жыл бұрын
Actually, this is a non-polling driver. What Phil is doing is a very short ISR (Interrupt Service Routine) (see time 34:34 lines 67-76 in the code) that set a flag. It is common practice that an ISR writes to a Semaphor and the thread/process is waiting on this Semaphore. Phil does not have OS therefore he is using flag instead of interrupt, some interrupt might be lost in this implementation.
@taiwantoklip2 жыл бұрын
Great lecture,Specially to me (none STEM educated back ground--pure software-background ed newbie ) I hope can have more examples of how to read the spec and implementation of interfaces and protocols Thanks million again.
@bubbasplants1896 ай бұрын
Thank you sir this is very helpful, I am going to try to write my own driver now using STM32F0 and an I2C sensor!
@bubbasplants1896 ай бұрын
Hello sir, massive success thanks to you. Couldn't be more grateful.
@seqvenzer19 күн бұрын
Phil, not sure if people dogpiled on this already but you can use the `0b` prefix to specify binary values instead of converting to hex/dec. I personally use it while writing STM32/embedded drivers because I find it's clearer in communicating to the user that the bit pattern is structured, and it's not just a numeric value. Ditto for bit shifting.
@bikerder Жыл бұрын
Excellent video. Great detail but concise and to the point.
@marcdraco21893 жыл бұрын
Damn Phil, just when I thought you can't get any smarter, you go and prove me wrong: again! LOVE IT!
@PhilsLab3 жыл бұрын
Haha thank you, Marc!
@patrickcpe3 жыл бұрын
Always really appreciate vids like this. You cover everything and go at a great pace👍🏻
@PhilsLab3 жыл бұрын
Thank you, Patrick!
@Mriks0072 жыл бұрын
Well done! I like all your videos and i think is the best channel on youtube in this topic. The way you explain it is very understandable and logical, thank you for the excellent work you share with us. 👍
@PhilsLab2 жыл бұрын
Thank you so much!
@Aiidn86653 жыл бұрын
Welldone, it's a good design. I would use LDO with good/high PSSR for low noise applications.
@wisnueepis3593 Жыл бұрын
more for embedded like this phil, such a great explanation!
@bixenbaer2 жыл бұрын
At 27:27 you say 2 8 byte registers. Should be 2 8 bit registers right? Beside that: thank you!! Truly awesome !
@karthick9303 жыл бұрын
Hi @Phill you way of PCB design using Kicad is nice. if possible please post video STM32 with RS485 communication , differential routing, length matching, impedance matching concept in Kicad. Thanks 👍
@RandomValueToBe3 жыл бұрын
Thanks for your video this one is one of the best videos. Good explained and showing your workflow is for me a big +.
@PhilsLab3 жыл бұрын
Thank you very much, Edgar!
@haldorasgirson94633 жыл бұрын
I used that same accelerometer in my last project. Fantastic specs, but it is not a cheap part.
@shabadigash2 жыл бұрын
Brilliant explanation. Very easy to follow through. Thanks a bunch
@slagmaker67803 жыл бұрын
Great explanation and showing working code.
@PhilsLab3 жыл бұрын
Thanks!
@ruben34 Жыл бұрын
24:00 I just use windows calculator for converting numbers between BIN HEX DEC, I find it quite useful.
@PhilsLab Жыл бұрын
Good point, thanks!
@frankbose5443 жыл бұрын
Love these stm32 vids super helpful as I'm moving on to more advance micros getting away from arduino
@bkcyigit3 жыл бұрын
thats wonderfull contet If I had searched all my life I wouldn't have found it i liked video and follow your channel it deserves it
@PhilsLab3 жыл бұрын
Thank you very much, Berkay :)
@Frisky05632 жыл бұрын
Nice video thank you for breaking down the process of your driver.
@PhilsLab2 жыл бұрын
Thanks, Donnie.
@amaechichristopheribeme1844 ай бұрын
Awesome tutorial 👍🏿 I’m having undeclared issue with SAMPLE_TIME_LOG_MS. Could you tell me what I configured wrongly.
@DerDermin8tor3 жыл бұрын
Great explanation and straight forward. We add also defines for the spec Version of development parts. Rather than getting questions, users might Spot changes themselve.
@piratsik76913 жыл бұрын
Very cool. I feel like I should be paying for this. Great job!
@rafaelvisintin59818 ай бұрын
Thank you so much, Phil!
@abhignay3 жыл бұрын
Thank You so much Phil! I was waiting for someone to make a video like this, definitely worth a sub :)
@PhilsLab3 жыл бұрын
Very glad to hear that - thank you for watching!
@kitKat-by6kk2 жыл бұрын
As per others, Great content. Since the content is already pretyped, its easy for me to copy or compare..
@hernameplz65063 жыл бұрын
This is super helpful! Pls make more vids like this. Thx
@PhilsLab3 жыл бұрын
Thank you, more videos like this to come!
@Benjamin-wr1el2 жыл бұрын
Amazing search so much to fins this video great job
@OthmanAlikhan2 жыл бұрын
Thanks for the video, a very lovely and thorough walkthrough =)
@tim_allen_jr Жыл бұрын
Exactly what I needed ✨️
@clifforddicarlo91782 жыл бұрын
What is the sense of having temperature if the acceleration read-outs are not temperature compensated?
@srinirupan2 жыл бұрын
Could you make a video about driver development with the consideration of timing signals like a MEMS mic.
@DiegoColl443 жыл бұрын
Thanks.!! I've been looking for this video for years. LOL!
@PhilsLab3 жыл бұрын
Glad to hear that, thanks Diego :)
@selimsagr4463 жыл бұрын
Great as always.
@PhilsLab3 жыл бұрын
Thank you, Selim!
@vovanikotin3 жыл бұрын
Very good explanation! Waiting for quaternions.
@PhilsLab3 жыл бұрын
Thank you!
@TheGhost13X3 жыл бұрын
Hi Phil, will you finish your control system videos in the near future? It would be awesome, thank you!
@seankayll90173 жыл бұрын
Great video, thanks. Forty odd quid for that sensor though, crikey. What is so special about it that makes it so expensive?
@t77321559803 жыл бұрын
This sensor has low noise and high accuracy (and you can trust ADI to meet the spec)
@PhilsLab3 жыл бұрын
Thanks, Sean! Low-noise, low-drift, etc. etc. make it pretty pricey.
@ShaunStruwig2 жыл бұрын
Out of interest, do you ever write testsuites for the software you write? Coming from a web development background I just wondered if this kind of approach is common in the embedded world?
@XenoTravis Жыл бұрын
It gets hard since you can't fire a bunch of test data at the software. But some companies will do the extra leg work to make an internal way to save and emulate real world values.
@NW_D13 жыл бұрын
Great video, very informative. Thank you.
@PhilsLab3 жыл бұрын
Thanks for watching, Karl!
@codingstyle948014 күн бұрын
Great video.
@scottfoulk74803 жыл бұрын
Thank you for this - it is pure gold!
@PhilsLab3 жыл бұрын
Thank you, Scott!
@anonymaton9487 ай бұрын
Why are the i2c mem functions being used over the i2c master functions?
@mata76482 жыл бұрын
Very useful video. Thanks. My temperature calculation is a bit different from yours. I got temp = (2111.25-tempRaw)/9.05.
@rockercas6 ай бұрын
Hi Phil/any other commenters, I was curious how often register level programming is used in industry?
@GeorgeBenettM1 Жыл бұрын
thank you so much! this video is so good i learned a lot
@stati5tik Жыл бұрын
Its a weird question but how exactly does "ReadRegisters" work? I mean, why do you need an usb port if you can you call read registers without utilizing usb?
@IgorJeri3 жыл бұрын
This was a fantastic video! Thank you
@PhilsLab3 жыл бұрын
Thank you for watching, Igor!
@ravimruthyunjaya80263 жыл бұрын
Great video. At time 36:47 I noticed that the "USB device not recognized" popped up from windows after you plugged in your custom board. Did the USB peripheral work? I have been struggling getting custom boards to work with the USB peripheral and I am getting that same pop up
@PhilsLab3 жыл бұрын
Thanks, Ravi! That's only because I had paused the execution of the code via a breakpoint. The USB peripheral works as it should.
@mozone1802 жыл бұрын
Amazing content🙏
@PhilsLab2 жыл бұрын
Thank you!
@fredhaeir30058 ай бұрын
inside the ADXL355_Initialise function: when reading the device ID, shouldn't you directly return from function if the status was not HAL_OK? You did not initialize regData, hence if a read is a fail, wouldn't you be comparing a non-initialized variable with the constants (ADXL355_DEVICE_ID and ADXL355_MEMS_ID) in the following lines of code? another question: What is the goal of having an error count? also TIL that initialize in British is initialise :)
@TheStuartstardust3 жыл бұрын
I would use a union to join the incoming 8bits data - or is that a bad idea? 🤔
@appidydafoo3 жыл бұрын
Fascinating, thank you
@PhilsLab3 жыл бұрын
Thank you!
@ajayjoseph44983 жыл бұрын
Brilliant Phil
@PhilsLab3 жыл бұрын
Thank you, Ajay!
@plextrumgames3 жыл бұрын
Hey, great video! I'm just curious if at 31:40 you could have avoided right shifting the entire expression by 12, if you had instead left shifted x3 by 12, then x2 by 4 and then right shifted x1 by 4 also. I see your methodology, but it makes more sense to be to shift the bits exactly where they need to be.
@ikbendusan2 жыл бұрын
your proposed method doesn't set the sign bit which means it doesn't work for negative numbers; bit shifting a negative number to the right shifts with 1s intead of 0s, preserving the negative number
@sosscs Жыл бұрын
is the software at 8:06 is what is called a "device driver" ? the software disk that for example comes with a printer and other devices? or this is another thing that's just called a driver? because I didn't hear say "device driver" but only a "driver". thanks
@qbitgaminglive9 ай бұрын
can someone explain from 30:00 to 30:55 where the data are shifted, i cant understand that part.
@kunalsalvi83823 жыл бұрын
Loved the video, Phil. I saw your board didn't get recognized. How do you solve that issue?
@PhilsLab3 жыл бұрын
Thank you! The board was not recognised only because I set a breakpoint/paused the execution of the code. The USB peripheral works fine otherwise.
@nerosy23413 жыл бұрын
Thanks a lot for the video, love your work, keep going! :D
@PhilsLab3 жыл бұрын
Thank you, Yaman :)
@ambientsoda1063 жыл бұрын
Hi I thought the data sheets are supposed to have an open transaction, then functions to call to access data, and then close the transaction - but in general I'm not seeing data sheets that allow drivers to be created for several devices in general . How does one know what language a driver for a device can be created in and how to used the data sheet function with the IDE being used? As I've wanted to write a library for depth sensing cameras for the Arduino...but as said before driver creation is an element many programmers have no idea how to do...Luckily I had a university lecturer who knew how to do things like this...
@nononnomonohjghdgdshrsrhsjgd2 жыл бұрын
How did you learn all these? What have you studied? Could you direct me to some courses?
@Kefford6663 жыл бұрын
Funnily enough I just finished writing an STM32 I2C driver for a sensor today. In the past I’ve only done PIC drivers. Why not SPI for an IMU if you don’t mind me asking?
@666aron3 жыл бұрын
I don't know the reason behind the SPI/I2C choice, but here's my reasoning. Usually I2C is fast enough for multiple chained IC readings, and you only need two supply and two communication wires (+ interrupt if that's your thing). SPI has 4 comm wires to start with and every chip has an additional chip select (and the interrupts).
@phillipmaser132 Жыл бұрын
Is it possible to convert Acceleration data to Velocity and be at this speed with this sensor? Can I use this velocity and time to find distance let's say 500 feet down the road? which would be position?
@Drxxx3 жыл бұрын
great channel!
@PhilsLab3 жыл бұрын
Thank you!
@Throwingness2 жыл бұрын
Do you have a video where you start smaller? I need to learn to crawl before I can deal with this.
@PhilsLab2 жыл бұрын
There are various STM32 (beginner) videos on my channel, if that's what you're after.
@datawolk3 жыл бұрын
I build my libraries for STM exactly the same. Except that I don't put the low level functions in my header file, as it is not relevant to the main.
@shashankshekhar65493 жыл бұрын
Please Put some info. on how to select a stm32 for specific use.
@KevinStoriesTV3 жыл бұрын
thank you for great tutorial
@PhilsLab3 жыл бұрын
Thanks!
@CannonballCircuit Жыл бұрын
Hey Phil! In your struct, is it unnecessary to have the I2C_HandleTypeDef typed pointer initialized to NULL or to a random block of memory using malloc()?
@frankbose5443 жыл бұрын
i thought the lsb of the slave address has to be 1 to read from the slave maybe ive missed someting but you have left shifted the address by 1 making the lsb a 0 to write or dose it have to do with the hal_memread
@frankbose5443 жыл бұрын
nm lol im a stm32 noob clearly the hal does this for you
@N0T1500 Жыл бұрын
Could you make a video about test driven firmware development?