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

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 56

  • @dazai7669
    @dazai7669 Месяц назад +16

    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  Месяц назад

      Awesome, hope all goes well with your new board!

  • @guitarbass95
    @guitarbass95 Месяц назад +1

    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  Месяц назад

      Awesome, hope this helps!

  • @AntonioBarba_TheKaneB
    @AntonioBarba_TheKaneB 29 дней назад +3

    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.

  • @kiprof4350
    @kiprof4350 Месяц назад +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  Месяц назад +1

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

  • @phill__6239
    @phill__6239 Месяц назад +7

    top 5 technical design EE channels on youtube

  • @eleclab4244
    @eleclab4244 Месяц назад +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 RUclips 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  Месяц назад +2

      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!

  • @leifefrancisco7316
    @leifefrancisco7316 Месяц назад

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

  • @perceptron9834
    @perceptron9834 Месяц назад +2

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

  • @AmmarH413
    @AmmarH413 Месяц назад

    unbelievably great

  • @SergiuszRoszczyk
    @SergiuszRoszczyk Месяц назад +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  Месяц назад +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.

  • @crosswick
    @crosswick Месяц назад

    You're amazing Phil. Thanks again

    • @PhilsLab
      @PhilsLab  Месяц назад

      Thank you!

    • @crosswick
      @crosswick Месяц назад

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

  • @Kmnri
    @Kmnri 24 дня назад

    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 Месяц назад

    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.

  • @rafaelbertacchi
    @rafaelbertacchi Месяц назад

    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  Месяц назад +1

      Definitely some topics to come in future videos!

  • @awocrf
    @awocrf Месяц назад +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 Месяц назад

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

    • @awocrf
      @awocrf Месяц назад

      @@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 Месяц назад

      @@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.

  • @Tron56850
    @Tron56850 Месяц назад

    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  Месяц назад +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 Месяц назад

    Phil took the blue pill #Matrix

  • @ameenibrahim7519
    @ameenibrahim7519 Месяц назад

    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.

  • @cjb89
    @cjb89 Месяц назад

    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  Месяц назад +1

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

    • @cjb89
      @cjb89 Месяц назад +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  Месяц назад

      Ah that's good to know, thank you!

  • @RiwenX
    @RiwenX Месяц назад

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

    • @PhilsLab
      @PhilsLab  Месяц назад +2

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

    • @projectsspecial9224
      @projectsspecial9224 5 дней назад

      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 Месяц назад +1

    👍🙏❤️

  • @nonfortuneuser
    @nonfortuneuser Месяц назад

    ❤❤♥

  • @samuelemmettbray
    @samuelemmettbray Месяц назад +3

    Phil. We don't use C, anymore.