How To Write A Driver (Audio CODEC & I2C) - Phil's Lab

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ม.ค. 2025

ความคิดเห็น • 59

  • @dazai7669
    @dazai7669 5 หลายเดือนก่อน +22

    Wake up babe, new Phil's lab video.
    Perfect timing! I just bought a stm32f4 discovery board to start my audio dsp journey. Thank you for uploading these videos!

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน

      Awesome, hope all goes well with your new board!

  • @guitarbass95
    @guitarbass95 5 หลายเดือนก่อน +2

    I was literally just hitting a crossroads where existing libraries weren't useful and I find you uploaded this at a perfect time

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน

      Awesome, hope this helps!

  • @AntonioBarba_TheKaneB
    @AntonioBarba_TheKaneB 5 หลายเดือนก่อน +12

    you don’t need to convert all those binary values to hex manually, just enter them directly as 0b10101010 and let the compiler do the conversion.

  • @leifefrancisco7316
    @leifefrancisco7316 5 หลายเดือนก่อน

    Just as I'm building the same thing using the 4272 you come to save the day!

  • @kiprof4350
    @kiprof4350 5 หลายเดือนก่อน +1

    Thank you so much for this video, Phil! It is an amazing video! and I am eagerly awaiting your next outstanding Zynq videos. 🙂

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +1

      Many thanks - planning on making more Zynq videos as well!

  • @perceptron9834
    @perceptron9834 5 หลายเดือนก่อน +3

    Just finished the bme280 i2c driver for the ble-pill 😊. Fits good to the topic

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +1

      Awesome! :)

    • @tonyfremont
      @tonyfremont 5 หลายเดือนก่อน

      GitHub link?

  • @eleclab4244
    @eleclab4244 5 หลายเดือนก่อน +2

    Amazing video, as always!
    I wonder if you can make a video about class-d amplifiers, some basic PCB layout guidelines related to the topic, as there is almost nothing on TH-cam for years explaining "scientifically" how to do it the right way! A good example would be an IRS-based amplifier.. cheap .. and simple!
    Thank you for your content!

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +3

      Thank you! I have a basic Class-D amplifier design on the channel, but nothing terribly in-depth. Something I'd definitely like to make some more content on though!

  • @phill__6239
    @phill__6239 5 หลายเดือนก่อน +8

    top 5 technical design EE channels on youtube

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +1

      Thank you very much!

    • @karama300video
      @karama300video 5 หลายเดือนก่อน +2

      Hey, can you tell me the other 4?

    • @bobby9568
      @bobby9568 5 หลายเดือนก่อน

      what are the other 4?

    • @hoangvanthanh2201
      @hoangvanthanh2201 5 หลายเดือนก่อน

      what are the other 4?

    • @zero7523
      @zero7523 5 หลายเดือนก่อน

      What are the other 4?

  • @AmmarH413
    @AmmarH413 5 หลายเดือนก่อน

    unbelievably great

  • @crosswick
    @crosswick 5 หลายเดือนก่อน

    You're amazing Phil. Thanks again

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน

      Thank you!

    • @crosswick
      @crosswick 5 หลายเดือนก่อน

      @@PhilsLab I think part of what makes this format so great is the speech pause editing. I wonder how far you've automated that :)

  • @TomLeg
    @TomLeg 3 หลายเดือนก่อน

    I wish you designed things using components which were not discontinued. There are still some at Mouser, and of course there will be some supplies out there.

  • @rafaelbertacchi
    @rafaelbertacchi 5 หลายเดือนก่อน

    It would be great if you make a video about the analog parts that come before and after the codec... What filters and buffers to use, impedances. Differences between instrument, mic, phone and line signals. How to deal with Balanced and unbalanced inputs and outputs... That kind of stuff 😉

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +1

      Definitely some topics to come in future videos!

  • @SergiuszRoszczyk
    @SergiuszRoszczyk 5 หลายเดือนก่อน +1

    I’m not sure about just plain write 0 to reserved bits. Back in the old times of AVR, before Arduino even existed I was always reading register and only altering bits I need. It takes a bit of extra effort but in (quite likely in a longer term product) the event of swapping CODEC for something pin compatible (ie due to lack of parts) it may save you a day if a manufacturer just added new features in those bits

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +1

      Agreed - and as was alluded to in the video, although in not terribly much detail. Additionally, the driver here in the video is meant to be incredibly basic (for simplicity and time constraints of the video). Thus, I linked to the 'extensive' CODEC driver in the Linux Git repo, for a more thorough implementation after having covered the essentials.

  • @awocrf
    @awocrf 5 หลายเดือนก่อน +1

    Hi! I have an unrelated question. I'm making a project where i need to supply a few different voltages to my circuit (Let's simplify that to 3,3V, 2,8V and 2,0V). My power source is 2S Li-Ion battery pack. I want to use a switching regulator because battery life is important in this but i'm concerned about noise since some of the circuitly would be analog. Would it make sense to combine a switching regulator that would step down the voltage from 6-8,4V to about 3,6V and then use a linear regulators to make all the different voltages from that?

    • @catalinm756
      @catalinm756 5 หลายเดือนก่อน

      Yes. Use switchers for digital and ldos for analog and noise sensitive circuits

    • @awocrf
      @awocrf 5 หลายเดือนก่อน

      @@catalinm756 I was talking about a different approach but this solution would be fine too.
      I meant something like this:
      Li-Ion -> switching reg. -> LDOs -> everything else
      where Li-Ion outputs 6-8,4V, switching reg. 3,6V and LDOs 3V3, 2V8 and 2V0. In this case a switching regulator doesn't power anything directly, only through linear regulators. I've seen this approach in some high power lab power supply to combine high efficency of switching regulators and low noise of linear regulators.
      In your approach what would be better: connecting everything to the same ground or having 2 grounds connected in a single point somewhere?

    • @tariqsingh3747
      @tariqsingh3747 5 หลายเดือนก่อน

      @@awocrf Use one ground. Make sure that you have good PSRR at the switching frequency, and you'll be all good unless you need some ultra-low-noise power.

  • @ameenibrahim7519
    @ameenibrahim7519 5 หลายเดือนก่อน

    Sir I have project it is for straightness measurements by psd laser sensor, can you please help me designing the PCB layout?? Also I have the major electronic parts needed like analog multiplayer and amplifier but I have an issues for making the power circuit, I am a mechanical engineer not electrical.

  • @Kmnri
    @Kmnri 5 หลายเดือนก่อน

    Nice video, will you make a tutorial similar but without using their HAL? I would love to get into H7 series but stm32 hal is big nono

  • @Tonikiller10000
    @Tonikiller10000 5 หลายเดือนก่อน

    I like all your videos!!! You make some real stuff content.
    I have 3 questions:
    - for the SPI drivers, where the IC has I2C and SPI comunication (EX: BMA400 accelerometer) the register addresses are the same ast the I2C ones? Otherwise, can you make a video where you connect a device with SPI to the STM32 and make a driver for it?
    - can you make a video about the SPI or I2C HAL drivers? I am curious to make my own HAL comunication drivers thinking that is like in the arduino ide where is much faster to write dirrectly on a register than to use digitalWrite, where it checks various things, like if the port is on OUTPUT mode and so on.
    - can you make a video about stm32 flash memory? ...basic writing, reading and constrains. I am writing some lora code on the STM32 and one nonce variable is stored in the flash, but is reseted somehow at reset with the same random value. I think somehow it is stored inside the first FLASH addresses with the code, and the code somehow is written on that address. Anyway, I saved the variable again at the end of the flash memory, and seeing it on the ide memory browser, it is saved correctly. This variable is has to be incremented at each join request, and if I restart the STM32 it starts back to 0 and it can`t connect again with the values already used.

  • @casualnoises2808
    @casualnoises2808 2 หลายเดือนก่อน

    The CS4270 seems to be deprecated and can be replaced with the newer CS4272.

  • @cjb89
    @cjb89 5 หลายเดือนก่อน +1

    Great video, as always! But when you define the CS4270_REG_CONFIG_SETTINGS, why do you write them in hex? Can't you just write 0b00110001 for the mode, for example?

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +1

      Thanks! Yep, you can do that - just an (odd) habit of mine.

    • @cjb89
      @cjb89 5 หลายเดือนก่อน +1

      @@PhilsLab I just did a bit of research and it seems that the 0b... is technically not in the C standard, but most compilers still support it since it's relatively common. So I guess converting to hex is not a bad habit and I've been living dangerously, haha 😎

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน

      Ah that's good to know, thank you!

  • @Tron56850
    @Tron56850 5 หลายเดือนก่อน

    Great video! Maybe an obvious question but what's the order in which you implement your driver, before or after designing your custom PCB ?

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +1

      Thank you! I reference the datasheet several times during part selection, schematic, and PCB design. Also in relation to the software implementation to see if there are any 'gotchas' (such as specific pin settings, modes, etc.). The actual driver implementation I only really start after I receive the boards.

  • @bobby9568
    @bobby9568 5 หลายเดือนก่อน

    Phil took the blue pill #Matrix

  • @felmtony1277
    @felmtony1277 4 หลายเดือนก่อน

    Nice

  • @RiwenX
    @RiwenX 5 หลายเดือนก่อน

    Hey Phil, as an embedded developer, what's your take on Rust?

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +2

      Never used or explored it (or seen a reason to), so can't really comment I'm afraid.

    • @projectsspecial9224
      @projectsspecial9224 4 หลายเดือนก่อน

      Over the years, I have done numerous embedded projects using only ANSI C, C++, Assembly, and Python. Never had the need to use Rust. I'm sure there are probably good use cases that it can benefit from. But for me, I never had to use Rust professionally or required to.

  • @tamaseduard5145
    @tamaseduard5145 5 หลายเดือนก่อน +1

    👍🙏❤️

  • @nonfortuneuser
    @nonfortuneuser 5 หลายเดือนก่อน

    ❤❤♥

  • @samuelemmettbray
    @samuelemmettbray 5 หลายเดือนก่อน +3

    Phil. We don't use C, anymore.

    • @PhilsLab
      @PhilsLab  5 หลายเดือนก่อน +5

      😅

    • @bobby9568
      @bobby9568 5 หลายเดือนก่อน +2

      xD

    • @rajimordecai1099
      @rajimordecai1099 5 หลายเดือนก่อน +4

      C still remains the bedrock for embedded programming

    • @abo1428
      @abo1428 5 หลายเดือนก่อน +2

      fukumean „we don‘t use C, anymore“?

    • @scottfoulk7480
      @scottfoulk7480 5 หลายเดือนก่อน +1

      C is it.