EECS 373 - Fall 2026 - Lecture 10: "Timers Resolution vs Length & Serial Bus Overview ” — Transcript
Full transcript
- 0:03All right, we'll get started.
- 0:05>> So, today we're going to be finishing up
- 0:07timers, doing a little bit of a system
- 0:09timer stuff, and then Wednesday we'll
- 0:12start on serial interfaces.
- 0:15So, homework 4 is due today.
- 0:18Uh we'll have office hours today after
- 0:20class and then uh the big thing is that
- 0:23Friday is a team formation event. To get
- 0:25prepared for that, you have to submit
- 0:26some ideation slides. I'll talk about
- 0:28that in a second. Um, and we'll serve
- 0:30pizza. And basically the event is you we
- 0:34give you an outline of the project. You
- 0:35guys pitch your ideas and form teams.
- 0:37Um,
- 0:39let's see. We we made a new project page
- 0:41for the class website. It should have a
- 0:45better formation of all the things that
- 0:46students need to do for the project. So
- 0:48that was a concern last time. The thing
- 0:50we haven't done is figured out we're
- 0:52have not implemented easy way to
- 0:53duplicate all the dates here over to
- 0:55here without just doing it manually. So,
- 0:58either we will just do it manually or
- 1:01we'll figure out a nice way to do it
- 1:02automatically, but if you're looking for
- 1:04a date something's due, it's on the
- 1:05assignment page for now, at least for
- 1:07the rest of the week.
- 1:09Um, we released the project details.
- 1:12It's not particularly different from
- 1:13years in the past. I think we're going
- 1:15to say that there can be no teams of two
- 1:18with a class this size. It's just not
- 1:19tractable. So, it's got to be teams of
- 1:21three or four. You could do five if you
- 1:23had to. Um
- 1:27yeah, we changed the format of the uh
- 1:30project proposal a little bit. Um but uh
- 1:33you guys can read through that and ask
- 1:34questions if you need. And then for
- 1:38Thursday um you need to submit your
- 1:41slides and unfortunately have to do it
- 1:43in two places this year. So one is
- 1:44submit for grade scope just for uh
- 1:47grading purposes and other places you
- 1:48need to take a copy of your Google
- 1:50slides and put them into a folder uh
- 1:53that the class will see. So, just so you
- 1:55know, other students, only students in
- 1:56this class will be able to see the other
- 1:57slides. That's so people can look
- 1:59through the slides and start seeing,
- 2:01hey, this seems interesting to me. At
- 2:03least they get to know who's involved
- 2:05and who's thinking about similar ideas.
- 2:07Um, if you make your slides in
- 2:09PowerPoint or Keynote, you'll have to
- 2:11convert them to um
- 2:14Google Slides and then I'll run a script
- 2:16to make them all into one file before
- 2:18the meeting. Uh, yeah. And then yeah, I
- 2:23think we'll be on Friday from 4:30 to
- 2:256:30 or so, probably 6:00. Do you have
- 2:28any logistics questions for what's going
- 2:30to happen this week?
- 2:41Okay. [snorts]
- 2:43Oh, and then next week, the goal is to
- 2:46have your teams registered. There's a
- 2:47form you have to fill out online. Uh you
- 2:50just say, "Here's your team. Here's the
- 2:51members. Here's a a quick a name for
- 2:54your team. And that can change later.
- 2:56Um, and the goal is to have it done by
- 2:58Tuesday. If you really can't, well,
- 3:00first of all, if you don't have haven't
- 3:01found any team members by Monday, come
- 3:03see me after class. We'll uh help you
- 3:06find a team. You can always advertise on
- 3:08Piaza. if you're looking for teammates
- 3:10or you're looking for to join a team and
- 3:13then you know if you really can't get it
- 3:14done by Tuesday then come see me on um
- 3:18let me and James know through email or
- 3:20come to see us directly so we can make
- 3:22sure we find a team for you.
- 3:25>> Yeah,
- 3:28>> you don't have to. Usually what happens
- 3:30is that people have starred slides and
- 3:33they're like would anybody like to
- 3:34present? Would anybody like to pitch an
- 3:36idea? Right? Because it's really like
- 3:38no, you're not required to present. No,
- 3:40it's not a formal like pitch or
- 3:41anything, but you could just go up there
- 3:43for three minutes or a minute and just
- 3:44say this is my idea. Aren't you excited
- 3:46about it?
- 3:49>> Yeah.
- 3:56>> Sure.
- 3:58Hopefully you'll get the forcing
- 4:00function of making three good slides
- 4:01will get your ideas out. Yeah. Can you
- 4:05describe the complexity points like for
- 4:07instance for a group of three versus a
- 4:09group of five what number of features
- 4:11you need?
- 4:14>> A course way to think about that is you
- 4:15need a number of features plus one for
- 4:17your group size. So your group size
- 4:19three you need four you need. So you
- 4:21just need one extra feature. Now you
- 4:23know blinking LED is a lot easier than
- 4:26you know make some arbitrary LCD screen.
- 4:28So we'll give you advice. will give you
- 4:29feedback on like we think that's uh
- 4:31meaty enough or maybe you need to add
- 4:33something.
- 4:35>> Yeah.
- 4:36>> Do you require certain communication
- 4:38protocols like
- 4:41>> No, it's pretty free form. The proposal
- 4:45asks you to write a bunch of stuff up,
- 4:46but you probably don't know all the
- 4:48answers to every single question in
- 4:49there as well. It's more of a guideline.
- 4:50These are the things you need to start
- 4:52thinking about. Um, for instance, you
- 4:54may want to uh one of the things we ask
- 4:56is like think about what's the power
- 4:58requirement, voltage and current of your
- 5:00particular device. Well, if you just
- 5:02said, I want a mythical uh laser
- 5:04rangefinder. I have no idea if we can
- 5:06even afford that. You're not going to
- 5:08know the answer. But at least you should
- 5:10start thinking about like, okay, I'm
- 5:11going to have to think about power. So,
- 5:12it's not like you have to define the
- 5:14entire project, but you have to have a
- 5:16clear idea when you come to our your
- 5:17pitch meeting with us.
- 5:21>> Okay. All
- 5:24right. So, I wanted to to finish up
- 5:27timers. And I think there was a a
- 5:29challenge. I don't know. I thought
- 5:31talking to folks, there's this confusion
- 5:33between resolution and a timer length,
- 5:36like how long a timer can go versus how
- 5:39precisely you can measure the passage of
- 5:41time. And by resolution, I mean like
- 5:42what's the minimum step size that you
- 5:44can measure. So, I wanted to kind of go
- 5:45over that concept again and see if I can
- 5:48uh do a better job this time.
- 5:52All right. So, we'll just do a little
- 5:54quick review of timer basics here. So,
- 5:56you have some clock that's going in. We
- 5:58have a pre-scaler. Remember, the
- 6:00pre-scaler on at least on your devices
- 6:02is just a divide by two uh or divide by
- 6:06two to the n. Um, so maybe slightly
- 6:09different than a pre-scaler that you may
- 6:11see other places, but that's fine. It's
- 6:13just a way to reduce the clock speed.
- 6:17You never I can't think of a time when
- 6:20you ever want to increase your clock
- 6:21speed. At least that's not how timers
- 6:24typically work. I've never seen one that
- 6:25works that way. So, it's always the
- 6:27assumption you have a much faster clock
- 6:29and you're trying to slow that thing
- 6:30down.
- 6:33And this is a particular equation for on
- 6:35your device uh that you know you're
- 6:38going to take your input time or input
- 6:40frequency and divide it by a power of
- 6:41two to get your output frequency. uh
- 6:43other microcontrollers will just have a
- 6:45slightly different modality or slightly
- 6:46different equation. It doesn't really
- 6:48matter. The idea is that you're going to
- 6:49slow it down.
- 6:51Then you have some counter. This is just
- 6:53it's easiest just to think about this as
- 6:55a up counter. Although there's lots of
- 6:57flexibility. They can go up, they can go
- 6:58down, they can go up, then down, but
- 7:00really this is just passes
- 7:03uh counts each uh clock edge that comes
- 7:06into that thing. And this has a running
- 7:08value.
- 7:10And of course, if you didn't put any uh
- 7:13uh period reset in there, it would just
- 7:14overflow. Eventually, it'll count up to,
- 7:17in this case, you're using 16- bit
- 7:18timers. It'll count up to uh 2 to the 16
- 7:21or yeah, two to the^ 16, and then it'll
- 7:24overflow. But you, it's pretty coarse
- 7:26way of controlling the passage of time.
- 7:28So, often times you'll have a period
- 7:30register. Other microcontrollers will
- 7:33call it something else. And so, this is
- 7:35just says when you reach this value,
- 7:37then reset the timer. Right? That's all
- 7:39it's giving you control over how long it
- 7:41counts up to.
- 7:44And then usually there's some output
- 7:46event like when you have hit that thing
- 7:49then you can cause some action to occur.
- 7:52So you count up to whatever your uh
- 7:54period register is and then you get an
- 7:56output signal and that can go to uh
- 7:58interrupt that could go to another timer
- 8:01that could go to another place on the
- 8:02chip or it could just be held in a
- 8:04register in case um you know maybe that
- 8:06the for some reason the core is going to
- 8:08come and pull that value. You don't uh
- 8:11there's lots of different flexibility
- 8:12and your microcontroller gives you a lot
- 8:14of different options. So does anybody
- 8:16have any questions about the basic
- 8:18structure of the timer?
- 8:24How how do you feel about this one's
- 8:26This one's working. Thumbs up. You have
- 8:29no idea what's going on. Don't want to
- 8:31raise your hand. Okay, cool. That's
- 8:33fine. I'm here to here to try help out.
- 8:35All right. So, when we're thinking about
- 8:39the pre-scaler, the pre-scaler is just
- 8:41trying to and this is so this is just an
- 8:43example waveform. There's some uh p
- 8:45period register, so it counts up to some
- 8:47value and resets. We have an input clock
- 8:49and then you have a pre-scale clock. And
- 8:51so the idea I really want to think about
- 8:53is here. Oh, and here's this initial
- 8:55value. So say pre-scaler set to to two
- 8:58to the one. We've got 21 clock cycles
- 9:01here. And the resolution, the smallest
- 9:03me thing we can measure here would be
- 9:05something of two clock source clock
- 9:07ticks, right? You can't measure
- 9:09something smaller than that. And so here
- 9:12we can scale that thing, right? This is
- 9:14my PowerPoint scaling. You can just make
- 9:16this thing really long. And that's just
- 9:17by changing your your pre-scale factor.
- 9:20So here I just doubled it. It's
- 9:22approximately doubled, you know,
- 9:23PowerPoint accuracy here, but I've
- 9:26doubled the uh the pre-scaler, which
- 9:29means now my uh period has gone from it
- 9:33was 21 clock cycles before, now it's 41.
- 9:36Right? So just by doubling that, now I
- 9:38can count things that are much further
- 9:39out in time. But I've sacrificed
- 9:41something. I've sacrificed my
- 9:42resolution. Now the smallest interval I
- 9:45can measure is four clock cycles.
- 9:49Yeah.
- 9:58>> Uh we say let's just say us always on
- 10:00the rising edge.
- 10:04Why do you think why is that troubling
- 10:05you? What are you thinking?
- 10:11Uh, it looks like it's rising on rising
- 10:13falling edge.
- 10:15Okay, maybe my uh my diagram is only
- 10:18PowerPoint quality.
- 10:21It does look that way, doesn't it?
- 10:23Rising falling edge.
- 10:25All right. Well, I get to update those
- 10:26tonight. But regardless of that minor
- 10:29fact, um the real idea here is that uh
- 10:33as you increase your pre-scaler, right,
- 10:35your period increases. So the longest
- 10:37thing that you can measure starts
- 10:38increasing, but the amount of time that
- 10:40you can measure is decreas or the
- 10:42resolution is decreasing.
- 10:46All right? And then you can do the
- 10:47opposite one. You could decrease your
- 10:48pre-scaler,
- 10:50right? And here the challenge is you
- 10:53know you made your pre-scaler basically
- 10:55uh to not divide. Uh you went down to 11
- 10:58clock cycles. Uh this is because when
- 11:00you're you're counting up you always
- 11:02have to count zero as well. And so
- 11:04you've gone up 11 clock cycles. Uh so
- 11:06you're shorter period but now your uh
- 11:09clock resolution is one clock cycle.
- 11:14So any okay so uh and then we can go
- 11:18back to the normal case and then where
- 11:20your um period register comes in here
- 11:23this is just allows you to control how
- 11:25many clock ticks there are so here we
- 11:27just increase the amount of clock ticks
- 11:29that you go through and now you can set
- 11:31this value to something here 26 uh clock
- 11:35cycles for instance now I get to control
- 11:36the length of time but you can only
- 11:39control up until the point where you've
- 11:40overflowed you can't control past that.
- 11:52All right. So, this table, which you can
- 11:53probably barely see, but it's at least
- 11:55in your slides, kind of showed you this
- 11:57inherent trade-off. On the top, we have
- 11:59our um our pre-scaler values from 0 to
- 12:0315. And then you have just in log here
- 12:06is the count on your counter. And so
- 12:09this is would be your uh uh period
- 12:12counter let's say. And so you can see
- 12:14that there are lots of different values.
- 12:16There's this inherent trade-off between
- 12:18uh the values you get. And then the
- 12:21trick here is that there just happens to
- 12:23be like a lot of duplicates. So why why
- 12:26don't you take you know so here I have a
- 12:28device that has lots of different
- 12:29duplicate values. So there's lots of
- 12:31different ways to get to these things.
- 12:33So why don't you take 60 seconds talks
- 12:35amongst yourself. Why would you make a
- 12:37device that has all this duplicated
- 12:38functionality?
- 12:41What are they trying to offer you?
- 12:58It's like
- 13:09[clears throat]
- 13:46All right. So why why have they made a
- 13:48device that has so much duplication? Why
- 13:50why not just give you one row?
- 14:00>> So in one case for instance on the left
- 14:02hand side getting the 655 you have many
- 14:05more values you have a higher
- 14:06granularity between um like zero and
- 14:10that number. If you're doing something
- 14:12like PWF and you wanted your period to
- 14:15be 55 you have a lot more choices for
- 14:19you to recycle
- 14:21whereas on the right hand side there
- 14:23it's very coarse like you know one step
- 14:26you value
- 14:28>> and what they what did they give you why
- 14:29why would they give you coarseness isn't
- 14:31seems like coarseness is always bad so
- 14:33what do you get out of this side of the
- 14:34of the chart
- 14:38>> well on the right hand side you can just
- 14:40count for much longer period of time
- 14:43there is like you want to count for 21
- 14:46seconds and you're going to have to
- 14:47expect that your step size is you know
- 14:50fairly
- 14:52small.
- 14:54>> Yep.
- 14:55And so kind of to that to your point
- 14:58about how long you can go the pre-scaler
- 15:00here is assuming this is all assuming
- 15:02that you have a a 100 mehz clock. Your
- 15:04input clock can be something different.
- 15:06Um but here the pre-scaler is telling
- 15:08you what's the longest thing you can
- 15:10measure. Right? This is before you
- 15:12overflow.
- 15:14So you want to choose a it doesn't
- 15:16matter what the period register is. You
- 15:18just cannot count longer than this.
- 15:20That's what that that's what that's
- 15:21saying, right?
- 15:25And then to the resolution question here
- 15:27underneath here, you get this is the
- 15:29resolution for each one of those period
- 15:31or each one of those pre-scaler values.
- 15:33This tells you what the resolution is
- 15:35for that input frequency. Um so here I
- 15:38can measure something. This entire row
- 15:40allows me to have the minimum step size
- 15:42of 1.8 8 microsconds. So that's the
- 15:44smallest interval of time I could
- 15:46measure. And so as I go this way, I can
- 15:49certainly go longer, but I get coarser
- 15:51just to that point.
- 15:55Everybody good with this?
- 15:58Okay.
- 16:01Um,
- 16:05okay.
- 16:07Um, so it's not, you know, I think it's
- 16:09just trying to understand that there is
- 16:10this trade-off. That's the big thing I
- 16:11want you to take away from this. Um,
- 16:14maybe I'll ask this. If you wanted to go
- 16:16longer than 21 seconds on your device,
- 16:19how would you do it?
- 16:21Right? Take 60 seconds and figure out
- 16:23some strategies for counting things that
- 16:25are longer than 21 seconds.
- 17:01>> [clears throat]
- 17:04>> I
- 17:14>> [clears throat]
- 17:30>> What do you think? How can we go longer
- 17:32than 21 seconds? Or is that the best we
- 17:34could do for our hardware?
- 17:39>> Oh, you got to speak loud.
- 17:45>> Yeah. Yeah.
- 17:57>> Yep. So, that is um that's the idea of a
- 17:59virtual counter. We used to teach this
- 18:01because it was a bigger part of 473, but
- 18:03now they've changed the curriculum and
- 18:05that's fine. So this idea of a virtual
- 18:07counter is that you could have in
- 18:08software the thing that's taking the
- 18:10interrupts and uh keeping track of time
- 18:13and you could set things like hey uh
- 18:16wake me up at this particular or at this
- 18:18particular time I have a value that I
- 18:20want you to go off and it keeps counting
- 18:21up to that uh time. What is what could
- 18:24be one challenge of having uh
- 18:26timekeeping in a uh IRQ or uh or in
- 18:32software?
- 18:34>> Sure.
- 18:43>> Well, what's the if I'm trying to let's
- 18:45say I'm trying to do something very
- 18:46precise, what's the problem with going
- 18:49uh doing everything with an uh
- 18:51interrupt?
- 18:58starts.
- 19:01>> Yeah. So we uh so there's some amount of
- 19:03time to get in and out of a interrupt.
- 19:06Uh and then but remember we already
- 19:08found out the interrupts aren't
- 19:09deterministic, right? You could be
- 19:10interrupted by something else. And so
- 19:12now you don't want to probably be down
- 19:14on the nanconds of timing trying to keep
- 19:17that level of time and not have that
- 19:20have the ambiguity of when did you
- 19:23actually update your virtual timer. So
- 19:26uh those sorts of timing events usually
- 19:28are longer human scale things. That's
- 19:30one way to think about it. Maybe 100
- 19:32milliseconds or so. Um or much longer
- 19:35than that. But like hours are usually
- 19:37minutes are usually what I would think
- 19:38about for a virtual timer. Any other
- 19:40ways people came up with for extending
- 19:43your time?
- 19:51>> You could use a wire wider counter.
- 19:52That's absolutely true. Um, it just so
- 19:56happens that your particular hardware
- 19:57has a trick we'll talk a little bit
- 19:59about later, but it will allow you to
- 20:01concatenate timers together in kind of a
- 20:03coarse way, but at least you can make
- 20:05effectively a 64-bit timer which would
- 20:07allow you to count things that are
- 20:08longer period of time. Um, but it's not
- 20:12uh yeah, we'll we'll see how that works
- 20:14uh when we get there. But um there are
- 20:16ways to concatenate things together, but
- 20:18usually you don't have much flexibility
- 20:19on your piece of hardware. It's whatever
- 20:20timer size you get.
- 20:23>> Okay.
- 20:24So, we'll go on to compare timers. Uh,
- 20:27so we talked about capture. Capture,
- 20:28we'll step back for a second. Capture
- 20:30was just the idea that some external
- 20:32event is going to cause the timer to
- 20:34start and then when another external
- 20:35event occurs, you're going to lock in
- 20:37the value of the time that's passed. So,
- 20:39that's typically uh a capture timer is
- 20:42like a stopwatch. That's how I think
- 20:44about it. Um, the compare timer, it's
- 20:46not that capture timers aren't used.
- 20:49It's just that uh especially for lab and
- 20:51a lot of things we do in the beginning
- 20:52of embedded systems uh the compare timer
- 20:55is the one you want to use because it's
- 20:57there to generate PWM waveforms or just
- 21:00to generate signals rather than measure
- 21:02signals external to the device. And so
- 21:04how this works is uh you have that same
- 21:07structure we saw above with the addition
- 21:09of a compare register. You're going to
- 21:11put a value in there and then when your
- 21:13counter hits that value, you're going to
- 21:15get an event occurs. And that event
- 21:17could be something that goes to uh
- 21:19interrupt. It could go to other logic on
- 21:22your device. You have PWM control logic
- 21:24that will cause uh signals to go high
- 21:26and low on certain modes and intervals.
- 21:29So this you just think about all that's
- 21:31happening is you're counting up with
- 21:32your timer until some value is hit and
- 21:35then an event is going to occur.
- 21:38And so how that manifests itself, we're
- 21:40back to the same thing. you have we're
- 21:42in the C compare register up there and
- 21:44then we have some value and we're just
- 21:46waiting to see when we hit that value.
- 21:48So here uh when it was uh you got to
- 21:52your period you overflowed and that
- 21:54caused the value to go low and then you
- 21:56went along you started counting up
- 21:57counting coming up and when your your um
- 22:00compare register value hit your counter
- 22:02value then the signal went high and the
- 22:04polarity of the signal going high or low
- 22:06really depends more on how you set up
- 22:08your module. That's not what's
- 22:10important. It's more important this that
- 22:11you have this other method of keeping
- 22:13track of this uh time. So now you can
- 22:16have your period can be independent of
- 22:18this other compare register that's
- 22:20happening. And this allows you to make
- 22:22uh pulse wave waveforms. And so if you
- 22:25reduce that time, the animation kind of
- 22:28sucks, but you can you can see here that
- 22:30you've changed the pulse width. And so
- 22:32now you're up for a longer period of
- 22:33time. The pulse width is larger. You
- 22:35could say the duty cycle is higher than
- 22:37it was when we were here. And all that
- 22:40what you really change is you just
- 22:42change some value in your CCR register
- 22:44or CR register. And so that's a way that
- 22:47from you kind of set your timer up and
- 22:49then you're just changing this one value
- 22:51to change like the dimness of your LEDs,
- 22:53the location of a servo or uh whatever
- 22:56other peripheral you have.
- 23:00Any questions?
- 23:04So you guys have questions for each
- 23:05other. I can half hear what you're
- 23:07saying and you're like, I don't
- 23:08understand anything. What does that
- 23:09mean? But then we don't have any
- 23:10questions for me.
- 23:16>> Yeah.
- 23:21>> Uh yeah. Yeah, you could say that. You
- 23:24could say um
- 23:28>> uh you can say more like it causes an
- 23:30event to occur and then the the bottom
- 23:33line is interpretation of that event.
- 23:35And so for this example, it would be
- 23:37greater than that. That's a fine
- 23:38example. But on your labs and in your uh
- 23:41sheets or your your device, you can say
- 23:44whether you want it to be greater than
- 23:45or less than.
- 23:52Okay.
- 23:56Uh and so uh let's see the example here
- 23:59is that now you will from embed systems
- 24:02point of view, you're able to control a
- 24:03waveform like this. You're setting the
- 24:05duty cycle. Duty cycle from 1 to 100 is
- 24:08just kind of arbitrary ways so that we
- 24:10can talk about different devices or
- 24:12different waveforms without worrying
- 24:14about how many micros secondsonds it's
- 24:15high or low. But here it's just showing
- 24:19that you can control this signal. And
- 24:21that's really important because remember
- 24:22microcontrollers are only good at
- 24:24measuring time. That's a you know not
- 24:26good at analog voltages. They're not
- 24:28good at current. They're not good at you
- 24:30know pressure or temperature. They're
- 24:32really good at measuring time. And so
- 24:34here you can control other devices or uh
- 24:37and you'll see in your one of the labs
- 24:39you're going to look at uh distance
- 24:41measurement. You can actually measure
- 24:42the pulse width to understand uh a
- 24:45distance measurement. So that's the goal
- 24:46is to to be able to generate these kind
- 24:48of waveforms. And what you'll see in lab
- 24:50this week is you will use a servo which
- 24:53we talked about earlier just to control
- 24:55its angle by encoding this pulse width
- 24:58that will go through. And you might say
- 25:00that's insane. Why not just use a
- 25:01digital port or something? Well, the
- 25:03digital port would need multiple wires
- 25:05to encode the digital information. This
- 25:07just makes it simple as a simple
- 25:08structure to control. Uh same with many
- 25:12motors. Uh DC motors um are easy to
- 25:15control with pulsewidth modulation. Uh
- 25:17making it it would be harder to do it
- 25:19with another method. All right. So any
- 25:22questions about timers in general?
- 25:33Okay. All right. So, we'll go through
- 25:36actually we'll save the example to the
- 25:38end, but we'll just kind of go through
- 25:40um some of the features uh maybe
- 25:43different features of the device that
- 25:45you're using. So, uh I partly wanted to
- 25:49show this off just so that you could
- 25:50understand the nomenclature because I
- 25:52found it a little confusing when I
- 25:53started off. So on your device you have
- 25:56the uh capture and compare units. You
- 25:58have capture compare unit 4. You have
- 26:00capture compare unit 8. Uh the CC4 CC4U
- 26:04or CCU4 is the primary one. The eight is
- 26:08really good for industrial automation.
- 26:11You might use it in your projects but
- 26:13probably not that important for the lab
- 26:15section. And how it's constructed is
- 26:17that there are four. So the nomenclature
- 26:21here is there have four modules in
- 26:22there. So uh CCU 441
- 26:2642 43 and so that is this whole thing is
- 26:29one module and then there's four of them
- 26:30there and so each of those modules has
- 26:34four timers. So overall you have uh 32
- 26:38timers
- 26:41and then so they call this thing here a
- 26:43slice
- 26:45and that slice is here and that in
- 26:47itself has four timers
- 26:51and uh now they gave you some more
- 26:53confusing nomenclature which each one is
- 26:55denoted CC4 and then y being the uh the
- 27:01uh slice. So that would be the uh one
- 27:04two three four up here and then the one
- 27:08zero one oh I missed that one. So be 0 1
- 27:102 3 is the instance on that particular
- 27:13slice. And so each slice has a 16- bit
- 27:16timer which is here. And that timer has
- 27:20uh or the whole module here sorry the
- 27:21module has uh four possible IRQs
- 27:25um has different logical units on it uh
- 27:28along or sorry four captures only one
- 27:31compare. So in here you can have uh four
- 27:34capture registers, one compare register
- 27:36and then each one can create an
- 27:37interrupt
- 27:39which is essentially what I wrote here.
- 27:41So 16- bit timer. Uh then the the trick
- 27:44here is that there's output logic as
- 27:45well. And so once you've created that
- 27:48event, then you get to decide if you
- 27:50want that event to be positive or
- 27:52negative. So that's essentially the
- 27:53logical greater than or equal to or or
- 27:56less than. Uh that can be routed to an
- 27:58external or internal device. it can be
- 28:01routed to um uh the core. So there's all
- 28:06this different compare logic and one of
- 28:08those output logics is the PWM generator
- 28:10which will set those pins high or low
- 28:13and then basically send it out to a GPO
- 28:15pin through the alternate function. So I
- 28:17think I might have said that a little
- 28:18bit backwards, but basically there's a
- 28:20unit. The unit has a module for modules.
- 28:24So units is the whole thing. This is a
- 28:27module here. There's another module
- 28:28behind it. module behind it, module
- 28:30behind it. And then on a module there's
- 28:32a slice. So this is a module. This is a
- 28:34slice and this is the example of that
- 28:36slice.
- 28:41Okay. The other trick for your
- 28:43particular devices
- 28:46is uh shadow registers. And so the goal
- 28:49here is that um they are concerned that
- 28:53if you updated a register
- 28:56out of sync that you would screw up your
- 28:59pulse width modulation. So imagine your
- 29:01core is doing whatever it's doing. It's
- 29:04you know wakes up in a super loop uh
- 29:06gets to a section of code where it's
- 29:08been told to update a um pulse with
- 29:11modulation value. Now the challenge here
- 29:14is if you just go right to that register
- 29:16you might change the the width of the
- 29:18pulse. You might do that in a really bad
- 29:20way. So if we go here
- 29:23uh so you might say if you go here to
- 29:27change like at this point in time if you
- 29:29go and change the pulse width you might
- 29:30come up with a very short pulse and that
- 29:32pulse could damage your electronics or
- 29:34be invalid in some way. And so to ensure
- 29:37that you're always uh aligning your
- 29:40updates at the correct time for that
- 29:42particular timer, they've added this
- 29:45idea of shadow registers.
- 29:48And so there's uh you only care about
- 29:50two shadow registers, but there are five
- 29:52shadow registers in general. And really,
- 29:54it's for the the period and the compare
- 29:57values. And so those shadow registers uh
- 30:01have a specific sequence to be updated.
- 30:03So you update the shadow register,
- 30:05sorry. And then there's a sequence for
- 30:06those shadow registers to take the
- 30:08values and put it into the actual update
- 30:11register. So you basically you load up
- 30:13your shadow registers, you send out a
- 30:15request that says on the next available
- 30:17uh interval then update those uh values
- 30:21such that it guarantees there's no
- 30:23pulses or or more weird uh events. And
- 30:27usually that would happen say on a
- 30:28period overflow or something. So now
- 30:30you're guaranteed that you're not
- 30:32messing up any of the values.
- 30:39What do we think? Does that sound like a
- 30:41good idea? Is that useful?
- 30:44You guys like talking to each other more
- 30:46than talking to me? So why don't you
- 30:47take 60 seconds and try to explain to
- 30:49your neighbor why in the world they
- 30:51would even need shadow registers or if
- 30:53this is even a problem.
- 31:36It seems
- 32:17All right. So, you had a chance to talk.
- 32:19What any questions arise or why anybody
- 32:22wonder why in the world we actually need
- 32:24these things?
- 32:29>> Yeah,
- 32:30>> I have questions.
- 32:31>> Yeah.
- 32:39Yeah,
- 32:46>> I'm sorry. Say that again.
- 33:00>> Ah.
- 33:04It's a fair question. So, it's not about
- 33:06being on the clock edge. It's being it's
- 33:09about being on the pulsewidth modulation
- 33:11edge,
- 33:13right? So, you're in the pulse with
- 33:15modulation. You don't want to
- 33:18uh let's see, go up here.
- 33:30So I can draw. So you don't want to say
- 33:33for instance change here,
- 33:36right? You say you change right here and
- 33:38now that could still be on the clock
- 33:40edge, perfectly on the clock edge, no
- 33:41problems, right? But that might cause
- 33:43this pulse to become very short and what
- 33:46you really meant to have happen is it
- 33:48just to
- 33:50uh I don't know like be here or
- 33:52something, right? So like that little
- 33:53glitch can occur. Does that make sense?
- 33:57Um maybe that's not the perfect example.
- 33:59Let me see if I can find a better think
- 34:00of a better example here.
- 34:05Maybe it would be more more of an
- 34:06example of a long pulse. So, say it was
- 34:09short.
- 34:10Um, say it did come down here and then
- 34:15you wanted to change it and you changed
- 34:17it over here.
- 34:20And so now what would happen if you
- 34:22change it to to rise up here, then it
- 34:23would come down and rise again up and
- 34:26then down. And now you have two pulses
- 34:28within that pulse period of time because
- 34:30you changed uh your uh boy that's really
- 34:33bad drawing but you uh changed your um
- 34:37CCR or compare register to push it back
- 34:40in time but now it's done two pulses.
- 34:43And so that's the sort of thing that
- 34:44they're trying to avoid. It's not about
- 34:46the clock edges, it's about the period.
- 34:51Any other questions? That's a good
- 34:53question.
- 34:56Yeah.
- 35:04>> 200, but then like a period gets
- 35:06changed.
- 35:08Where does the counter go?
- 35:10>> The counter is still going to keep
- 35:11going.
- 35:14>> No, the period is all it's saying is
- 35:16like are these values equal? So, so it
- 35:20you bring up a good point. So, say it
- 35:22was 200, right? And then you change it
- 35:25to 50, but the counter was in between
- 35:28those two values, then it's going to go
- 35:30in overflow. It's going to wait all that
- 35:31time to come back.
- 35:33>> Yeah. It just takes longer. Um, it just
- 35:36may not be the right thing. It may be an
- 35:37error function, right? That your motor
- 35:39is not designed to take that signal.
- 35:41>> So, it would allow that workflow.
- 35:44>> This would wait until the period had
- 35:47naturally changed and then it would
- 35:49clock it in. So there would be no period
- 35:52that was too short or too long.
- 35:57>> Yeah. Yeah.
- 36:08>> Yeah. I don't know exactly like you we
- 36:11can read the manual to see exactly all
- 36:13the conditions that can that cause the
- 36:15actual update to occur. One of them can
- 36:17be period if that's what you set in the
- 36:19control registers. Um but basically it's
- 36:21you set this global command you first
- 36:23you write in yourself and you write the
- 36:24this global command update on the next
- 36:26possible cycle or valid point.
- 36:30>> Yeah the rising edge
- 36:33>> uh you get to decide. I think you can
- 36:35look through the documentation and
- 36:37there's different conditions that you
- 36:38can set.
- 36:43I think it's the period is really the
- 36:45it's it depends how you have your pulse
- 36:47with set up if it's positive or negative
- 36:49right because you could design the same
- 36:51period or PWM and just invert the output
- 36:53and then you have you know it doesn't
- 36:55matter if it's rising or falling but
- 36:57it's really when the period resets
- 36:59that's the uh or gets loaded back into
- 37:01the counter that's the time when they're
- 37:02going to reset or sorry swap from the
- 37:04shadow registers to the uh actual
- 37:07registers
- 37:10okay maybe we'll get to that example
- 37:13Um,
- 37:17okay.
- 37:18So, now we'll move on to the cystic. So,
- 37:21ARM has
- 37:23uh defined that every microcontroller
- 37:26must come with a clock with a timer and
- 37:29they give you a 24-bit timer. So, this
- 37:32is just like how ARM says everything's
- 37:34got to have of a Envvic. Everything's
- 37:37got to have a basic bus structure so
- 37:39that you can get data from memory to um
- 37:42your core. And you know, ARM also lays
- 37:45out all the different uh memory regions.
- 37:48So they also say you have to have a
- 37:49basic 24-bit timer. Why would But
- 37:52interestingly, ARM does not say that you
- 37:54need to have a debugger.
- 37:57That's an optional function that ARM
- 37:59says you do not have to have debug and
- 38:00trace on your chip. But why maybe a
- 38:03question for you is why would the manu
- 38:05or arm as the company that sells the IP
- 38:08that some other company integrates into
- 38:11their circuit why would they care if
- 38:12there's a timer for uh as part of the
- 38:15mandatory part of their spec. So, take
- 38:1660 seconds. Uh, come up with an answer.
- 38:29[clears throat]
- 38:42>> [clears throat]
- 39:01>> Why do we think why would ARM mandate
- 39:04that there's a timer?
- 39:06And why is this timer treated
- 39:08differently than your peripheral timers
- 39:10that the man uh device manufacturers
- 39:12actually implement?
- 39:19>> Yeah.
- 39:24>> Oo. Okay. So, that's a good one. Part of
- 39:27uh what's built into ARM, which I didn't
- 39:29really preface here, is this idea of a
- 39:30watchdog timer. So a watchdog timer
- 39:33basically uh you usually have to disable
- 39:36it. Uh that might be part of just how
- 39:37lab the files that you do for a lab, but
- 39:40typically there's a watchdog timer that
- 39:42says if you don't write a value to this
- 39:43register or this memory address, then
- 39:45the device will reset, right? It'll just
- 39:48go through a power on reset. Why would
- 39:50you want that?
- 39:56>> Yeah, exactly. So what you find
- 39:58especially for like automotive and
- 39:59industrial applications is it's not just
- 40:01one or two people writing code. It is a
- 40:04team. It's a relatively complicated
- 40:06system. It might have even have like a
- 40:08real-time operating system. And there's
- 40:10always these little tricks or issues
- 40:12that can arise. Unexpected condition can
- 40:14get you to uh stall out, get stuck in a
- 40:17while loop or something. And so the
- 40:19watchdog timer is just a way to ensure
- 40:22that hey every I don't know 100
- 40:24milliseconds whatever you set it to you
- 40:25need to write to this memory location
- 40:27and just write a one or a zero and if
- 40:30you do that then it resets the watchdog
- 40:32timer which is a piece of hardware and
- 40:33this says uh hey if that doesn't happen
- 40:36I probably got hung some bad thing
- 40:38happened and it'll just force the device
- 40:39to reboot. So that's why you have a
- 40:40watchdog timer. Um that was a good
- 40:43example whoever came up with that one.
- 40:45any other reasons why they would want
- 40:46this?
- 40:48>> Yeah.
- 41:08>> So, I I think there's this idea of maybe
- 41:10I'm extending a little bit, but the
- 41:11interoperability, right? You have one
- 41:13device and then you want it to kind of
- 41:14operate the same as this other device.
- 41:16So, we need to have a timer that is
- 41:18flexible to that clock speed. Is that
- 41:19what you're kind of thinking?
- 41:27>> Well, that's actually Oh, that's also a
- 41:29slightly different idea. That's a good
- 41:30idea. So now you're saying this one
- 41:32since it's built into the core, its
- 41:35timer is based on the core function, it
- 41:36doesn't even need a pre-scale, all those
- 41:38other things and it's not over, you
- 41:40know, far away as a peripheral over the
- 41:42advanced peripheral bus and high
- 41:44performance bus, right? It's really
- 41:45close. Okay, so it's a it's a timer that
- 41:49for the core itself, for the processor.
- 41:51That's true. Anything else? Any other
- 41:53ideas why ARM wants this?
- 42:02>> Yeah.
- 42:10>> Yeah. So what you often that's that I
- 42:12think you guys have all figured out all
- 42:13the reasons. I even forgot about
- 42:15watchdog timer. So but it's really about
- 42:17this interoperability. So ARM's thinking
- 42:19this not as a when you guys are
- 42:22programming typically you're at the
- 42:23lowest level you're like can I get
- 42:25anything to work can I get this
- 42:26peripheral to turn on right and then
- 42:29send data back and forth and then
- 42:30usually a step above that is you're
- 42:32going to run uh you know some sort of
- 42:34real-time operating system or something
- 42:36and that's really where ARM's thinking
- 42:38they want they want devices that are
- 42:40interoperable that uh one program can
- 42:42work on and and you can hand it off to
- 42:44or sorry one a program work on one
- 42:46device and you can transfer it to
- 42:47another device. And so the goal of cycic
- 42:50is to be the processor uh or the timer
- 42:53for the core while the peripherals has
- 42:55timers for specific functions uh that
- 42:58are like related to things outside the
- 43:00chip. Uh and that kind of gets to the
- 43:02par programming paradigm. So most of
- 43:04what you guys have done in lab and I
- 43:06think almost every one of your projects
- 43:07is going to be this idea of a super
- 43:09loop. And a super loop is simply just a
- 43:12loop that comes in. You have some setup
- 43:14code, right? You're going to initialize
- 43:16a bunch of stuff and then you're going
- 43:17to go into this looping structure. And I
- 43:19never heard the word the phrase super
- 43:22loop until I came here. We always used
- 43:24to call it a while one. Basically, you
- 43:26go into a loop that keeps spinning and
- 43:28you've just defined it to be a while
- 43:30with a boolean one. Um, and so you're
- 43:33just going to go around and you have
- 43:34different tasks. One of the tasks could
- 43:35be measure the temperature sensor,
- 43:37update the screen, look for buttons, and
- 43:39you're just going to go through that.
- 43:40And that works really well if your tasks
- 43:43are generally short and they're
- 43:45deterministic. So if they take a really
- 43:48long time or could be blocking then uh
- 43:50that would be a problem. Uh so just on
- 43:53your own projects you want to keep those
- 43:55relatively relatively short um and
- 43:59deterministic. You don't want them
- 44:01fluctuating a lot in time. And then the
- 44:04way you get some some flexibilities you
- 44:07have already learned about interrupts.
- 44:08So now you can use your uh interrupt sub
- 44:10routines and typically those will
- 44:12interrupt of course your tasks but
- 44:14you're not doing a lot of work in there.
- 44:16Typically what you'll do is you'll have
- 44:17an interrupt interrupt will go off and
- 44:18maybe it's something simple like um it
- 44:21doesn't involve the main loop where
- 44:22you're saying take data from one
- 44:24location and put it somewhere else. So
- 44:26your ADC goes off saying that the
- 44:28conversion is done and then you just
- 44:30push it in memory and that's a short
- 44:32thing. It can all live in there. But
- 44:33sometimes you'll have events like hey my
- 44:36um I squared C my communication bus is
- 44:39full and then you just set a flag and
- 44:42then when you're going through your task
- 44:43you'll say okay task two was to check my
- 44:46I squared C bus and then you'll pull the
- 44:48data out of that register. So uh that is
- 44:50one way and probably most the way that
- 44:52you guys will use your programs uh your
- 44:55projects. The the alternate way is what
- 44:57they call a real-time operating system.
- 44:59Um this is mostly what you'll learn in
- 45:03uh 473 and this is where cycic is really
- 45:05important. So a cystic is this timer
- 45:07that the real-time operating system can
- 45:09do and it's really just a scheduleuler
- 45:11you have set up and then each task is
- 45:12effectively its own super loop and it
- 45:15goes through each one and then the the
- 45:16timer uh or the the controller here is
- 45:19selecting which of these uh tasks has
- 45:21the highest priority. That's kind of
- 45:23like your interrupts uh that you set up.
- 45:25So here a task will have different
- 45:26priorities and then they'll get a queue
- 45:28and then it'll go through and allocate
- 45:29time for each one of those to complete
- 45:32its task. Um again it's beyond what
- 45:34we're trying to do here but uh just good
- 45:36to know that this is u kind of the next
- 45:39step beyond this class is real-time
- 45:41operating systems and that's why mostly
- 45:43you have a timer.
- 45:45Um another useful thing uh
- 45:49yeah so another useful idea here is that
- 45:52uh you can use it to measure the passage
- 45:54of time but I think in your own uh
- 45:56projects uh using the timer is a great
- 45:58way to provide structure to your code.
- 46:00So now you can say run your while loop
- 46:02every 50 milliseconds or something and
- 46:04now you're guaranteed that this thing
- 46:06will run on a deterministic time frame.
- 46:08That's very nice compared to say uh just
- 46:11run whenever you get down to the bottom
- 46:13of the loop and now you could have tasks
- 46:15that don't occur and then you you maybe
- 46:17have varying amounts of uh sensor data
- 46:20or some other event you assumed you're
- 46:21going to have a buffer full but because
- 46:23other tasks ended early you don't or
- 46:26maybe task go really long time. So uh
- 46:28having some set time structure for how
- 46:31often your loop goes is a a valuable uh
- 46:34modality.
- 46:37So here you have uh this is just your uh
- 46:40ARM core processor architecture here and
- 46:43ARM built into their idees just says you
- 46:45have this C function that must exist in
- 46:48all the compilers and all the workflows
- 46:50that you have a uh C function that'll
- 46:52give you back this time and you can set
- 46:54delays and those other things. So how it
- 46:57oops so how it generally works there's a
- 46:5924-bit dime counter with a with a
- 47:01reload. You can set that reload value
- 47:04and just like all your other ones, uh it
- 47:06will count away. Basically, have you hit
- 47:08this? Yes or no? There's no pre-scaler.
- 47:10It Oh, there's a divide by 8 pre-scaler
- 47:12on some of them. Uh this always
- 47:14countdown. Uh and then it reloads and
- 47:16then some interrupt or some cy tick can
- 47:18go off. Uh and then it defines a bunch
- 47:22of predefined values that you can uh oh
- 47:25wait, did I miss one? Uh no. Uh so the
- 47:28cyic register structure very basic. You
- 47:31can uh set a count flag. You can set
- 47:32your cystic flags. You get some control
- 47:34bits to enable to define your clock
- 47:37source whether you're dividing by eight
- 47:38or not. That is all you get out of this,
- 47:41but you don't really need a lot more for
- 47:44most basic functions. There are two
- 47:46special little a few special little
- 47:48features here. Uh you have your reload
- 47:50value, you have your current value, and
- 47:53then you have your calibration value.
- 47:54And this is where they're trying to get
- 47:56they're trying to calibrate between
- 47:58different processor types so that a
- 48:01program runs and a programmer is trying
- 48:03to say I always want a certain delay
- 48:05that there's some way to guarantee that
- 48:07this delay is constant because some
- 48:09device could be running at a faster
- 48:11clock speed. Um and it could just be
- 48:13that the manufacturer has
- 48:16um chosen say you know 96 MHz as the
- 48:20clock speed or another one is 144 MHz
- 48:23and they wanted some way to allow some
- 48:25uniformity between them and so the
- 48:27calibration uh timer here provides the
- 48:31uh value that will give you uh a known
- 48:34delay offset and usually it's like 50
- 48:36milliseconds or 100 milliseconds. You
- 48:37can read through the documentation. So
- 48:39that's the value in there that will
- 48:41cause uh that known delay to occur.
- 48:46Um yes. Okay.
- 48:53Yeah. Anyway, so you can read through
- 48:55the I mean that's just a re uh
- 48:56discussion of what we already talked
- 48:58about. And so that is about all I want
- 49:00to talk about with timers. We can either
- 49:02go through example of just thinking
- 49:04through how to set up pulsewidth
- 49:06modulation and um
- 49:10uh period values or we can move on to
- 49:13serial. What would you guys prefer?
- 49:16>> Yeah.
- 49:17>> You want example? Example. Okay.
- 49:22Let's do it.
- 49:25Okay. So, let's say Oh, no builds. Cool.
- 49:29No. All builds. No builds. All right.
- 49:32So, you have half the answers here, but
- 49:33let's just go through an example. Say we
- 49:35have some laser driver that you want to
- 49:37have. You're given a clock driver at 100
- 49:41uh megahertz, and you want the you want
- 49:44a pulse to come out every 200 hertz. So,
- 49:46fairly pulse, fairly slow pulse. And
- 49:49here you have uh a pulse width you're
- 49:52trying to uh hit. So, you're trying to
- 49:54say uh you want it to be between 100 and
- 49:57100 or and 10 microsconds. So I often
- 50:00think is I first thing I usually do is
- 50:02just try and think through what is the
- 50:04shape I'm trying to get. So this to me
- 50:06would be I'm trying to get a shape that
- 50:08looks like this, right? It's fairly long
- 50:11over here. And then I have to I can do
- 50:14this.
- 50:17And so the the shape I'm trying to make
- 50:19is I'm trying to get 100 here or
- 50:21actually is that no 10 microsconds pulse
- 50:23width high here.
- 50:26micro seconds and then the longest one
- 50:30would be from here to here. I guess that
- 50:32would be here.
- 50:34And I'm trying to get 100 microcond. So
- 50:37clearly not to scale. So that's my goal.
- 50:40I'm trying to make a pulse twist that's
- 50:42uh short or a little bit longer. And
- 50:44then uh way over here in time, I need
- 50:47this pulse to come back up high. Does
- 50:49that make sense? And so when they say
- 50:51the pulse rate is 100 hertz that means
- 50:53or 200 hertz that means from here to
- 50:56here is one over 200
- 51:01hertz.
- 51:04What? Yeah.
- 51:07Oh my god, it's horrible. All right. And
- 51:09then you get a 10 uh or 16 bit timer.
- 51:12And then the other piece of information
- 51:14here is they want the resolution.
- 51:15Meaning the minimum step size you could
- 51:18go between when you're going between 10
- 51:21microsconds and 100 microsconds. The
- 51:23minimum step size needs to be 10 nonds.
- 51:26So why don't you talk amongst yourselves
- 51:28for a second and see if if you have any
- 51:30questions about the setup of this
- 51:31problem and the setup of that waveform
- 51:33of what you're trying to um make.
- 51:48Yep.
- 51:58>> Hold on one second. Let everybody can
- 52:00talk talk amongst themselves for a
- 52:02second. Then we can ask questions.
- 52:14All right. So, you had a chance to talk.
- 52:16What's your question?
- 52:19>> Yeah.
- 52:20I was wondering whether or not
- 52:26>> the the the design spec is you need to
- 52:29make a pulse that's between so uh yeah
- 52:31it's anywhere between 10 microsconds
- 52:33long and 100 microsconds long and you
- 52:35need to have resolution. So you're
- 52:36shooting this laser out and you need
- 52:38control over it to control between
- 52:40there. It's not that you can choose any
- 52:42value. It's that you need to be able to
- 52:43control it between those two boundaries
- 52:46within these number of steps.
- 52:51Is that was that your question as well?
- 52:53Okay. Any other questions about the
- 52:54setup?
- 52:58>> All right. So, yeah.
- 53:06>> So, I'm saying so I said the first step
- 53:08was going to go through choose a
- 53:09pre-scaler. So, these were supposed to
- 53:10be builds and I was going to ask you and
- 53:12then you already saw them. It said it's
- 53:13the matter. But, uh, so let's say we're
- 53:15going to choose a pre-scaler. So,
- 53:16there's two problems with a prescaler. I
- 53:18got to be able to choose a pre-scale. If
- 53:20we go all the way back here,
- 53:23right? If I go back to this trade-off, I
- 53:25need to be count able to count long
- 53:27enough in time to get to my period
- 53:29because this laser can only shoot two uh
- 53:31one over 200 hertz, right? That's the
- 53:34longest period of time it can go for.
- 53:37But I also have to hit a particular
- 53:38resolution that you need to hit, right?
- 53:41I got to hit both of these things. So
- 53:42there's not it could be that there are
- 53:44lots of solutions, but I'm going to say
- 53:45that there's only a few solutions that
- 53:47could probably work. And I think there's
- 53:48only one solution that can possibly work
- 53:49for this problem.
- 53:52All right. So, how would we figure that
- 53:53out? Come back.
- 53:57So, I'm saying the first we can go
- 54:00figure out the period that we're want to
- 54:01get. So, one over 200 is 5 milliseconds.
- 54:04Okay. And I need to be able to uh count
- 54:08up. So, in 5 milliseconds, I need to
- 54:11have this many steps. So, I have 5
- 54:12milliseconds and I I have to at least
- 54:14So, why did I choose that number? So
- 54:15that's 2 to the 16, right? So like if I
- 54:18have uh that's my period I'm trying to
- 54:21get and this is the number of steps.
- 54:22This would have to be the minimum size
- 54:25of the tick that's necessary, right? So
- 54:27if I have a tick that's uh shorter than
- 54:30that, no, if I have a tick that is,
- 54:32let's see, if I have a tick that is
- 54:35shorter, if I have a tick that's longer,
- 54:37then I can't meet my period of time,
- 54:39right? Okay. And so now we're saying,
- 54:42okay, this is about where I would have
- 54:44to be. And then I can go over and say
- 54:46okay now I have a resolution that's the
- 54:48other axis here have a resolution
- 54:49problem I need to get around um uh 10 I
- 54:54have to be less than 10 nonds so here we
- 54:57can go look at some values I got so the
- 54:59the clock coming in uh is that many
- 55:03nanconds that's the step size and then
- 55:05I'm going to say here's the resolution
- 55:07and I can choose my pre-scaler here so I
- 55:09have 10 nconds times time 8 equals 80
- 55:12nconds so that's the the smallest If I
- 55:14use a pre-scaler that's effectively
- 55:16eight, then that's the smallest period
- 55:19of time I can measure. That's okay. But
- 55:22here it would be too long. So if I do
- 55:24the next double over, it would be too
- 55:25long. Does that make sense?
- 55:32Yes.
- 55:34Do you want to talk to each other?
- 55:39I think you need to talk to each other.
- 55:40Explain figure out what's wrong with
- 55:42this and then come and ask questions.
- 55:47Convince yourself either this is right
- 55:48or wrong and then ask me a question.
- 55:50Talk to your neighbor.
- 56:34We should get a visit. All
- 56:46>> [clears throat]
- 56:57>> right. What do we think?
- 57:00What questions do you have?
- 57:09No questions. 100% makes sense. Okay.
- 57:13>> Yeah.
- 57:24Well, it's more like I h if I'm any
- 57:26smaller than that, if my my sorry, I
- 57:29should maybe that was confusing. If it's
- 57:30smaller than that, then I'll never get
- 57:32to that period, right? So, if this
- 57:34number was really really small, then I
- 57:37can't count long enough possibly. So,
- 57:40it's got to be at least this big,
- 57:43right? And then over here, we're saying,
- 57:44well, okay, uh, I just choose chose two
- 57:47values. I could we could have exhaustly
- 57:49gone through each value. that that would
- 57:50have been fine. But I said, "Okay, well
- 57:53eight works, but like what if I doubled
- 57:55again? I could get to 16, right? Uh but
- 57:58that's too long. That doesn't hit my
- 58:00resolution requirement." So maybe we can
- 58:02go look at maybe it's on the table.
- 58:05Let's see.
- 58:08Uh so here um what's the longest at 8
- 58:13nano 80 nonds? What's the longest period
- 58:15of time that I can measure with a
- 58:18pre-scaler of it just happens to be 100
- 58:20megahertz the same. So pre-scaler of
- 58:24two. So two to four. Oh, I can't
- 58:26actually do math in my head. So I would
- 58:28need to have the three will get me to 5
- 58:31milliseconds. A little bit longer,
- 58:32right? And remember that's n or two to
- 58:35the n. So a pre-scaler value of three
- 58:38will get me to 5.2 two um nanconds be or
- 58:44milliseconds before I overflow, right?
- 58:47Because if I overflow then I'm done. So
- 58:49I can't do two. Two would be too short
- 58:50and four well four is okay. That will
- 58:54get me I'll definitely be able to count
- 58:55long enough but then I come back over
- 58:57here to four which is here. But now my
- 58:59resolution is too small. So really I've
- 59:02boxed you in. I made the problem so
- 59:04there's only one particular solution you
- 59:06were able to get. And this can be
- 59:07painful because you can go down a false
- 59:10alley if you're not kind of careful. So,
- 59:12of course, I did the problem beforehand.
- 59:13So, I can, you know, make sure
- 59:15everything works, but um you could start
- 59:19choosing a value that was like here and
- 59:21then you do all your math and then you
- 59:22figure out later on that you can't
- 59:24possibly have your uh counter count up
- 59:27to 5 milliseconds for the end of your
- 59:29period.
- 59:37All right. All right. So now we've we've
- 59:39figured out what our pre-scaler is.
- 59:42Right. Uh let's see. So next let's find
- 59:45the value that should go in our period
- 59:48period register. So here we're saying
- 59:50that the number of ticks that we have to
- 59:52do is 8 milliseconds over 80
- 59:55milliseconds or nanconds which is a
- 59:58value numerical value that 8 millisecond
- 1:00:02or sorry 5 milliseconds divided by 80
- 1:00:04turns into this value here. And so
- 1:00:06that's how long my counter has to count
- 1:00:09up. Um and we saw that before because
- 1:00:12the counter only goes to 5.2
- 1:00:13milliseconds at these settings. So it's
- 1:00:15very close to the top of the register.
- 1:00:17So at least that makes sense. And then
- 1:00:19we're going to trick you because uh your
- 1:00:21period registers uh has to be minus one.
- 1:00:24There's always that plus one because you
- 1:00:25you have to count zero. So there's the
- 1:00:28the value for the period register.
- 1:00:32How's that feel?
- 1:00:35So if we go back to do we have our
- 1:00:37ustrious No, our diagram got er Oh, no.
- 1:00:39Our diagram's still there. So now we
- 1:00:41figured out how long what the value is
- 1:00:44for for this thing for the pulse of the
- 1:00:45period or for the pulse of the laser to
- 1:00:47go again. So we know what that value is
- 1:00:49and now we're going to try and figure
- 1:00:50out and we know what the resolution is.
- 1:00:52Now we're going to try and figure out
- 1:00:53the values that would correspond to 10
- 1:00:55microsconds and 100 microsconds.
- 1:01:03All right. Oh, it says it says the wrong
- 1:01:06thing.
- 1:01:08Oh,
- 1:01:11so that should be here.
- 1:01:19Okay. And so that's a relatively
- 1:01:22straightforward calculation in the sense
- 1:01:23that we know what our pre-scaled clock
- 1:01:25is going to be. So the period of our
- 1:01:27pre-scale clock is 80 ns. We saw that
- 1:01:30before. And now we have to figure out
- 1:01:31our target time. Well, how many times
- 1:01:34does 10 microsconds get divided by go
- 1:01:36into or eight 80 nconds go into a 10
- 1:01:39microsconds? Well, it's 25. So, that's
- 1:01:42how many times uh is counted up until
- 1:01:45some event should occur. And that's when
- 1:01:47the beginning of that pulse should uh I
- 1:01:49guess if it's already on should fall uh
- 1:01:51stop when you're going to uh 10
- 1:01:53microsconds and then you can do the
- 1:01:55opposite one where if you wanted the
- 1:01:57pulse to go longer, right? And so I
- 1:02:00should have explained this. Uh you are
- 1:02:02have to set a certain pulse rate and
- 1:02:03then you get to change the width which
- 1:02:05is changing how much power goes to uh
- 1:02:08the the target and then maybe like the
- 1:02:10uh 200 uh uh hertz is really to make
- 1:02:14sure the machine doesn't overheat. So
- 1:02:16here you're saying at the other end this
- 1:02:19is the value the CCR has to go all the
- 1:02:21way up to that because two 100
- 1:02:23microsconds can be divided by 80 ns
- 1:02:261,250 times. And so those would be the
- 1:02:29two ranges and then uh you could scroll
- 1:02:33in between those with that uh 10 nancond
- 1:02:36or 100 ncond precision uh so that you or
- 1:02:40greater than 100 ncond precision so that
- 1:02:42you could provide little steps of power
- 1:02:43that were uh more fine.
- 1:02:47So any questions?
- 1:02:54You guys ready to do it in lab? No
- 1:02:55problem.
- 1:02:58homeworks like yes,
- 1:03:01no exams. You're saying no, we don't
- 1:03:03want exams anymore.
- 1:03:05Okay.
- 1:03:07Uh let's see.
- 1:03:12All right. Well, I think we Well, I'll
- 1:03:14start uh we'll take what a few second
- 1:03:16break. We started ended a little early.
- 1:03:18And I'll start um uh serial buses then.
- 1:03:23Okay.
- 1:03:51All right, we'll do we'll spend like
- 1:03:53five minutes doing a quick uh overview
- 1:03:55of serial buses just to get you primed
- 1:03:57for next week or Wednesday's lecture. Uh
- 1:04:00but we won't go in too deep. All right.
- 1:04:02So this entire
- 1:04:04uh next section is all about how do
- 1:04:07devices communicate with each other.
- 1:04:09This is off device. So this is your PCB.
- 1:04:11So you have your on your chip, right?
- 1:04:13You have uh the advanced peripheral bus.
- 1:04:16And that was all about how modules on
- 1:04:18your chip communicate. And this is how
- 1:04:20do modules off your device communicate?
- 1:04:23So uh from one chip to another one on a
- 1:04:26PCB. So we're going to talk about ways
- 1:04:28to think about serus architectures in
- 1:04:30general and then we'll talk about uh
- 1:04:32three specific architectures that are
- 1:04:34commonly used everywhere.
- 1:04:38All right.
- 1:04:40And so communication buses. So as
- 1:04:42described oh uh I guess I just gave this
- 1:04:45away but uh we're talking about
- 1:04:47devicetodevice communication. Uh so some
- 1:04:50of that includes trying to get off a
- 1:04:52device, but really here uh this is like
- 1:04:54a little microcontroller here and then
- 1:04:56they have this little chip that will
- 1:04:57talk USB and so this chip will help. And
- 1:05:00then these two talk through a protocol
- 1:05:02called UART. You also have these devices
- 1:05:04over here. Um that's a parallel bus,
- 1:05:07right? So they're talking to
- 1:05:09memory cards or video cards similarly.
- 1:05:12So when you're thinking about uh buses,
- 1:05:14we got to think about how's the wiring.
- 1:05:16Is it serial or parallel?
- 1:05:19What's the bus speed? Are we going fast
- 1:05:22or slow? Is it bytes, words, or words
- 1:05:24per second? We have terminologies like
- 1:05:26synchronous and asynchronous. And then
- 1:05:29um another big consideration, are we
- 1:05:31just talking to one other device? Are we
- 1:05:33talking to end devices? And if we're
- 1:05:34talking to end devices, who gets to
- 1:05:36control who talks first? Is it that uh
- 1:05:40there's only one master that's
- 1:05:41designating when other uh devices can
- 1:05:44talk like the advanced peripheral bridge
- 1:05:46or is it that there is decentralized and
- 1:05:48it's more of a mesh network even on
- 1:05:50device where multiple devices can choose
- 1:05:52when to talk and that's I guess that's
- 1:05:55really getting down to arbitration but
- 1:05:57the number of devices is really like is
- 1:05:59it just one to two or is it one to to n
- 1:06:02and then we get to the protocol level
- 1:06:05we're saying how is the data encoded
- 1:06:08Um so is the data you know the simplest
- 1:06:11one would be most significant bit least
- 1:06:13significant bit first which one is that
- 1:06:15but then there's uh extra protocol on
- 1:06:17top that that could be like is there a
- 1:06:19header is there uh CRC is there any uh
- 1:06:22ability for redundancy where the packet
- 1:06:26of data itself encodes if there was an
- 1:06:28error involved right so you could have
- 1:06:30uh one or n bits that could help uh
- 1:06:34detect errors in the in data data
- 1:06:36transfer there.
- 1:06:38And so we're talking about bus
- 1:06:40topologies. We already talked about
- 1:06:42parallel. So parallel is uh nice in the
- 1:06:46sense that uh it's very fast. You get
- 1:06:49lots of uh you can get a whole word or a
- 1:06:52bite across in one clock cycle.
- 1:06:56Uh is more expensive in terms of pins
- 1:06:58and more expensive in terms of wiring.
- 1:07:00But there examples are usually reserved
- 1:07:03for really fast things. So PCI Express,
- 1:07:05Compact Flash, those sorts of things.
- 1:07:08And so here's this example of, you know,
- 1:07:11parallel buses. So this is a processor
- 1:07:13that's running out all these parallel
- 1:07:15lines out to these uh sodium packages
- 1:07:18here so that they can have high
- 1:07:19bandwidth transfer.
- 1:07:24What why what's the downside of having
- 1:07:27parallel buses? Does anybody remember
- 1:07:29why why would you not want to have a
- 1:07:31parallel bus if you could avoid it when
- 1:07:33you're trying to get devices off chip?
- 1:07:37>> Yep. I still when I was undergrad, I
- 1:07:40still didn't believe it. My professors
- 1:07:42would say, "Wait a second. We're bound
- 1:07:44by pins. I just cannot get enough IO off
- 1:07:46this thing." And I was like, "How could
- 1:07:47that possibly be?" Um, it just happens
- 1:07:50to be that like physically there's just
- 1:07:52not enough space. And sometimes now they
- 1:07:54have chips where they actually put it's
- 1:07:55not just on the edges, they put a whole
- 1:07:58array of um pins just over the entire
- 1:08:01top and it's still not enough. And so
- 1:08:03they really are bound by how much data
- 1:08:06they can get on and off device by the
- 1:08:08physical location of pins. How many pins
- 1:08:11can they put on that piece of silicon?
- 1:08:12It is a driving bottleneck of the
- 1:08:15industry and there's no physical way out
- 1:08:17of it. this mostly because uh you can
- 1:08:20the mechanics of trying to get an IO
- 1:08:23like a a bond wire off your piece of
- 1:08:25silicon off device. It just takes up
- 1:08:27enough area that you can't put a lot in.
- 1:08:30So that remains a significant challenge.
- 1:08:35The counter example is serial. So serial
- 1:08:38is uh one uh bite per clock cycle as
- 1:08:42compared to parallel which is multiple
- 1:08:44or multiple bits per clock cycle where
- 1:08:46this is one bit per clock cycle. And the
- 1:08:49nice thing here is that you don't have
- 1:08:51to have lots of pins. You just have one
- 1:08:53pin for data. Now you're still going to
- 1:08:55probably have to have a clock in these
- 1:08:56other devices but um it is very uh
- 1:09:00compact. you do need some form of
- 1:09:02synchronization so that this thing knows
- 1:09:04when to clock in data and in fact
- 1:09:06parallel does as well
- 1:09:09and so you're going to need extra wires.
- 1:09:11Sometimes you need extra wires for
- 1:09:12handshaking and all those other things.
- 1:09:14It's inexpensive in terms of connections
- 1:09:16which is good. It's also particularly
- 1:09:18good for long distances. Uh and this
- 1:09:20might not be obvious but if you have a
- 1:09:22really long cable uh the propagation
- 1:09:24delay through it is not the same for
- 1:09:29every bit structure. So if a 8 bit
- 1:09:31parallel bus or I don't know 32-bit
- 1:09:34parallel bus and you're sending across a
- 1:09:36a set of wires, different
- 1:09:39um bits can have different propagation
- 1:09:41delays. So some some bits are like all
- 1:09:44zeros versus one 0 1 0. They will
- 1:09:46actually propagate at different rates
- 1:09:48which seems counterintuitive but it just
- 1:09:50means that it's much more complex to go
- 1:09:52long distances. And this is more from an
- 1:09:54ENM point of view where you have you're
- 1:09:56going so fast it's actually more like
- 1:09:58fields going over a bus, electric and
- 1:10:00magnetic fields rather than just uh
- 1:10:02voltage signals. But regardless of that
- 1:10:05um it's much easier to go a long
- 1:10:07distance with uh serial cables uh
- 1:10:10because even if one bit is slightly
- 1:10:12delayed or there's some errors in one
- 1:10:14thing, it happens to all the devices all
- 1:10:16the bits. It's not a group propagation
- 1:10:18delay.
- 1:10:21And this is why you have longer
- 1:10:22protocols like these are a little bit
- 1:10:24older ones RS232 FireWire but USB um
- 1:10:28Ethernet sure I squed C but even like
- 1:10:30LEDs so like your remote control on your
- 1:10:33uh for your TV. This is a serial
- 1:10:36protocol that's been well defined. It
- 1:10:38just happens to be the medium just
- 1:10:40happens to be optical.
- 1:10:44All right. And then uh you often see
- 1:10:46this here's just an example of that same
- 1:10:48chip we saw before where this is the
- 1:10:50chip that communicates between uh the
- 1:10:52microcontroller and the USB. So it does
- 1:10:54all the USB connection and functioning.
- 1:10:56And then when you start ripping these
- 1:10:57things apart, which I assume you'll do
- 1:10:59at some point probably for your
- 1:11:00projects, um there's only there's two
- 1:11:03lines in here. There's data plus, data
- 1:11:05minus, and then ground uh power, and
- 1:11:09then a couple different shields and
- 1:11:10ground things. And the reason they have
- 1:11:12data plus and data minus, they carry the
- 1:11:14exact same information. It's just one's
- 1:11:16a negative version of the other one. So
- 1:11:17that from a signal integrity point of
- 1:11:19view, um it's not just that one signal
- 1:11:21goes up or down. It's said that that
- 1:11:23you're looking at the delta between the
- 1:11:24two of them. And that from makes the
- 1:11:27detector much more robust to to noise.
- 1:11:30So uh that's what's inside USB cable.
- 1:11:36All right. So uh terminology. So, uh,
- 1:11:40here are the things you're going to have
- 1:11:41to think about when you're thinking
- 1:11:42about your bus topologies. The encoding,
- 1:11:45how's the data encoded, what's the
- 1:11:46transfer speed, uh, cost of pins and
- 1:11:49wiring modu modularity, and then error
- 1:11:52detection. Um, so we didn't really talk
- 1:11:54about that, but uh, what you want for
- 1:11:56error detection is one of those bits or
- 1:11:58multiple bits in that packet could
- 1:12:00encode. So, say like the seventh bit
- 1:12:02there could be a par bit. And that's
- 1:12:04just that you count up all the bits and
- 1:12:05if you're over if all the bits are even
- 1:12:08then say you get a a one for a parody
- 1:12:10bite and say all the bits are odd you
- 1:12:12get a zero for a parody bit and then the
- 1:12:13receiver can check the packet that came
- 1:12:15in and see is that true is the packet
- 1:12:18got corrupted in some way.
- 1:12:23uh serial is typically much slower than
- 1:12:26u parallel for obvious reasons just you
- 1:12:29know n number of bits going through but
- 1:12:31also they are in different domains in
- 1:12:33the electronics world so parallel is
- 1:12:36from on module right or on PCB from one
- 1:12:39PCB one component to another component
- 1:12:42DDR is example uh you're trying to get
- 1:12:44memory speeds that are very very fast um
- 1:12:47that's very different than trying to
- 1:12:48connect over a long distance to your
- 1:12:50computer so they've parallel buses
- 1:12:52versus serial buses like USB and
- 1:12:54Ethernet. They're just also at different
- 1:12:56domains in the space. And so, uh, serial
- 1:12:58is really long data transfers or long
- 1:13:01distances, and we don't really care so
- 1:13:03much, uh, about speed. Of course, you
- 1:13:05want it to be as fast as possible, but
- 1:13:07you're trying to optimize for distance
- 1:13:09rather than uh just breakthrough speed.
- 1:13:13All right. Um, yeah, we talked about
- 1:13:16length of wire, attenuation.
- 1:13:18Um,
- 1:13:20yep. Okay. Uh, one more thing. Let's
- 1:13:23see. Now we have a little time. So, uh,
- 1:13:26how do you synchronize these two devices
- 1:13:28is a big deal as well. So, most uh,
- 1:13:32serial and parallel protocols have a
- 1:13:34clock that goes along with them and say
- 1:13:36that you pre-arrange that you're always
- 1:13:38going to clock data in on the positive
- 1:13:39or negative edge. Great. But there's
- 1:13:42also other protocols that are
- 1:13:43asynchronous and that just means there
- 1:13:45is no clock. So, it's the receivers's
- 1:13:47responsibility to recover the clock
- 1:13:49timing and figure out when it's supposed
- 1:13:51to sample the bits. And that's uh
- 1:13:53challenging. We'll talk about the
- 1:13:55protocol that that uses this the most,
- 1:13:56which is UART. But it does mean that
- 1:13:58that start bit encodes timing and then
- 1:14:01the receiver has to figure out when to
- 1:14:03clock everything else in. This is nice
- 1:14:05in the sense that you didn't need to
- 1:14:07send a clock bit over. So, you've gained
- 1:14:10um
- 1:14:12uh you've reduced the bit. So, you've
- 1:14:13gained an improvement here by not having
- 1:14:16to have so many wires that go around,
- 1:14:17but now the receiver has to be much more
- 1:14:20complicated or at least a bit more
- 1:14:21complicated to make up for the lack of
- 1:14:23the clock signal. And then you also see
- 1:14:25that because of that, there's going to
- 1:14:27be more of a lower bound on how fast
- 1:14:30these things can do because you're
- 1:14:31asking the receiver to do more. So, uh,
- 1:14:33asynchronous is usually not as fast as
- 1:14:36synchronous.
- 1:14:39All right. So, terminology here. So
- 1:14:42synchronous is you need an extra wire
- 1:14:43for your clock. Uh there's no
- 1:14:45synchronization overhead. Um and
- 1:14:47typically uh you can be tightly coupled
- 1:14:49between the CPU and the disk which is
- 1:14:51nice. Uh meaning that you don't you're
- 1:14:54you can clock data in and out based on
- 1:14:56your processor's own clock. You don't
- 1:14:58have to wait for some other event. The
- 1:15:01problem with synchronous is well the
- 1:15:02advantage is that you have less wires.
- 1:15:05there's no clock skew to interrupt
- 1:15:07things, but you have the synchronization
- 1:15:08overhead and now you have to have
- 1:15:10something deviceed in between the CPU
- 1:15:12and uh the the parallel bus or the sorry
- 1:15:15the the data bus which means in your
- 1:15:18world your CPU is going so fast that
- 1:15:20you're probably not waiting necessarily
- 1:15:22but there is this decoupling effect that
- 1:15:24can happen. So that that is the the
- 1:15:26common issue.
- 1:15:29All right. So, timing considerations
- 1:15:32uh we talked a little bit about oh uh
- 1:15:34other considerations. So, we have clock
- 1:15:35and wire delay. Um flow control and
- 1:15:39power consumption and handshaking. So,
- 1:15:40flow control is like uh do you have to
- 1:15:43acknowledge the the data is coming over?
- 1:15:45Does there have to be some communication
- 1:15:47between the two devices? So, we think
- 1:15:49about the advanced peripheral bus. Um
- 1:15:51there were
- 1:15:53uh we had the uh P ready line and P
- 1:15:57enable line. Those were flow controls
- 1:15:58saying which device could talk when and
- 1:16:00then the hand shaking essentially is P
- 1:16:02and P P ready saying okay yes I I really
- 1:16:05am ready now but uh you lose some of
- 1:16:07that functionality in these serial
- 1:16:09protocols because you're trying to
- 1:16:10reduce wire um so you just have to look
- 1:16:12at as we look through all the different
- 1:16:14protocols which one has that particular
- 1:16:16functionality
- 1:16:18and then the last almost last uh almost
- 1:16:21last part here is uh number of devices.
- 1:16:24So you could have pointtooint. Um you
- 1:16:26could have one source and multiple
- 1:16:28destinations. This is probably the most
- 1:16:30common one. Um the one of the challenges
- 1:16:32pointtooint is good but it's very
- 1:16:35dedicated and often times what you want
- 1:16:37is you want to have on your PCB one
- 1:16:39serial protocol or one communication bus
- 1:16:41to everything. And so having a single
- 1:16:44source and multiple destinations is
- 1:16:46nice. and very complicated devices or
- 1:16:48things with multiple uh CPUs on it. You
- 1:16:51may need to have multiple uh sources
- 1:16:53that can control and talk to different
- 1:16:55devices. This is more rare, but
- 1:16:58certainly on a big motherboard that
- 1:16:59could happen where you have some power
- 1:17:01management unit needs to talk to a
- 1:17:02sensor, but then also maybe the core
- 1:17:04processor needs to talk to a particular
- 1:17:06sensor as well.
- 1:17:08Uh and then uh this is kind of some of
- 1:17:10the topologies that exist. We talked
- 1:17:12about pointto-oint. This is like a
- 1:17:13dedicated bus. Um older technologies
- 1:17:17like rings is where data is transferred
- 1:17:20from one device through another one
- 1:17:21through kind of a loop. Um that's more
- 1:17:24for networking. You have mesh topologies
- 1:17:27where it's uh undefined or they they
- 1:17:30reassign themselves. Uh that happens
- 1:17:32more rarely. Probably it's really the
- 1:17:34most common ones are bus and star that
- 1:17:36you will see uh bus star and pointtooint
- 1:17:39that you'll see uh here.
- 1:17:43Okay. And then uh for arbitration
- 1:17:46methods um
- 1:17:49we talked about with the advanced
- 1:17:51peripheral bus that the bridge will do P
- 1:17:54select. It will say that this particular
- 1:17:56device should be listening now or not.
- 1:17:59That's a modality that still exists uh
- 1:18:02in some of the serial protocols or uh
- 1:18:05device protocols that we'll talk about
- 1:18:07where there's actually a select line.
- 1:18:08Other ones are based on packet headers
- 1:18:10or structures where you're actually
- 1:18:11saying this device has an address and
- 1:18:13I'm going to talk to it specifically.
- 1:18:17All right. Um yeah, and who and there's
- 1:18:19questions about centralization. Who's
- 1:18:21controlling the arbitration process?
- 1:18:25All right. And the last line. So, uh
- 1:18:30Sierra protocols that are particularly
- 1:18:32relevant. I think the only one I want to
- 1:18:33add, I don't know if we'll have time
- 1:18:35this year, is to add CAN, but UART uh is
- 1:18:39a well-defined standard that's you will
- 1:18:41see no matter what. SPI and I squared C.
- 1:18:44Um both of those are becoming so common
- 1:18:47and silicon is getting so cheap that
- 1:18:49you'll find almost every one of your
- 1:18:50peripherals will have the capability of
- 1:18:52doing either one. It used to be that
- 1:18:53you're lucky, you know, if if you have
- 1:18:55one or the other, you're not going to
- 1:18:56get both. But now it's so cheap that
- 1:18:58you're going to get both of them. Um,
- 1:19:01Ethernet, uh,
About this transcript
This page contains the full transcript of EECS 373 - Fall 2026 - Lecture 10: "Timers Resolution vs Length & Serial Bus Overview ” by Interactive Sensing and Computing Lab , generated from the public captions YouTube serves with the video. The transcript has 12,575 words across 1,816 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.