Це відео не доступне.
Перепрошуємо.
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/@...
Good stuff, like the shot at the end too..
Fast, simple and clear.
Couldn't have said it better myself
But did you learn anything new? Or are you talking as someone who already knows all this?
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.
Best spent 18 minutes in a long time. A little bit fast, but useful, clear, simple. Thanks Dave!
You don't have a partner, I guess.
@@macdonalds1972 u have high blood pressure I guess
Very well done, he is fast which I like, and he has a clear voice and nice explanations 8/10
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)
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.
david 2 timer for what?
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.
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/
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.
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!
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.
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
Great video. Very clear and concise. The pace kept me interested the entire time, without being too fast.
Very nice start, Dave! Keep it that way. Fast and clean (as was previously said).
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!
Like the visible colors David, cool tutorial on progian code ...
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. :)
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.
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.
Thats a good idea. I might do that, thanks!
Get well soon Dave!
Great video! I like the fast pace too, no stuffing around!
Great video, thanks!
Totally understandable for typical arduino user
"oh noo, he said things I don't understand!"
welcome to university ! where you teach youreself the subjects
Hi Dave nice to see you again :) good tutorial and hope to see more videos like this in the future
Really nice, this type of segment turned out better then I expected.
Co-hosting EEVBlog like that is the best idea since the channel started :)
very nice Dave!
well done Dave 2!!!
Transplantation of the head was happened at 17:24 LOL
:]
Great job, Dave2! Can't wait to see what happens when you hit your groove after a few more videos. Keep it up!
Very well explained and at the right level for me. Very introductory info can be found elsewhere. Please can we have more. Much more.
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
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
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.
There is a pause button you know
Keep it up Dave 2.
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......
Worth sitting through to see that last shot
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.
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?
Excellent Video. I loved it. Haha. The head swap at the end. That was the money shot :-D
You're doing great David, keep up the good work !
Nice work David! 👍 Haha, great picture at the end.
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?
Nice work, it didn't go over my head and I'm no software expert just a basic C user
love the new outro slide image guys :) - good work.
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?
thumbs up for the end shot :-)
Awesome dave 2
Well Done David! I feel smarter already - Chris
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 ?
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
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.
I like nice and to the point tutorials like this with a minimum of chaff waffle
Awesome Dave2. How long before we know how to program a 3d printer?
Let's continue in this way Dave2 :D
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.
Thumbs up for the greybeards impression. :-)
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!
Why does this video have so many thumbs down?
Dis is gud stuf bois.
Good stuff is worthless if you can't understand it due to poor presentation.
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.
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
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
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!
That is an OR gate, not XOR
I was just wondering: is it possible to make the chip-select bidirectional so that it could work as an IRQ?
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!
Nice !!
Keep it up !!
@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.
you can use interrupts - and it usually works fine...
Nice video. Thanks for slowing down :) Now I know, why theres a speed-setting in the youtube-player, considering the first minute :)
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.)
nice1 Dave too and lmao at the end
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 :)
Frango
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
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
need a follow up video showing how to do those figures in Excel or libreoffice
Sure! It will be with the next video (probably) :)
A big thumbs up to the multimeter and Aneng for its price.
Thanks. Learned from this.
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 :)
Drawboard, it's awesome.
Great video! Keep it up!
Excellent! How did you du this stunning funktion diagrams in Excel at 12:45? I want that too!
went back in time?
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!
What is the brand and model of your logic analyzer..
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 ?)
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
I'd love to hear about audio digital interfaces! e.g. I2S, I2S Variants, TDM
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.
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!
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 :)
What software are you using to do the screen stuff? pretty cool.
Drawboard, we are trying it out :)
Couldn't you use an interrupt on the slave device?
Why it's going to the left? Time usually goes to the right :)
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.
They're in Australia, everything's upside-down.
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.
This is how the Apple II Makes Sound (And I Don't have a beard)
I've never heard SPI said as "spy" before.
It's sometimes easy to forget that David is a mechanical engineer.
No, he's an electronics engineer but it good at mechanical stuff.
You look like Beakman Jr, following in his dads footsteps without the zany humor and with a focus on electronics. 3.141/π.
Watching this video either leaves you where you were or more confused.
Only 17 minutes long? I don't think the entire video got uploaded, Dave ;)
Play it at half speed, then it's 35 minutes.
Nice video Dave2. where Dave1 ???
hi dave! :D
Why so fast! Great content, but for this level of tutorial I think a different presentational style might really make this awesome stuff.
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.
Why is it graphed right to left?
Dave Jones sounds so much younger than normal
XD
DAVE 2 WITH THE DAVE 1 SHIRT ON
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'
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.
Oh... and in combination with DMA bit banging can be awesome
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".
Software SPI is very descriptive, more descriptive than bit banging. But bit banging seems to maybe be a more standard term.
Your teacher was afraid the students would call it butt banging.
I didn't number the others at the time #1 and #2. There are labeled that way now and are in the EEVacademy playlist