Electronic Basics #36: SPI and how to use it

Sdílet
Vložit
  • čas přidán 11. 07. 2024
  • $2 for 10 PCBs (10cm*10cm): jlcpcb.com
    Previous video: • DIY Adjustable Constan...
    Electronic Basics #19: I2C and how to use it: • Electronic Basics #19:...
    Facebook: / greatscottlab
    Twitter: / greatscottlab
    Support me for more videos: www.patreon.com/GreatScott?ty=h
    Websites which were shown in the video:
    www.maximintegrated.com/en/pr...
    datasheets.maximintegrated.co...
    arduino.stackexchange.com/que...
    github.com/sparkfun/DeadOn_RT...
    learn.sparkfun.com/tutorials/...
    In this Electronic Basics episode I will present you the most important facts about the communication protocol SPI and how we can use it with an Arduino and an RTC IC.
    Thanks to JLCPCB for sponsoring this video
    Visit jlcpcb.com to get professional PCBs for low prices
    Music:
    2011 Lookalike by Bartlebeats
    Ecstatic Wave, Jens Kiilstofte
    machinimasound.com/music
  • Věda a technologie

Komentáře • 339

  • @northshorepx
    @northshorepx Před 5 lety +128

    Fantastic. It was very good to see just enough detail so that it wasn't overloading my brain. The timing wave diagrams made everything so clear especially the modes. Thank you.

  • @thomaslsr6847
    @thomaslsr6847 Před 5 lety +13

    That's incredible, everytime I discover a new thing needed for my project, you got a video about the subject :)

  • @davewreski6900
    @davewreski6900 Před 4 lety +3

    You have made the things I did not understand much clearer and I now do understand more than I ever have before. You are GREAT ! Thank you so much. I am looking forward to seeing more of your hard work. Also, I will be ordering some PCB's from your link.

  • @digitART30
    @digitART30 Před 5 lety +11

    Nicely done Scott, thank you again for your dedication and time spent to share your knowledges, best wishes from Spain 🇪🇸

  • @nagarajnagu
    @nagarajnagu Před 5 lety +7

    Really you are doing very good job. You are inspiring many minds to be creative. As always stay creative. Thank you Scott

  • @adrianrodrigoguitar9482

    Excellent video. You just came right in time, as I started playing with SPI devices recently. Thanks to you, all is much clearer now :)

  • @tpendletonYT
    @tpendletonYT Před 5 lety +1

    Thank you for another great video. I learn something new every time I watch one of your videos.

  • @rishabhlavhale3096
    @rishabhlavhale3096 Před 5 lety +2

    Thanks GreatScott! This video helps me a lot to understand how spi works. As always your videos are awesome...

  • @jyotigvzsftiwari221
    @jyotigvzsftiwari221 Před 5 lety +6

    scott loved your video.
    you made such a vast topic soo easy.

  • @UpcycleElectronics
    @UpcycleElectronics Před 5 lety +39

    Nice Demo of the programming side.
    A few notes though:
    1.) The AVR hardware SPI "SS" pin is used to turn the AVR into a slave device on a bus. Use any other available I/O pin for Selecting peripheral hardware on the SPI bus.
    2.) While I haven't played with the DS3234, I have been goofing around with the DS3231 as I have found them for a good bit cheaper. These RTC's are the best because they are temperature compensated. IIRC There is a small heating element inside the IC that keeps the temperature a few degrees above ambient. The cool part about this is that there is a temperature sensor built into the chip. This temperature sensor reading is available too! There are several different libraries available on the Arduino IDE Lib-Manager that make the temp reading available. I forget which one I used to get the temperature reading working, and I'm not in my main comp ATM, but it does work using one of them.
    3.) Temperature compensation makes these RTC's much better than the cheaper DS1302 (which was only designed for charging NiCd batteries with a cheap timer), or the DS1307. These other chips are extremely common with Ardy1 tutorials, but they are really bad at keeping time long term.
    4.) Anyone found a better deal on DS3231's or similar than $0.90 each (AliEx) for breakout boards in single/low quantities? I'm more interested in the chip itself instead of BO's but ATM it's cheaper for me to use a BO.
    -Jake
    PS On the off chance that Jeremy actually reads this. If you recall from your English classes, "Read" is one of the unusual words in English. Read in the present tense is pronounced like reed, but in the past tense is pronounced "red." It really doesn't matter. I couldn't care less if you change, but if I were on the other side of this, I would want to know ;)

    • @KnightsWithoutATable
      @KnightsWithoutATable Před 5 lety +1

      Great info about the chip and thanks for sharing it.

    • @electron-1979
      @electron-1979 Před 5 lety +1

      The 3231 has the calendar, alarm and square wave output, too.
      Commonly used on Raspberry Pis

    • @clonkex
      @clonkex Před 5 lety +1

      I was intending to let him know about the pronunciation of "read", glad I don't have to :)

    • @shinjithenegotiator2795
      @shinjithenegotiator2795 Před 3 lety

      thank you so much person

  • @minotodorov4144
    @minotodorov4144 Před 4 lety

    Super high quality explanation. Clear and concise. I loved the way you presented.

  • @theopbro8691
    @theopbro8691 Před 5 lety +4

    I love these types of videos

  • @terrymaker4781
    @terrymaker4781 Před 5 lety

    Great. Description on SPI! I have a number of projects that need SPI but I have been putting off. With this amount of detail I can finally try my hand at this useful protocol. Thanks for another great video! I always look forward to your next. ☑️😋

  • @lewisbarnard3606
    @lewisbarnard3606 Před 5 lety

    Love the detail you when into!! More videos like this please!!! Love your videos !!

  • @W1RMD
    @W1RMD Před rokem

    Great video! Thank you for sharing!

  • @jpoppinmoneyunit7098
    @jpoppinmoneyunit7098 Před 5 lety +1

    Gosh I love these videos but it's always the programming that holds me up. More videos on programming please!!

  • @ukesharyal
    @ukesharyal Před 5 lety

    Finally got it on sunday .
    Waited for your video every week .

  • @henryswan1374
    @henryswan1374 Před 5 lety

    scott, you're one of my heros, i learned so much from your videos.

  • @SARankdirectorMinecraft
    @SARankdirectorMinecraft Před 9 měsíci

    Wow, that was really comprehensive. I’ll definitely use this as a reference!

  • @teenflon
    @teenflon Před rokem

    Please never stop making videos

  • @StaticVapour590
    @StaticVapour590 Před 5 lety

    Fantastic video

  • @schweizzz
    @schweizzz Před 5 lety

    Thank you for the jlcpcb Site. This is just amazing

  • @adershralornekar6977
    @adershralornekar6977 Před 5 lety

    Thank you so much. you have simplified the details so much :)

  • @larsfagerbakke2140
    @larsfagerbakke2140 Před 5 lety

    Awesome video, thanks!

  • @Mat2095
    @Mat2095 Před 5 lety

    "the datasheet spoiled the surprise"
    I just love your humor!

  • @MaheshPawaskar
    @MaheshPawaskar Před 5 lety

    Nice and Informative session. Thanks

  • @bobharrison9620
    @bobharrison9620 Před 2 lety

    And I don't know though Arduino was difficult already.
    I should have studied more in High school 45 years ago.
    You are scary smart. Thanks Bob

  • @osuradanthanarayana7085

    this video is really helpful....

  • @isbestlizard
    @isbestlizard Před 4 lety

    it was an amazing video! thanks!

  • @AlbaxArcade
    @AlbaxArcade Před 5 lety

    Thank you for this video!

  • @eneyefamous278
    @eneyefamous278 Před 5 lety

    Always with the best.

  • @topten7064
    @topten7064 Před 4 lety +1

    You are really great, good voice and subject is clear

  • @JohirulIslam-lm2vz
    @JohirulIslam-lm2vz Před 5 lety

    Well explained! Thanks!!

  • @innovation4u336
    @innovation4u336 Před 5 lety

    Very nice video sir.

  • @TheMrfireandwater
    @TheMrfireandwater Před 5 lety

    Great great great explanations, thank you!

  • @Bianchi77
    @Bianchi77 Před 2 lety

    Nice info, thanks :)

  • @suriyasuri2018
    @suriyasuri2018 Před 5 lety

    Awesome....!!! SPI register explanation super....looking forward to see many videos on basics....👍👍

  • @EvilSandwich
    @EvilSandwich Před 2 lety +3

    GreatScott: *"Of course, you cannot use it for as many slave devices as the I square C protocol due to the limited number of chip select lines"*
    Me with more 74138 decoder chips than any sane human should have and no regard for compact design: *"I have no such weakness!"*

  • @Kostanj42
    @Kostanj42 Před 5 lety

    Great video!

  • @mftechtube77
    @mftechtube77 Před 5 lety

    Great Scott,u r always great!!.What an explanation sirji!!🙇😇

  • @electronic7979
    @electronic7979 Před 5 lety

    Useful video

  • @makerun6927
    @makerun6927 Před 4 lety

    good presentation

  • @TheSilvax
    @TheSilvax Před 4 lety

    good job man!

  • @gursharanmarwaha3376
    @gursharanmarwaha3376 Před 5 lety

    THANKS BRO JUST NEEDED THIS VIDEO!!!!! 👌👌👌👌👌👌👌

  • @CraftLP27
    @CraftLP27 Před 5 lety

    I'm starting to think GreatScott! can read my mind. I was just searching how to use a SPI Display for my RaspberryPI and he does a video about it. Although he doesn't talk about a SPI Display it helped me to connect the Display anyway. Thank you!

  • @karthikeyanjayagandhan7914

    Your videos are interesting

  • @gazvlogs7459
    @gazvlogs7459 Před 5 lety +5

    You have such a great way of explaining things to sound so damn interesting. Some electronics channels on youtube with just background music and sped up video of someone building something obscure and kind of pointless is like a night and day difference when a GS video comes along! May I suggest you look into more RC stuff? Like SBUS/IBUS protocols and how those protocols manage to have such low latency but most importantly how they talk to the flight controller and maybe prototype some sort of simple 5 channel tx/rx with arduino! OR Maybe I'm just overzealous :D

  • @cyberspider78910
    @cyberspider78910 Před 2 lety

    Basics !!! This is super hit. I am equipped with writing library for SPI devices...lol....

  • @jeremyvi
    @jeremyvi Před 5 lety

    Quality contents, should be mandatory to view before any other video ;)

  • @joejohns3543
    @joejohns3543 Před 5 lety

    Love your videos!
    Oh Also EasyEDA is totally awesome. I found it 6 months ago and love it. I switched from KiCad

  • @tamarathompson9418
    @tamarathompson9418 Před 5 lety

    Cheers great video I'm going back to watch i2c .

  • @johnjoyce
    @johnjoyce Před 5 lety

    Thank you for this one!!
    I think you could do a whole series of I2C and SPI examples like a cookbook.

  • @Loundre3
    @Loundre3 Před 5 lety

    Watching this makes me feel alot better knowing that people can learn more about serial protocols and have a easier time working with them (if the setup doesn't screw up, if working in ASM or C). Learnt myself a few new things, even if i used SPI before several times (never bothered looking up the concept of modes, since its faster for me to look up the datasheet and see the edge triggering and clock polarity setup of the ics). Keep en coming, GreatScott!
    Mind if you try handling RS-232 (basically UART with specific voltage levels acting as a COM port) and CAN bus (popular automobile bus system) basics in future videos?

  • @avejst
    @avejst Před 5 lety

    Thanks for sharing😀👍

  • @rohandabir1588
    @rohandabir1588 Před 5 lety +1

    Nice video

  • @MDFRESCUER
    @MDFRESCUER Před 5 lety

    Good video. 👏🙌👍👌

  • @FunScientifix
    @FunScientifix Před 5 lety

    Efforts in your videos are 10/10. Always worth the 7 day wait.
    Also a request. Can you do a DIY or BUY for a solar charge controller?

  • @nmxwll9433
    @nmxwll9433 Před 5 lety +4

    0:25 dry skin, you should use moisturizing cream...
    Other than that, great video, as always !
    You can also use SPI communication with 8bits shift registers like the 74HC595, that way you can extend the number of output pins if necessary

  • @ranasaad7456
    @ranasaad7456 Před 5 lety

    Love your tech tecniqe

  • @mechanic3318
    @mechanic3318 Před 5 lety +1

    I wait for your video.....every Sunday...

  • @KnightsWithoutATable
    @KnightsWithoutATable Před 5 lety

    Very well done on showing the way this com protocol works. I can see a uses for this for fine measurement reading or output logic then sent to an Arduino Nano or other small form factor Arduino that would use I2C to communicate with another Arduino platform.

  • @alphajuice
    @alphajuice Před 5 lety

    Great led cube intro, make it bass boost

  • @mandajisaikumar6870
    @mandajisaikumar6870 Před 5 lety

    I just loved this.
    Bro can you do a video on aurduino parallel communication

  • @JohnJCouture
    @JohnJCouture Před 5 lety

    Thank you for great video. Would it be possible to create a "playlist" for your "Electronic Basics" videos?

  • @kedarprabhudessai
    @kedarprabhudessai Před 5 lety

    One thing i have noticed is Great scott and Electronoobs uploads their videos one after the other on the same day

  • @MichaelLauerDr
    @MichaelLauerDr Před 8 měsíci

    Great tutorial, very understandable. Which Oscilloscope are you using?

  • @nnvskh8269
    @nnvskh8269 Před 3 lety

    U R the best

  • @ChrisMuncy
    @ChrisMuncy Před 5 lety

    Acott, thanks for another great video. Quick question: What's the model number of the Rigol scope you are using in that video?

  • @georgetroulis
    @georgetroulis Před 5 lety

    I love the way you explain things, I think it would be awesome if you made a video on CAN as well. I know Arduino does not support it but its another one of those things that seems quite widely used and mysteriously enough there is no good videos about it :/ Keep up the good work :)

  • @sahinyalgun767
    @sahinyalgun767 Před 5 lety

    hi from Turkey

  • @AtulSohan
    @AtulSohan Před 5 lety

    hey Greatest Scott! , yeah i dont know any other Scott so in my book u r the Greatest Scott .
    Iam having some trouble with my washing machine ;
    its a fully automatic (it was ) until the ECU on it got fried . so i put in an arduino to do the confusing and it worked like a charm , thanks to your videos and lot of others.....................
    BUT me being an unqualified engineer and all decided " Its Working perfectely which means it is too simple it need more things so that something or the other will go WRONG"
    i should have listened to AvE "Dont fix it if it aint Broke" , i didint . so here iam
    i upgraded from a 4 relay module to an 8 realy
    added 2 pumps to dispense the soap and the after wash .
    i thinkits the power supply that is causing the problem .: previously it would blackout the arduino whan the realy energizied , so i put in 1000uF 6.3V
    Cap in parallel to the relay module supply . seems to work ; but ima having trouble sometimes .
    so should i change the PS unit or stick in more caps ?
    or could it be seomthing else ?
    BTW how do i isolate the relay module powersupply ? is there something like a small module that can do that ? like an optocoupler that can transfer power ?
    a module that has all the isolation transformers and stuff built in ?

  •  Před 5 lety

    Nice video. Any chance you could explain the 4 wire SPI used on TFT displays?

  • @ezion67
    @ezion67 Před rokem

    A decoder/demultiplexer can be used for CS or /CS duties and free up pins on the micro.

  • @sabaku7732
    @sabaku7732 Před 3 lety

    Hey, great video man!
    btw which country is jlpcb located in ?

  • @allesolution6409
    @allesolution6409 Před 5 lety

    sir in India 5 th sem is celebrated as teachers day.
    so happy teachers day.
    as u become my greatest learning source .thanks

  • @ratchet1freak
    @ratchet1freak Před 5 lety

    You can get around the slave select limitation by using a decoder or a serial to parallel IC (coincidentally the serial to parallel can be communicated with using SPI).

  • @MrKristian252
    @MrKristian252 Před 5 lety

    Hi there GreatScott.
    Many times I stumble upon SPI modules when looking for easy solutions in my circuits.
    I was wondering if there is any kind of device/program/module that can decode/test/analyze SPI communication?

  • @AJRobinson
    @AJRobinson Před 2 lety +1

    OKAY fine Scott I give in! After years of seeing your videos everywhere I just have to know......please tell me which pens and highlighters you are using, they seem to work so well! :D. Thanks for the good videos man

  • @birnbe2505
    @birnbe2505 Před 5 lety

    Hey GreatScrott, can you make a vid about an Attiny26?
    That were nice!

  • @random55912
    @random55912 Před 5 lety

    What bandwidth oscilloscope do I need to acquire SPI? You mentioned 4MHz clock speed, is a 10 MHz Osc fast enough?

  • @NikhilSehgal21
    @NikhilSehgal21 Před 3 lety

    Thanks Scott,
    I want to check NRF24 Tx RX. - chip conncted or not?
    I tried isChipConnected() function but seems I am using this function correctly.
    Could you help me how can I check/ write code that nrf24L01 modules are connected to Arduino or not?

  • @djtoddles8750
    @djtoddles8750 Před 5 lety +3

    Happy new year everyone (I'm posting this new years eve 2019). Are there any maker geeks out there planning to do a "projects we lost in 2018" in memoriam video?

  • @AdvaitYermalkar
    @AdvaitYermalkar Před 5 lety

    What are the precautions for using SPI bus ?? In i2c its recommended to use pullup registers ? What safety circuit to use for SPI??

  • @westoncampbell9388
    @westoncampbell9388 Před 5 lety

    You should try making a wind turbine btw love your videos

  • @LamantinoElettronico
    @LamantinoElettronico Před 4 lety

    Is this the same protocol used to program microcontrollers like the ATTiny85 and the Arduino itself?

  • @elchiqui10
    @elchiqui10 Před 5 lety

    A decoder/demultiplexer may be used to easily handle 2^N devices with N pins. For example using 74HC4515 you may handle 16 spi devices with only 4 microcontroller pins.

  • @ouahoudizakaria1668
    @ouahoudizakaria1668 Před 2 lety

    Thanks

  • @M0XYM
    @M0XYM Před 5 lety

    Scott - any chance of showing a Forth implementation of both SPI and I2C? Any forth would do...

  • @bp3niva
    @bp3niva Před 5 lety

    hello!
    could you please make an 'Electronic Basics' playlist?
    i'm newbie at this and need all of these to be near :)

  • @yashmewada6604
    @yashmewada6604 Před 4 lety

    Hello Sir, this video is great and so is that I2C communication! I was wondering if you could make a video on UDP communication which according to my research is one of the fastest wireless communication protocols. It would be very helpful.
    Thanks.

  • @domoledlight
    @domoledlight Před 3 lety

    hello tanks for this tuto is it possible to connect 2 arduino marter to 1 spi sd reader

  • @mrx.2233
    @mrx.2233 Před 5 lety

    Which Oscilloscope are you using that has the SPI option?

  • @sanketthakur2297
    @sanketthakur2297 Před 5 lety

    Hey... Can you please make a video on PCD8544 display??wanna to know about Its pinout and interfacing with arduino..

  • @zap3228
    @zap3228 Před 5 lety

    Do you think you can do a video on transistors as amplifiers?

  • @AliReza-xl4zw
    @AliReza-xl4zw Před 5 lety

    hi scott i design my schematics and create in easy eda but i do not want to order it but to made it myself and i cant have the final print with parts and wires what should i do?

  • @nuggetmstr8960
    @nuggetmstr8960 Před rokem

    Would love if u can add an example how to use it at the other microcontroller, like ESP32 (which I currently need), etc. Overall this video give me a new knowledge about SPI communication. Thankss!! 👍

  • @sefalibhakat143
    @sefalibhakat143 Před 5 lety

    you hit 1m subscribe

  • @bandittwothree3765
    @bandittwothree3765 Před 3 lety

    @3:30; when using pinmode() to set an output the low state is default (all PORTx register power-up defaults are 0, or low). So that chip select line is driven low from the pinmode declaration, then driven high again at spi.begin. You can digitalWrite (cs, HIGH) before a pinmode() to ensure it is never driven low incidentally (or write a 1 directly to the PORTB register). To be fair, this is an omission of the Arduino pinmode() reference page that should note the default state.

  • @girishshelly593
    @girishshelly593 Před 5 lety

    Please do a video on i2c communication and one wire communication

  • @niyongereolivier5343
    @niyongereolivier5343 Před 5 lety

    thank you for your greats videos. I learn more think about programming arduino. How can I get Arduino UNO R3 and an oscillospe tektronix TBS1154? thanks