Це відео не доступне.
Перепрошуємо.

EEVacademy #3 - Bit Banging & SPI Tutorial

Поділитися
Вставка
  • Опубліковано 14 сер 2024
  • What is Bit Banging and how to bit bang a SPI bus.
    Also how to use an Excel spreadsheet to do logic simulation.
    Forum: www.eevblog.co...
    EEVblog Main Web Site: www.eevblog.com
    The 2nd EEVblog Channel: / eevblog2
    Support the EEVblog through Patreon!
    / eevblog
    EEVblog Amazon Store (Dave gets a cut):
    astore.amazon.c...
    T-Shirts: teespring.com/s...
    💗 Likecoin - Coins for Likes: likecoin.pro/@...

КОМЕНТАРІ • 228

  • @TobyRobb
    @TobyRobb 7 років тому +83

    Good stuff, like the shot at the end too..

  • @JorgeDo
    @JorgeDo 7 років тому +57

    Fast, simple and clear.

    • @BishopsToenail
      @BishopsToenail 7 років тому +4

      Couldn't have said it better myself

    • @jam99
      @jam99 7 років тому +1

      But did you learn anything new? Or are you talking as someone who already knows all this?

    • @JorgeDo
      @JorgeDo 7 років тому +1

      I already know this subject, because I'm a programmer. However he explained the low-level timing and signaling that you don't have to worry about when you use the library. Obviously the video isn't for beginners.

  • @SzDavidHUN
    @SzDavidHUN 7 років тому +24

    Best spent 18 minutes in a long time. A little bit fast, but useful, clear, simple. Thanks Dave!

    • @macdonalds1972
      @macdonalds1972 7 років тому +5

      You don't have a partner, I guess.

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

      @@macdonalds1972 u have high blood pressure I guess

  • @RiyadhElalami
    @RiyadhElalami 7 років тому +31

    Very well done, he is fast which I like, and he has a clear voice and nice explanations 8/10

  • @andyburns
    @andyburns 7 років тому +21

    depends on the clock speed, not necessary to do polling and eat up all your cpu time, I've done interrupt-driven bit banged spi slave on an esp8266 (yes my beard is grey)

    • @davidledger5941
      @davidledger5941 7 років тому +4

      You are absolutely right, you can have interrupt driven code. It however isn't going to be portable code because it is going to rely on the platforms timer implementation.

    • @tomaskovacik
      @tomaskovacik 7 років тому

      david 2 timer for what?

    • @davidledger5941
      @davidledger5941 7 років тому +3

      I suspect Andy was using a timer to control how long between clock pulses and then using the timers interrupts (functions that execute when the timer expires) to bit bang, clocks, reads and writes.
      Interrupt driven bit banging can be much more efficient but only with slower clock rate serial interfaces.

    • @yamakaja1252
      @yamakaja1252 7 років тому +1

      I think he was referring to the polling: You can have an interrupt routine run when a pin goes high on most microcontrollers, which saves you from basically all overhead while still being able to respond pretty much instantly
      See gonium.net/md/2006/12/20/handling-external-interrupts-with-arduino/

    • @davidledger5941
      @davidledger5941 7 років тому +1

      Any context switching (executing an interrupt service routine) has overhead, if you were trying to bit bang at the maximum possible speed on a micro for example it would be much slower using interrupts to do it.
      For slave devices with interrupt on change, it would certainly be great for low speed communications.

  • @TheWP
    @TheWP 7 років тому

    I think these videos are great for an intermediate / advanced electronics enthusiasts / professionals like myself. No wasted time on things I already know, clear and to the point. Thanks Daves!

  • @SIMPhony
    @SIMPhony 7 років тому +1

    Thanks! This video taught me bit-banging in less than 20 minutes, which is absolutely fantastic. Yes, it requires knowledge of digital signals and gate logic.... but Dave already explained those in separate videos previously, so I don't see the problem many seem to have with this video. I think it's good you don't spend extra 40 minutes explaining all the basic concepts.

  • @MAYOJAMESD
    @MAYOJAMESD 7 років тому

    i give him a 10 for clarity and explaining, but a 1 for use of hilarious australian expressions. we were never in like flynn and bob was never my uncle. this channel should be 5% learning, 94% bloody ripper, and 1% release of magic smoke

  • @MaxJ345
    @MaxJ345 7 років тому

    Great video. Very clear and concise. The pace kept me interested the entire time, without being too fast.

  • @vovetsno1
    @vovetsno1 7 років тому

    Very nice start, Dave! Keep it that way. Fast and clean (as was previously said).

  • @musmodtos
    @musmodtos 7 років тому

    Perfect,for us who use the theory but aren't so as up to speed with the hardware you've pitched this just right!
    Thank you!

  • @TKomoski
    @TKomoski 7 років тому +3

    Like the visible colors David, cool tutorial on progian code ...

  • @Gossamer2
    @Gossamer2 7 років тому +2

    Thanks David! I have played a little with the Dallas 1-Wire stuff which was kind of neat, and I've wanted to know more about SPI and other protocols. Here's a suggestion for a future episode; how to JTAG any device and read/write the chip contents. We know you're the hacker type. :)

  • @XeonXR6
    @XeonXR6 7 років тому

    Honestly one of the most clear and concise tutorials I've seen in a long time! Well done Dave2 - keep-em up! Would love to seem some RS485 demonstrations using a Teensy 3.2 or something.

  • @JetNmyFuture
    @JetNmyFuture 7 років тому +1

    Well done D2! One reason I use bit-banging is to intentionally create errors to stress another part of the system during testing.
    I like the presentation although it seems like the general audience may be at a lower level. Maybe as a quick intro - explain what the target audience it and prep them for the relative skill level you are about to present. Look forward to more from you.

    • @davidledger5941
      @davidledger5941 7 років тому

      Thats a good idea. I might do that, thanks!

  • @arduinoversusevil2025
    @arduinoversusevil2025 7 років тому +2

    Get well soon Dave!

  • @timkent
    @timkent 7 років тому

    Great video! I like the fast pace too, no stuffing around!

  • @allegas1
    @allegas1 7 років тому +4

    Great video, thanks!
    Totally understandable for typical arduino user

  • @thenwhoami
    @thenwhoami 7 років тому +46

    "oh noo, he said things I don't understand!"

    • @yankovMuskula
      @yankovMuskula 7 років тому +3

      welcome to university ! where you teach youreself the subjects

  • @Mriks007
    @Mriks007 7 років тому +1

    Hi Dave nice to see you again :) good tutorial and hope to see more videos like this in the future

  • @Unknownety
    @Unknownety 7 років тому

    Really nice, this type of segment turned out better then I expected.

  • @FlashEF
    @FlashEF 7 років тому

    Co-hosting EEVBlog like that is the best idea since the channel started :)

  • @totaldude155
    @totaldude155 7 років тому

    very nice Dave!

  • @antiekeradio
    @antiekeradio 7 років тому

    well done Dave 2!!!

  • @Aleynikov
    @Aleynikov 7 років тому +7

    Transplantation of the head was happened at 17:24 LOL

  • @bitrot42
    @bitrot42 7 років тому

    Great job, Dave2! Can't wait to see what happens when you hit your groove after a few more videos. Keep it up!

  • @mbaker335
    @mbaker335 7 років тому

    Very well explained and at the right level for me. Very introductory info can be found elsewhere. Please can we have more. Much more.

  • @shinyshadow
    @shinyshadow 7 років тому

    I think its a good explaination of SPI, tought me a thing or two, and it seems I'm always bit-banging.. grrrr Nice one Dave 2

  • @anishsarkar120
    @anishsarkar120 7 років тому

    Fast and to the point great , but some insights would have been great like dave does REALLY GOOD TUTORIAL ON SPI THANKS MAN as i myself is an student

  • @DelTapparo
    @DelTapparo 7 років тому +2

    Great tutorial. Just way fast. Too many new things for me to catch at high speed. Hope to see more at a reduced pace. Good job. Great addition to the channel.

    • @uzor123
      @uzor123 5 років тому

      There is a pause button you know

  • @stephenchavez3534
    @stephenchavez3534 7 років тому

    Keep it up Dave 2.

  • @maule5653
    @maule5653 7 років тому

    Very nice! Like the use of the drawing tablet. Maybe just slow down a pinch; for those of us not imtimately familiar with the subject (and not Aussie's!), there were many presses of the "J" key to repeat some sections. Absolutely loved the closing shot!!! Now if only the old Dave had that head of hair......

  • @swharden
    @swharden 7 років тому +1

    Worth sitting through to see that last shot

  • @russ18uk
    @russ18uk 7 років тому +1

    I dislike the method of delivery but Dave2 is new. Maybe you can do a part b explaining some of it in front of the whiteboard.

  • @Hasitier
    @Hasitier 7 років тому

    Nice to See a Video of Dave 2. could be a bit more slowly for better understanding but I like it. Please do more. Maybe the 2 daves could make some videos together?

  • @NorbertHarrer
    @NorbertHarrer 7 років тому

    Excellent Video. I loved it. Haha. The head swap at the end. That was the money shot :-D

  • @Deckardsvr
    @Deckardsvr 7 років тому

    You're doing great David, keep up the good work !

  • @AKATEATime
    @AKATEATime 7 років тому

    Nice work David! 👍 Haha, great picture at the end.

  • @m8uwut
    @m8uwut 7 років тому

    Can you explain the logic formulas @ 4:30 ? I thought that when T is high, then you're putting Vss on the NPN and Vdd on the PNP, effectively creating a high-z state, and when T is low, the voltage of D is on both the PNP and NPN, which would send the Vdd or Vss to the output...?
    The P=~TD + ~DT is the equation of an XOR gate... right?

  • @SparkyLabs
    @SparkyLabs 7 років тому

    Nice work, it didn't go over my head and I'm no software expert just a basic C user

  • @CrazyLogic
    @CrazyLogic 7 років тому

    love the new outro slide image guys :) - good work.

  • @onlyrgu
    @onlyrgu 7 років тому

    If you use the bit banging on slave micro which runs a RTOS( Lets assume this micro doesn't have any spi ports left). The semaphore can run the SPI subroutine without disturbing main application code right?

  • @voltlog
    @voltlog 7 років тому

    thumbs up for the end shot :-)

  • @SionynJones
    @SionynJones 7 років тому

    Awesome dave 2

  • @northsideservicecompany3567
    @northsideservicecompany3567 7 років тому

    Well Done David! I feel smarter already - Chris

  • @LukasDzunko
    @LukasDzunko 7 років тому

    Why are you drawing plot in opposite direction ? We normally draw earlier time on left and later on right. E.g. time "flow" from left to right. I am missing something ?

  • @seamonkeys12y
    @seamonkeys12y 7 років тому

    Well this is good. I just recently found out that I need to learn how bit banging worked since I have an ic with no native i2c support

  • @fcweng
    @fcweng 7 років тому

    More like a Dave's Job here. It's sort like just the bits jumping around in a more controlled manner. MiSo n MoSi had wars of words if they don't agree each other.

  • @pkplexing
    @pkplexing 7 років тому

    I like nice and to the point tutorials like this with a minimum of chaff waffle

  • @MaximeLavigne
    @MaximeLavigne 7 років тому

    Awesome Dave2. How long before we know how to program a 3d printer?

  • @bfx8185
    @bfx8185 7 років тому

    Let's continue in this way Dave2 :D

  • @Cold-1
    @Cold-1 7 років тому

    First thing that came to mind when reading the title: ZX Spectrum EAR and MIC sockets :-)
    They were used to read and write the cassettes and were implemeted with bit banging.

  • @donvito1973
    @donvito1973 7 років тому

    Thumbs up for the greybeards impression. :-)

  • @JayJay-ki4mi
    @JayJay-ki4mi 23 дні тому

    In my case I have no choice. I have a microcontroller that doesn't support SPI, and a sensor that only has SPI. With limited space. It's been a learning curve for sure!

  • @harrysvensson2610
    @harrysvensson2610 7 років тому +35

    Why does this video have so many thumbs down?
    Dis is gud stuf bois.

    • @crimsun7186
      @crimsun7186 7 років тому +8

      Good stuff is worthless if you can't understand it due to poor presentation.

    • @harrysvensson2610
      @harrysvensson2610 7 років тому +3

      Thanks for saying why. Now when you say it, I agree. It's different and basic doodling, it isn't on par with khan's drawing or Dave's whiteboard.
      The only thing that threw me off was 10:15 when it looked as if the POL-parameter and PHA-parameter meant the same thing. It's only now when I'm writing this comment that I realized that there's some gray stuff at the start and end...
      Oh well. Good talk.

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

    Awesome! Could you please tell me which books deal with this topic? I happen to need to do a development with ESP8266 and I2C acting as multi-master

  • @akosszekacsYT
    @akosszekacsYT 7 років тому

    Very good video, covers everything, the pace and the amount of information is perfect (at least for me).
    As others already stated it: "Fast, simple and clear".
    Keep them coming

  • @Nippius
    @Nippius 7 років тому

    Loved it and I hope you make more of this. The only "critisism" I have is that you went a little too deep and too fast on the electronics of a GPIO pin. Not that they aren't important but I think they should be a separate tutorial.
    Apart from that, nice job!

  • @olehermanse
    @olehermanse 7 років тому +3

    That is an OR gate, not XOR

  • @SkyCharger001
    @SkyCharger001 7 років тому

    I was just wondering: is it possible to make the chip-select bidirectional so that it could work as an IRQ?

  • @gonXay
    @gonXay 7 років тому

    Just some criticism on the audio, it sounds really muffled and digitally compressed at a low bitrate. The bitrate is a recurring issue with most of the EEVblog videos, but this one takes the cake for shoddy audio quality. Otherwise the content is top notch, keep it up Dave^2!

  • @shakaibsafvi97
    @shakaibsafvi97 7 років тому

    Nice !!
    Keep it up !!

  • @linengmiao
    @linengmiao 7 років тому +2

    @EEVblog 6:05 "you wouldn't bitbang a slave.... if a slave device is bitbanging it must always be polling the bus". Why can't you use interrupts instead of polling? This looks like a much better alternative to me, that way the program can do something else.

    • @uwezimmermann5427
      @uwezimmermann5427 7 років тому +3

      you can use interrupts - and it usually works fine...

  • @marcus_w0
    @marcus_w0 7 років тому

    Nice video. Thanks for slowing down :) Now I know, why theres a speed-setting in the youtube-player, considering the first minute :)

  • @SkyCharger001
    @SkyCharger001 7 років тому

    another reason for bit-banging: if (the initial run of) the serial-communication-chip does not meet its design-criteria. (This is why the C64 uses bit-banging instead of dedicated serial by default.)

  • @PiezPiedPy
    @PiezPiedPy 7 років тому

    nice1 Dave too and lmao at the end

  • @RoterFruchtZwerg
    @RoterFruchtZwerg 7 років тому +12

    Hey ;) Hate it to say, but I think from an educational perspective the video, especially the first part about bit-banging, wasn't that great :/ I'm pretty sure someone who wasn't sure what exactly bit-banging is didn't get it... And someone who knows it, couldn't learn anything. First of all, you should have started with why you toggle your pin high/low at all and what requirements you have... e.g. by just refering to a simple datasheet that says what a serial signal actually has to look like to communicate with a device. To keep it simple, use something like the WS2812 drivers, I2C or TTL (not bidirectional, not additional control lines).
    Then explain what actually the difference between using hardware and software is - because for someone that only know what an arduino is, it is not obvious that the microcontroller hardware actually contains hardware for serial communication.
    You can explain in few sentences that "hardware" actually means a separate logic in the chip with its own seperate memory where you put the data you want to send, that works autonomous from the cpu.
    Using hardware means, you tell this seperate logic "use the bit stream from your dedicated memory to generate the high/low signals on the pins now and let me concentrate on other things" whereas using software means "oh shit, I now have to set this pin high, wait for 2µs, then set it low, then high again after 4µs and so on... this will keep me busy a hell lot of time"...
    Explain that telling the hardware to shift out data actually takes only few cpu instructions, whereas using software takes almost the same amount of instructions for every bit.
    Explain why that restricts timing, etc....
    Explain that the hardware must actually be built for a specific protocol and therefore chips usually don't have unlimited hardware support for thousand protocols - which is why bit-banging in software is always a thing... Like Arduino SoftwareSerial... Or protocols like the WS2812 where usual chips just don't have hardware support.
    Hope that was helpful :)

    • @ecstazyrm
      @ecstazyrm 5 років тому

      Frango

    • @joshwallis9366
      @joshwallis9366 5 років тому

      Thanks for this comment, I'm new to all of this stuff and the video was sort of lost on me even after following the first two videos perfectly

  • @longjohn526
    @longjohn526 7 років тому

    Probably the most common example of bit banging today is what Arduino calls Soft Serial .... I see it used a lot with Unos but I prefer just to get a Mega which has 4 UARTs

  • @steubens7
    @steubens7 7 років тому +1

    need a follow up video showing how to do those figures in Excel or libreoffice

    • @davidledger5941
      @davidledger5941 7 років тому +1

      Sure! It will be with the next video (probably) :)

  • @yasirnoori4848
    @yasirnoori4848 6 років тому

    A big thumbs up to the multimeter and Aneng for its price.

  • @aDynoNet
    @aDynoNet 7 років тому

    Thanks. Learned from this.

  • @Dhamian
    @Dhamian 7 років тому

    Hi. I assume you're doing this presentation on the the Surface Pro. What software did you use to draw and record all of it? I have a Surface myself and I'm interested in producing similar tutorial videos :)

    • @EEVblog
      @EEVblog  7 років тому +1

      Drawboard, it's awesome.

  • @exosdel
    @exosdel 7 років тому

    Great video! Keep it up!

  • @mbn65
    @mbn65 7 років тому

    Excellent! How did you du this stunning funktion diagrams in Excel at 12:45? I want that too!

  • @kirkpennock2997
    @kirkpennock2997 7 років тому +4

    went back in time?

  • @guytech7310
    @guytech7310 7 років тому

    Bit banging is necessary simply because some SPI devices don't have common word sizes, or do something funky like outputting date while you sending the next instruction/command. It would be nice if SPI device manufactures didn't do funky stuff so we could just us hardware implemented SPI I/O!

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

    What is the brand and model of your logic analyzer..

  • @sreejith_s
    @sreejith_s 5 років тому

    Without flow control, how a master will assure a successful communication ?
    (If it is I2C, there is ACK response, right ? But it is not there in SPI. Then how ?)

  • @glaysonnn
    @glaysonnn 7 років тому

    Ola DAve favor faça um video sobre o beeprog2 se possível descubra como o gravador identifica os adaptadores pois os mesmos são de uso exclusivo.
    Hi DAve please make a video about beeprog2 if possible find out how the recorder identifies the adapters because they are for exclusive use. Send hi to Brazil

  • @alexwang007
    @alexwang007 7 років тому +4

    I'd love to hear about audio digital interfaces! e.g. I2S, I2S Variants, TDM

    • @khronscave
      @khronscave 7 років тому +1

      Wikipedia has a reasonably clear(?) page on I2S.
      If by "variants" of I2S you mean the left/right-justified versions, those technically aren't I2S (to the best of my knowledge, anyway). In the words of AvE - "same same, only different" :) Yes, they use the same clock signals, but the data bits are arranged / sent differently. I think all chip datasheets, regardless of supporting "just" I2S, and/or other modes, contain timing diagrams which show pretty much all you need to know about the protocol / format.

    • @alexwang007
      @alexwang007 7 років тому +1

      KhronX ohh, cuz i am trying to get ADCs&DACs from TI, to talk to SigmaDSPs from ADI(shouldn't matter, right?), and had been super confused looking at many different timing diagrams.. alright i have to go check it out first, and not to be lazy like this! Still waiting for Dave to yell focus u fack, everytime his cam goes out of focus😂😂
      Anyways thank you very much!

    • @khronscave
      @khronscave 7 років тому

      As long as both "ends" of each I2S interface are set for the same mode, you should be all good. It's an industry *standard* for a reason :)

  • @DafyddRoche
    @DafyddRoche 7 років тому

    What software are you using to do the screen stuff? pretty cool.

  • @esven9263
    @esven9263 7 років тому

    Couldn't you use an interrupt on the slave device?

  • @heydmytro
    @heydmytro 7 років тому +1

    Why it's going to the left? Time usually goes to the right :)

    • @davidledger5941
      @davidledger5941 7 років тому +3

      Yeah I don't know why my brain wanted to draw that in a very non-standard way. Kinda silly, didn't realize I did it.

    • @macdonalds1972
      @macdonalds1972 7 років тому +1

      They're in Australia, everything's upside-down.

  • @flo47able
    @flo47able 7 років тому

    I like the video.
    But you could make that 2 video.
    1 show how spi works.
    2 how to bitbang it.
    This way it's easyer to understand for somebody how don't know spi und everybody who know spi can just watch the bitbanging video.
    Any way. Nice video. I liked it. More pls.

  • @X-OR_
    @X-OR_ 7 років тому +5

    This is how the Apple II Makes Sound (And I Don't have a beard)

  • @Psi105
    @Psi105 7 років тому +1

    I've never heard SPI said as "spy" before.

  • @seancsnm
    @seancsnm 7 років тому

    It's sometimes easy to forget that David is a mechanical engineer.

    • @EEVblog
      @EEVblog  7 років тому

      No, he's an electronics engineer but it good at mechanical stuff.

  • @Razerboard
    @Razerboard 7 років тому

    You look like Beakman Jr, following in his dads footsteps without the zany humor and with a focus on electronics. 3.141/π.

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

    Watching this video either leaves you where you were or more confused.

  • @soviut
    @soviut 7 років тому

    Only 17 minutes long? I don't think the entire video got uploaded, Dave ;)

    • @macdonalds1972
      @macdonalds1972 7 років тому

      Play it at half speed, then it's 35 minutes.

  • @OmarMekkawy
    @OmarMekkawy 7 років тому

    Nice video Dave2. where Dave1 ???

  • @alexwang007
    @alexwang007 7 років тому

    hi dave! :D

  • @AlexHitchins
    @AlexHitchins 7 років тому +2

    Why so fast! Great content, but for this level of tutorial I think a different presentational style might really make this awesome stuff.

  • @crimsun7186
    @crimsun7186 7 років тому +5

    Even for someone who has little idea of what the video is about, it feels rushed. The tutorial seems to be only effective if you already know what bit banging is, which defeats the purpose in the first place.

  • @JmanNo42
    @JmanNo42 7 років тому

    Why is it graphed right to left?

  • @funkyironman69
    @funkyironman69 7 років тому

    Dave Jones sounds so much younger than normal
    XD

  • @God-CDXX
    @God-CDXX 7 років тому

    DAVE 2 WITH THE DAVE 1 SHIRT ON

  • @btouw8558
    @btouw8558 7 років тому +2

    Sorry Dave, You go to fast, you show things and think the rest in between, explaining is a art form, but dont get discouraged , you are on the right way, and if you learn to master the skil of explaining things you wil be great,, try to keep it compact as you do now, but without the "skipping in between'

  • @NivagSwerdna
    @NivagSwerdna 7 років тому

    It's not really a Young Player versus Grey Beard thing.... it's a more you have run out of dedicated hardware thing... so you need a 2nd UART but you have only one in the controller... etc.. Most of us older players have no problem with banging. Enjoyed the SPI part and cross platform development is a useful technique. A trap for young players (said despite not having a grey beard) is interrupts... specifically ensuring that some higher priority event doesn't disturb the timing, something that hardware eliminates.

    • @NivagSwerdna
      @NivagSwerdna 7 років тому

      Oh... and in combination with DMA bit banging can be awesome

  • @MrTridac
    @MrTridac 7 років тому

    Nice one. Did I miss #1 and #2 ?
    Also, I don't think "bit banging" is a good term. My teachers just called it "software SPI".

    • @davidledger5941
      @davidledger5941 7 років тому

      Software SPI is very descriptive, more descriptive than bit banging. But bit banging seems to maybe be a more standard term.

    • @macdonalds1972
      @macdonalds1972 7 років тому +1

      Your teacher was afraid the students would call it butt banging.

    • @EEVblog
      @EEVblog  7 років тому

      I didn't number the others at the time #1 and #2. There are labeled that way now and are in the EEVacademy playlist