M(Eng) AI Instructor 100k+ Subs on YouTube & 60k+ students
Rating: 3.9 out of 53.9Instructor rating
Fun and Easy SPI How the SPI Protocol Works
This video teaches you the basics of SPI or Serial Peripheral Interface Bus used to communicate between two or more devices. If you are looking for an easy way to understand how SPI works then this video tutorial will give you insight into how to connect the Masters and Slave devices in normal mode as well daisy chain configuration. There are also 4 mode to choose from in SPI mode.
Learn the Fundamental Theory of Embedded Microcontroller Communication Protocols for Arduino and FPGA
01:17:42 of on-demand video • Updated February 2017
Understand the fundamentals of Transmitting bits to other devices
Able to differentiate between the various serial protocol and decide which protocol is the best to use for a given application
Hey guys. And welcome back. I'm going to be teaching you about SBI. So in the last video we spoke about Isaac could see now if you want to transfer your data off a bit which can be 1 0 1 0 1 0 1 through. Or is the small 0 8. Just use two wires which is your clock and data to transfer the data. Now looking at SBI we for serial Burfoot interface and this is more or less what it looks like. So we need slightly more options then I could see. But there are added benefits to having this. So first of all let's look at what we have. So we're going to see the clock which synchronize our data updates. We have a master slave out which is also known as measle and that goes from the slave to the master. You have a master out and sleep in that is Muzzey And you also have a slave select line also known as ss. So what happens if you have multiple slaves. So now like I it's the way you just use the same two wires of a unit to increase the amount of pins by the number of slaves that you have. So we have the same 00:00 and Muzzey lines and you can either connect them in this configuration or you can connect them in a daisy chain configuration like this. So you got your master slave in and it goes in from one device or from the missile into the mouth. And in front of our control Mazi and out front the missile into the missile. So either configuration is fine depending on what your requirements are. Let's take a look at the advantages and disadvantages of SDI. So the advantages of SBI is that we have a high throughput then you are hot as well as I could see. So SCEA has a throughput of 10 megabits per second to around 20 megabits per second depending on the type of chip that you're using and what the support good is generally runs at around hundred kilowatts for kilowatts and now until recently can move up to 4 megabits per second just quite fast but not as fast as SBI. So SGA has a simple receiver hardware. We use a simple shift register and what's nice about us is that we don't have a rigid transmission protocol like I could see. We can send a bunch of data and we can program the sleeve to know exactly what to expect. Also what is nice about SDI is that it supports multiple sets. Another advantage that we have is that it uses less power than I could see looking at the disadvantages of this path. Now SETI as seen requires more pins and it's got a lot of sleaze than you really need a big microcontroller to handle the chip select of each slave. There is no flow control on SBI though a big disadvantage is that you can only have one master on DSP Ibis unless you have separate select lines for each slave. It can get quite messy in this kind of situation. Let's take a look at the retrack particles or data transmission particles. So if you've got a single slave configuration we can look at say and we know which just talking to a slave which is in eeprom device that now has a device called the 80 to 5 0 1 0. And by using SBI you can really communicate fast with this device compared to actually. So as I mentioned before what SBI. Every company has their own transmission protocols and you have to read the data sheets and how to communicate with each peripheral say select or select is always low for an active slave if make the slave select of all slaves low. Then you stand a chance of having conflicting data coming to your master. I imagine all this data plugging your master from all these different slates and therefore we only select one slave at the time. Sylvia we start off by putting our to select or salicylic down to zero. Once we initiated that we can plug in our signals and while clicking on signals within our instruction. Right now this is specific code which is unique to the chip. And this is the high as shown in the data sheet of video. We have a 1 and a zero. And this signifies a right. And once you sent an instruction byte you can proceed in our byte address so this by digits is when memory to you and to store your byte. Once you know that you can store your data and you can send a 8 bit data to your boss just keep in mind that we've got the most significant but over the least significant bit of the theme over you and because you're not reading anything our slave opposite is just in high impedance mode. Let's take a look at real particle now in a similar way. We put a lot of slack down to zero to activate our slave clock in our device the constant clock a certain frequency say around 10 megawatts depending on the predefined speed of this chip. And then we see an instruction byte at the Center for it. All right. And then as you can see we've got a one in a one but it's in line. I want to know what it signifies. Read next to sent over by to just plan to read from. So if you send an address of one all the zeros and this will be one. And that this falling edge of slave sends this data out to the master and it sends it fire the slave output line which is over here. So as you can see you can see the clock which is this one we've got a master slave out which is this line over here. We've got our master out sleeve in this one over here. And then we have a Eisley select or select. In this case this length signifies a knot. So this is just selecting not SBA has different modes that you can select. So we have for mode of. So you can see our tracking position can either be low low either rising or falling edge. And the same goes for highway. Can have a falling or rising edge. Now the reason for this is all depending on your master or slave. So if you have an FPGA talking to an Arduino or vice versa and you want to clock it on a low and you're on the clock on the rising edge of the clock then you can select speaker mode number one so it all depends on the configuration of your device. Now this code is for Arduino where you can get it at this link of here but I'll put that link down in the description below. So what is happening is that we first transfer our address by SBH transfer. And if you want to read from the eeprom you put your salicylic down to low you transfer the read of code or the instruction code. And over here we have it as read the after within our address that one to read from. And then this is the data that we receive. So SBA transfer which goes into data and then we return our data back for use. So as you can see SBI is a very simple protocol. And in my opinion it's much easier than I could see but that's just my opinion. What you think based on the previous video and this video what do you prefer. Do you prefer to see or do you prefer API. Please let me know in the comments section and I'll be sure to reply to that. OK so that is it. And thank you for watching. Please don't forget to like subscribe and share and also leave the comments down below in the junior section or comments section below. If you enjoy this video please give it a like and if you didn't watch the video you can check out the link of here and I'll see you in the next election. Bye for now.