Beginners Guide to SPI on the Raspberry Pi Pico (BMP280 Example)

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 69

  • @matthiassuess7293
    @matthiassuess7293 3 роки тому +19

    A very nice and clean introduction and a great overview of SPI in conjunction with the Pi Pico. I think it's great that you make the effort to show not only the code but also diagrams and tables. Absolutely great! Thank you very much.

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  3 роки тому +4

      Thank you very much for the feedback on this video, I appreciate it! I am glad you found it useful and educational!

  • @daCount0
    @daCount0 Рік тому

    What a perfect introduction in this protocol - thx

  • @scottduede8134
    @scottduede8134 3 роки тому

    This is extremely helpful. I'll be watching it sooo many more times.

  • @marvicdigital
    @marvicdigital 3 роки тому

    Excellent explanation, your videos are necessary and required to see to understand what we do with SPI devices. Thanks.

  • @javjsky
    @javjsky 3 роки тому +7

    Is there any advantage on using spi_write_blocking() and spi_read_blocking (line 72 and 73) separately over spi_write_read_blocking()?

  • @alexandermcalpine
    @alexandermcalpine Рік тому

    Great tutorial thanks!

  • @alfonsosamuel2273
    @alfonsosamuel2273 3 роки тому

    This is really good! Thanks.
    Just to make sure a beginner like me dont get 1 week stuck think why i didnt work.
    You need to solder the boards 🙂😅

  • @TooSlowTube
    @TooSlowTube 6 місяців тому +1

    Do you have recommendations for which breadboards are good ones, and where to buy them? I've bought quite a few that are semi junk, and can only grip thick wires, or that it's hard to push components into because the contacts don't line up with the holes well. The power rails are usually the worst part, especially for not gripping thinner jumper wires / bell wire.

  • @taotechnique
    @taotechnique 3 роки тому

    This absolutely incredible, I am so happy I have found your channel. Extremely helpful!

  • @iliyannaydenov4186
    @iliyannaydenov4186 3 роки тому +3

    WOW! Really good tutorial. Will you have tutorials on STM32 or ESP32? Maybe RTOS?

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  3 роки тому +3

      Yes I will! I plan to start a series on STM32 beginning with some basic PCB design videos then going into programming tutorials. I will also have RTOS videos to cover pretty much all the devices I use (Pico, STM32, ESP32 etc) from now on.

  • @endless_space_ememem
    @endless_space_ememem 2 місяці тому +1

    Is this the same as how to wire up the bme680 and the corresponding set up code in pico sdk?

  • @kumarbhatia6566
    @kumarbhatia6566 3 роки тому

    Very well documented! Thank you.

  • @nicoladellino8124
    @nicoladellino8124 2 роки тому

    Very nice video, TNX.

  • @robotboy3525
    @robotboy3525 Рік тому

    Hi,
    I want understand what you did at 10:25
    Why did you write 0x27 to 0xF4 ?? what's the purpose behind it ??
    I'm new to SPI

  • @mytechnotalent
    @mytechnotalent 3 роки тому +1

    Love your C Pico tutorials. Quite RARE! Will you be doing one on a TFT ST7735 display?

  • @seanudal
    @seanudal 3 роки тому +2

    Thank you for the movie. It would be great if you made a movie explaining how to use a SPI display with a Pico using MicroPython. Especially the XC3728 OLED that is used by Arduino. I found another movie however they do not provide any code, just a demonstration. Thank you

  • @NokiAll2
    @NokiAll2 Рік тому

    can you post new video with bmp388 i2c using the raspberry pi pico board (and c++ sdk like you did here)? thank you

  • @mdchaparror10
    @mdchaparror10 3 роки тому

    Nice video, thanks

  • @JorgeSilva-em8pf
    @JorgeSilva-em8pf Місяць тому

    Dear Sir. In your video the CS pin is made by simple GPIO. This is clear and usefull, but, in case of only one SPI periferal, I guess that would be good to have the CS pin control by the same SPI function. Therefore, I have a question: Do the Pico library have one SPI R/W function which automatically manage the CS pin? Congratulation for your channel.

  • @larrybud
    @larrybud Рік тому

    Why are there specific labels for CS if the CS can be wired to any GPIO pin? Also, what's the advantage of having separate busses, simply speed?

  • @samueldavies646
    @samueldavies646 5 місяців тому

    because you do not init the function of cs pin as spi, it can work fine as any gpio?

  • @samihawasli7408
    @samihawasli7408 3 роки тому

    Did you have to download any extra drivers to get SPI working or was everything already included in the operating install?

  • @christiaang
    @christiaang 3 роки тому

    Nice video, thanks for this tutorial. Are you planning to make video's for MicroPython on the Pico?

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  3 роки тому +3

      Yes I am! The videos are currently in planning but they take a little bit of time for me to produce, hopefully they will be out soon!

  • @dave_dennis
    @dave_dennis 3 роки тому +1

    The part about the MSB of the register is a bit confusing. Is there a max of 127 registers? Would seem so since your are forcing the MSB to a 1 or 0. Seems like the upper nibble of the register address would be an 0x8 and not a 0xF.

    • @GodmanchesterGoblin
      @GodmanchesterGoblin 3 роки тому

      To force the MSB to a 1 and leaving the remainder unaltered, you would OR the byte value with 0x80. To force to a zero, you would AND the byte value with 0x7F.

  • @Jm-my1rd
    @Jm-my1rd 3 роки тому

    I want to learn how to program my BLE module. I just purchased a BL651 from Laird connectivity. Sorry I'm a beginner self learning. I would love to have some guidance on how to interface the BL651 and send and receive the data using SPI protocol.

    • @robotboy3525
      @robotboy3525 3 роки тому

      J Meng, the BL651 is way too advance.
      first you'll need to read the datasheet, make sense of it and write your own peripheral driver like the .h and the .c file which are the most complicated parts
      and then you can start with your main.c file to interface with it.
      try starting with something simple. there are many arduino and python bluetooth projects on online

  • @Atonix99
    @Atonix99 2 роки тому

    I need help with a project I am developing for my college degree...
    I am trying to connect 2 sensors (they need 5V and 170mA each) to my Raspberry Pi via SPI. They are both energised, and connected to the same miso, mosi and clock, as they should be.
    The problem comes with connecting the SS. I need two more wires for each radar: 1 for the SlaveSelect and another one for PinTurnOn. Is it mandatory that I use GPIO 24 and GPIO26 as SlaveSelect? Or I can use any I want?
    The thing is I am using any GPIO (free of course) I want at this moment and the radars work ONLY when the other radar is DISconnected. If I connect both, the screen just doesnt show anything, but as soon as I unplug one of them, the other one starts working... Any idea? I can give more dets if you were willing to help, thank you very much

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  2 роки тому

      You can use any free GPIO pin for SS. Are you only selecting one device at a time via the SS pin?

  • @hirakjyotiburagohain351
    @hirakjyotiburagohain351 3 роки тому +3

    Can we communicate with 2 raspberry Pi pico with the pin of UART

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  3 роки тому +2

      Yes this is possible, I add this suggestion to a list of upcoming videos.

  • @andreassteffens2907
    @andreassteffens2907 3 роки тому

    Do you have any idea on how to write data in a microsd file connected via spi?

  • @hwj1822
    @hwj1822 3 роки тому +4

    Thanks a lot.
    But now please, explain it again in Circuit-Python too ... 😉✌️

    • @christiaang
      @christiaang 3 роки тому +1

      Or MicroPython please 👍

    • @Stabby666
      @Stabby666 3 роки тому

      People, PLEASE learn C/C++ for microcontroller programming. Python is incredibly slow compared to compiled code. Python is really only useful to learn the basics of programming. To actually make the most of the hardware, switch to a proper compiled language. It's like taking the training wheels off!

    • @hwj1822
      @hwj1822 3 роки тому

      @@Stabby666 Yes, but does it really matter? Speed? Only, if you really need it. These interpreter languages like Python have their justification, especially since speed is compensated more and more with fast processors and libraries that implement the critical parts. These are a big step forward with abstraction layers of all languages like step from real binary coding to mnemonics and later compilers and linkers. We're no longer living in times of basic.

    • @bakedbeings
      @bakedbeings 3 роки тому

      @@Stabby666 It's true it's also just a bit like going into a living nightmare of move semantics and a bowl of brace/bracket/paren pasta 🤣 c++ and python have their place! Often projects don't need a super tight loop, instead reacting to inputs on a human timescale. Why should you pay the heavy performance tax that writing performant C++ code incurs if you don't have a use for it and you don't have a boss breathing down your neck about the cost of 100s of thousands of units. Oh and one more thing: remember C coders are rolling their eyes at C++ programmers for using such "bloated" executables from an "overengineered" language, and behind those guys the assembler coders are sniffing at this C nonsense coming between them and the instruction set.

    • @Stabby666
      @Stabby666 3 роки тому

      @@bakedbeings if your boss is breathing down your neck leading you to using a language that’s literally hundreds to thousands of times slower then a compiled language, get another job - he’s going out of business. If you can implement a project using a cheap 1 MHz part in C instead of getting the same performance using a 200mhz part with 100 times the flash, because you’re dicking around with python, then you’re losing money on every unit shipped due to laziness. It’s like they say, when all you have is a hammer, everything looks like a nail. I use ASM, C, C++, JavaScript, and used to spend most of my time writing Java, Perl, PHP and yes even Python. I’m not a language snob, but a professional should have more than one language in their toolkit and know which is appropriate.
      And to the previous guy, Python IS the modern version of BASIC. Indeed that’s the reason it was chosen as the default on the Raspberry pi, according to the founder.

  • @Filipx87page
    @Filipx87page 2 роки тому

    I have a problem because CS goes to 1 before it finishes transferring the read_blocking and the data is then invalid. :(

  • @robotboy3525
    @robotboy3525 3 роки тому

    Hi, where did you purchased your breadboard ??

  • @hossammagdy6974
    @hossammagdy6974 3 роки тому

    whats the connections on the hardware ?

  • @nathanaelsmith3553
    @nathanaelsmith3553 3 роки тому

    Good job

  • @kamilkaya5367
    @kamilkaya5367 3 роки тому

    Hello Sir. Can You show how to use mcp3008 and mcp3208 using SPI?

  • @sansdomicileconnu
    @sansdomicileconnu 3 роки тому

    like yours tutos

  • @calmcalm9287
    @calmcalm9287 3 роки тому

    Pls help me
    I Using python in my laptop.
    And I want to send data from python to AVR.
    Could you tell me What type connecting wire is appropriate ?
    Thanks you

  • @shivendrakumar7324
    @shivendrakumar7324 3 роки тому +1

    Can we have a video on PWM?

  • @AlejandroGarcia-zx4cq
    @AlejandroGarcia-zx4cq 3 роки тому

    Hello bro I like your videos for raspberry pico
    Actually I try to make a library in .cpp and I cant do this ..
    You can explain how to make a library for this platform?
    Thanks for read my cm

  • @eledikohabib3369
    @eledikohabib3369 3 роки тому +1

    Is the pico spi interface bidirectional?

    • @randomname3894
      @randomname3894 3 роки тому

      I also asking myself. I need to connect an encoder to it. I know it should work with stm32´s via a resistor between mosi and miso, but no clues if the rp2040 is capable. Did you find the answer?

  • @lsk-nf7um
    @lsk-nf7um Рік тому +1

    master and slave terminology being ruled out! Is there a technical advantage to this or is it ideological?

  • @jj74qformerlyjailbreak3
    @jj74qformerlyjailbreak3 3 роки тому

    I’m really trying to understand this new world of microcontrollers “New to Me” GOD gives me everything I need when God intends.
    Your explanations are right on cue.
    Good Job 👍

  • @adamsilesia5753
    @adamsilesia5753 3 роки тому +2

    There is nothing wrong with using word slave.

  • @MrPDawes
    @MrPDawes 3 роки тому +6

    Slave device is subordinate to it's master so the terminology still works here. Why do we have to be politically correct for everything?

    • @tiagorainho5011
      @tiagorainho5011 3 роки тому +3

      Because people are weak

    • @Xiph1980
      @Xiph1980 3 роки тому +1

      Because it actually hurts people and it takes freaking zero effort to use other terminology. Don't be a douche.

    • @larrybud
      @larrybud Рік тому +1

      Exactly. Master/Slave has been around forever, at least as long as hard drives came into existence.