YouTube2Text

EECS 373 - Fall 2026 - Lecture 4: “Memory Mapped IO / APB Bus — Transcript

by Interactive Sensing and Computing Lab · 11,268 words · 1,678 segments · language en · Watch on YouTube

Full transcript

  1. 0:00begin. Uh let's see. So today we're
  2. 0:03going to be talking about memory mapped
  3. 0:05IO, which is kind of like a new concept
  4. 0:06you probably haven't seen in 370 before.
  5. 0:09Uh some announcements. So homework's due
  6. 0:11today. Homework 3 was posted and it's
  7. 0:14due next week. And then office hours are
  8. 0:16today right after class from 3 to 4. If
  9. 0:18people need extra office hours, they can
  10. 0:20let me know.
  11. 0:22Um
  12. 0:25yes pro to normal lab schedules
  13. 0:29right all right so talk about component
  14. 0:33of the day how many people know what
  15. 0:34voltage regulators are
  16. 0:38then you'll actually learn something
  17. 0:40fantastic for the rest of you so last
  18. 0:42time we talked about batteries why can't
  19. 0:44you just connect up a battery straight
  20. 0:46to your device what's the problem.
  21. 0:55You got your microcontroller. Oh, here
  22. 0:56we go.
  23. 0:58>> Drains drains over time. Which what is
  24. 1:01that? What's the implication for the
  25. 1:02electronics? Let's say it could tolerate
  26. 1:04that voltage range. What's the what's
  27. 1:06the challenge if it's changing its
  28. 1:08voltage over time?
  29. 1:14I saw I saw a hand. Somebody take a
  30. 1:17guess. You could be wrong. It's okay.
  31. 1:23Yes.
  32. 1:24>> Too low.
  33. 1:25>> Might get too low. Uh so yeah, it might
  34. 1:28get too low. So your uh electronics have
  35. 1:31a certain happy range which it was
  36. 1:33designed for. Usually your
  37. 1:34microcontrollers here are about 3.3.
  38. 1:36They might go up to like 3.5 maybe down
  39. 1:38to 2.7. Depends on the microcontroller.
  40. 1:41But internally, sometimes there's uh
  41. 1:43analog components that are expecting a
  42. 1:45certain voltage and especially like uh
  43. 1:48oscillators or digital oscillators,
  44. 1:50they're all expecting a certain voltage
  45. 1:52so that the timing works out. And if all
  46. 1:54of a sudden you give it some weird
  47. 1:55voltage, this might have some unexpected
  48. 1:57behavior or at least that behavior might
  49. 1:59change over time. So sometimes your
  50. 2:01device works one way, battery drains
  51. 2:03down, now you have a device that works
  52. 2:05at a different way. And one way to
  53. 2:07handle that is to have voltage
  54. 2:08regulators. So voltage regulators their
  55. 2:10job is to essentially as it would imply
  56. 2:13regulate the output voltage so it's
  57. 2:15stable and constant all times and it's
  58. 2:17really trying to solve a few problems.
  59. 2:18One is trying to reject noise and you're
  60. 2:20like well where does the noise come
  61. 2:21from? Well especially if you connect it
  62. 2:22to the power lines or something like
  63. 2:24main lines there's lots of noise on
  64. 2:26those but then even on the battery
  65. 2:27powered system uh you can get noise in
  66. 2:29the system and your voltage regulator
  67. 2:31helps with that. Um also it it allows
  68. 2:34you to take voltages that would be
  69. 2:36unsafe for your device. So say you had
  70. 2:38like a 9volt battery or something, you
  71. 2:41could get down to 3.3 volts with a
  72. 2:42regulator and now your device can run
  73. 2:44and operate safely. So regulators have
  74. 2:47this nice job of uh solving the problems
  75. 2:50that batteries have caused and unstable
  76. 2:52power sources have caused by giving out
  77. 2:54constant voltage. And the hope is that
  78. 2:57they will provide any amount of current
  79. 2:59the device requests. Right? The device
  80. 3:01starts booting up, it starts going
  81. 3:02faster, it starts absorbing more
  82. 3:04current. Well, the regulator's job is to
  83. 3:06try to provide that amount of current at
  84. 3:08the reg at the voltage. Um, things to
  85. 3:11think about is not all regulators can do
  86. 3:13all current, right? So, your regulator
  87. 3:15has a certain current range that it can
  88. 3:18uh supply. Uh, some of regulators have a
  89. 3:21fixed voltage. You look at the
  90. 3:22manufacturer's data sheet and you get
  91. 3:24one for exactly the voltage range you
  92. 3:25want. Other ones are adjustable. So,
  93. 3:27there might be a resistor on there.
  94. 3:29There's a little bit more versatile. Um,
  95. 3:31and then the maximum voltage input range
  96. 3:34is important to think about. Not all
  97. 3:36batteries or not all regulators are
  98. 3:38going to work with all batteries. So,
  99. 3:40anyways, you're designing your embedded
  100. 3:41system. You're thinking about power,
  101. 3:43thinking about batteries, uh, voltage
  102. 3:44regulators. The next thing you need to
  103. 3:46look up, any questions about voltage
  104. 3:48regulators?
  105. 3:54No questions.
  106. 3:57Okay.
  107. 4:00All right. So today we're going to move
  108. 4:01on. We're going to talk about memory
  109. 4:02mapped IO and then the basically the
  110. 4:04mechanisms that you that are used to uh
  111. 4:07implement it. So bus architectures and
  112. 4:09the advanced peripheral bus. So we can
  113. 4:11start off by remembering that ARM has
  114. 4:14set forth this memory architecture or
  115. 4:16this memory layout. You have code at a
  116. 4:19certain location SRAMM peripherals
  117. 4:23external memory
  118. 4:26external devices and systems. And so you
  119. 4:29may think that this all represents like
  120. 4:31SRAMM or some memory structure, but it's
  121. 4:35actually very I mean it does, but it's
  122. 4:37also very varied. So like the question
  123. 4:39is how does this structure map onto this
  124. 4:42architecture?
  125. 4:43And so what you find is that sure
  126. 4:45there's SRAMM and code goes into normal
  127. 4:49structures like flash and SRAMM and
  128. 4:51maybe the system goes up there but then
  129. 4:53you have your peripheral memory spaces
  130. 4:56actually in the peripherals and you have
  131. 4:58off maybe off the high performance bus
  132. 4:59or the low performance bus you'll have
  133. 5:01uh these extra addresses allocated for
  134. 5:05these devices
  135. 5:07and so if we look at the idea of this
  136. 5:09peripherals and and GPO pins we have the
  137. 5:12peripheral range here and that is
  138. 5:14representing that you can take and load
  139. 5:16and store data in and out of that memory
  140. 5:19block which represents something over at
  141. 5:21those addresses. So uh those oh yeah
  142. 5:23those ports have been updated for your
  143. 5:25uh microcontroller
  144. 5:27and so you can even look at the first
  145. 5:28one let's say and that really is a data
  146. 5:31storage mechanism that is you can put a
  147. 5:33word in there right um that has bits and
  148. 5:36it stores it but it's not again it's not
  149. 5:38SRAMM it's not uh a particular memory
  150. 5:42structure in this case it's going to be
  151. 5:43a bunch of D flip-flops and these d
  152. 5:46flip-flops are going to store that
  153. 5:47information that you've just put in
  154. 5:49there.
  155. 5:51Now, the trick and the idea behind
  156. 5:53memory mapped IO is that instead of
  157. 5:56saying that I'm going to have special
  158. 5:58instructions to do things like make a
  159. 6:00GPIO pin go high or low, I'm going to
  160. 6:02have a register or a memory location
  161. 6:06particular let's say you know this
  162. 6:074,0001 that represents the state output
  163. 6:10state of the GPIO and you're going to
  164. 6:11put a number in there and that's going
  165. 6:13to change the state of the output. So
  166. 6:16now we're going to have your
  167. 6:17microcontroller is just going to be
  168. 6:18using loads and stores and it can
  169. 6:20manipulate
  170. 6:21GPIO pins or timers or all these other
  171. 6:24functionalities
  172. 6:27that would be separate from portmapped
  173. 6:29IO. Um so portmapped IO would be like in
  174. 6:32an application pro processor like an
  175. 6:34Intel processor where you're going to
  176. 6:35have special instructions just to talk
  177. 6:37to video card or memory and they're
  178. 6:40going to be much more optimized but
  179. 6:42there's overhead with that. So ARM here,
  180. 6:44we're in the space where
  181. 6:45microcontroller, they're not trying to
  182. 6:46go for max performance. Remember ARM's
  183. 6:48business model is they don't want to
  184. 6:50support special instructions for
  185. 6:52everybody's peripheral. That wouldn't
  186. 6:54make sense. It would be too hard for
  187. 6:55them for every manufacturer to keep
  188. 6:56track of it. So they're going to say,
  189. 6:58"We're just going to use loads and
  190. 6:59stores." And then that's going to load
  191. 7:02and store information into some
  192. 7:03registers, some memory. And then the
  193. 7:05manufacturer is responsible for turning
  194. 7:07those loads and stores that data in
  195. 7:09there into some action, some GPIO
  196. 7:11output, input, whatever it is. And
  197. 7:13that's where you look at the
  198. 7:14manufacturers's or data sheet to figure
  199. 7:16out when you do a load into a particular
  200. 7:18or store into a particular memory
  201. 7:20address, what is the function that
  202. 7:21happens. Does that make sense?
  203. 7:27Oh, nobody has questions. that somebody
  204. 7:29was excited.
  205. 7:32All right.
  206. 7:36So, the goal of what we're going to try
  207. 7:38and teach you now is how you go from
  208. 7:41your registers to your GPIO or just and
  209. 7:43it could be any peripheral. It doesn't
  210. 7:45really matter. GPIO is just a peripheral
  211. 7:47like a DACK or a timer or Ethernet or
  212. 7:49any of those things. And so we're going
  213. 7:51to try and figure out how do we go from
  214. 7:53registers in our core and actually
  215. 7:55traverse
  216. 7:58all the way over here. What's the actual
  217. 8:00mechanism kind of like signal level that
  218. 8:02goes from there to there. Okay, that's
  219. 8:05most of what we're going to be teaching
  220. 8:06today. And then just to to give you the
  221. 8:09heads up, we're going to talk about what
  222. 8:10what is actually in a peripheral from a
  223. 8:12conceptual point of view because we have
  224. 8:14we have this bus. We're not going to
  225. 8:15worry about the high performance bus
  226. 8:17right now. Once you learn the per the
  227. 8:18the advanced peripheral bus, all the
  228. 8:21same learnings go to the advanced um
  229. 8:23high performance bus. It's just with a
  230. 8:25little less complexity. So here we're
  231. 8:27going to try to we're going to talk
  232. 8:28about the bus structure to get through
  233. 8:30here. And then what is actually in these
  234. 8:31peripherals? Well, here we see the bus
  235. 8:34is connected and conceptually it's just
  236. 8:36a bunch of registers. There's registers
  237. 8:37in there. Those registers happen to be
  238. 8:39at a particular address and you can
  239. 8:41store data into them and pull data out
  240. 8:43of them.
  241. 8:45And then we're going to talk about today
  242. 8:47is there's a bunch of like logic on the
  243. 8:48front of this thing. We're going to get
  244. 8:50through all these details that help the
  245. 8:52bus actually talk to those specific
  246. 8:54registers. Remember, there are lots of
  247. 8:55different peripherals on your device.
  248. 8:57And some of those peripherals have
  249. 8:58multiple registers. And so we need to be
  250. 9:00able to make sure the data gets to where
  251. 9:02it's supposed to be. And then any every
  252. 9:04one of those peripherals have some
  253. 9:05custom logic, right? So if it's a timer,
  254. 9:07it has these little timer modules that
  255. 9:08keep track of things. If it's an analog
  256. 9:10digital converter, it's trying to sample
  257. 9:12some analog signal. And most of what
  258. 9:14we're going to talk about for the next
  259. 9:15couple days is just going to be the idea
  260. 9:17of GPIO.
  261. 9:20And then sometimes, and in the case of
  262. 9:22GPIO, it's true. Then you're going to be
  263. 9:25able to actually affect something else
  264. 9:26outside the world. So here in this
  265. 9:28little conceptual model that just
  266. 9:30represents one of those GPIO pins that's
  267. 9:32on the outside of your board. Of course,
  268. 9:34if you had a timer or something else,
  269. 9:35you might not ever go outside. It might
  270. 9:37just be all internal inside your
  271. 9:39peripheral.
  272. 9:41What questions do you have? This was a
  273. 9:43lot of information. I'm sure I wasn't
  274. 9:45clear.
  275. 9:52>> Yeah.
  276. 9:59>> I'm sorry. Say that again.
  277. 10:06>> Yeah. So the peripheral here is going to
  278. 10:08have multiple registers. So you guys in
  279. 10:11lab were talking to a periphery, your
  280. 10:13GPO peripheral, right? And you were
  281. 10:14sending data into your let's see there's
  282. 10:16the configuration register, there's the
  283. 10:18output register, there's the input
  284. 10:19register, right? And so you might have
  285. 10:21multiple registers inside one
  286. 10:23peripheral. We're just talking about in
  287. 10:24this case this one set of registers for
  288. 10:26instance. And then uh then it's doing
  289. 10:29some tasks over here and controlling
  290. 10:31that pin. So like a peripheral is a
  291. 10:34concept of a unit of logic that performs
  292. 10:37a task with multiple registers in it.
  293. 10:42And from the core core's point of view,
  294. 10:44it doesn't know it exists. The core just
  295. 10:47thinks I'm putting loads and stores into
  296. 10:49memory. It just thinks it's really good
  297. 10:50at talking to memory. And it's you as a
  298. 10:53programmer and your IDE that have to
  299. 10:54keep track of the fact that this memory
  300. 10:56location actually means something else.
  301. 10:57It means set up the output direction of
  302. 10:59this pin.
  303. 11:10This is all in chip. All of this is in
  304. 11:13chip. Um, if we go back, that's a good
  305. 11:16question. Didn't really make it clear.
  306. 11:19Let's see if I go back here. So, this
  307. 11:21all represents things that are inside
  308. 11:22the chip. Okay. Um, and so we have a
  309. 11:26couple buses and then if you want to get
  310. 11:28off the device, then there's like a
  311. 11:30little GIO pin that will go off to the
  312. 11:32external world. The second half of the
  313. 11:33class we talk about how like with SPI
  314. 11:36for instance which is a serial
  315. 11:37peripheral interface protocol how you
  316. 11:39would talk to chips off device. So right
  317. 11:40now we're all in in device.
  318. 11:43Does that answer your question? Yeah.
  319. 11:46What else we got?
  320. 11:50Don't be shy because uh this is if I if
  321. 11:52I can clear up the confusion now it'll
  322. 11:55help you later on. All right. So
  323. 11:57anyways, we're getting to the point
  324. 11:59here. We're gonna try and send data
  325. 12:00here. we have to go through these bus
  326. 12:02structures and then into this conceptual
  327. 12:04GPIO or this uh this peripheral module.
  328. 12:09Uh so let's look at a slightly different
  329. 12:10example. So say we want to interface uh
  330. 12:13to external memory, right? We don't have
  331. 12:15enough SRAM on device and we want to add
  332. 12:17extra SRAM. Well, ARM has gone through
  333. 12:21and given us register or memory space
  334. 12:24and it says if you write to these memory
  335. 12:26locations and you configure connect this
  336. 12:28external RAM because it's external off
  337. 12:30device then we're going to be able to uh
  338. 12:34use this just as normal SRAMM. Okay. So
  339. 12:38my question to you is uh we saw before
  340. 12:40that that exists on the uh uh advanced u
  341. 12:45peripheral bus and how this little block
  342. 12:49here. How does the um uh so we have this
  343. 12:54device how do we actually take that
  344. 12:55memory address range and actually put uh
  345. 12:59data into here? What's what has to be in
  346. 13:01this peripheral block just conceptually?
  347. 13:04So why don't you take a minute and think
  348. 13:05about it like how would you how would
  349. 13:08this work? Are you going to store data
  350. 13:10into this and then it gets transferred
  351. 13:11over? What is that mechanism? What would
  352. 13:13have to be in that memory location? So
  353. 13:15why don't you take you know 60 seconds
  354. 13:17talk to your your neighbors figure out
  355. 13:19what would have to be in that peripheral
  356. 13:21block.
  357. 13:40I'll put that up for you. Keep talking
  358. 13:42though.
  359. 13:50[sighs]
  360. 14:12>> [clears throat]
  361. 14:15>> You guys are like dead today. What
  362. 14:17happened last weekend? Oh my god. All
  363. 14:20right. What do you think? What? Anybody
  364. 14:23got an answer? What what is in this
  365. 14:25thing?
  366. 14:27How would you do this function?
  367. 14:31Yeah.
  368. 14:42map. [clears throat]
  369. 14:44>> Yes, that's essentially what's
  370. 14:46happening. So, you're 100% right. Now,
  371. 14:47when you say, are there physical
  372. 14:50locations on device that map to physical
  373. 14:54locations off device?
  374. 15:00>> Okay.
  375. 15:02Would there be uh Okay. Anybody else?
  376. 15:06It's pretty good.
  377. 15:11Yeah.
  378. 15:26>> I think so. Now the question is
  379. 15:30let's say that's a gigabyte, right?
  380. 15:32That's as much space as it is. How many
  381. 15:34registers do you think they're going to
  382. 15:35be?
  383. 15:39not enough.
  384. 15:40So what we're saying is having taught
  385. 15:43the class a few times, you could
  386. 15:44interpret it this way. You could say,
  387. 15:46"All right, well, I know there's a
  388. 15:47gigabyte here because that's how much
  389. 15:49space is there." And so I'm going to put
  390. 15:51the data in here and then it's going to
  391. 15:52get transferred out device and then it's
  392. 15:54going to have the one to one mapping.
  393. 15:56What's wrong with that idea? Why won't
  394. 15:58that work?
  395. 16:02>> Well, say we had a gigabyte here and I'm
  396. 16:04going to take data from here. I put one
  397. 16:06gig in there and then I just duplicated
  398. 16:08off off device.
  399. 16:13>> What's that? Is it
  400. 16:16>> uh that's a you could be but uh STM or
  401. 16:21ARM has only given you one gig of uh
  402. 16:24address space worth of address. So
  403. 16:25that's as large as it could be. But
  404. 16:27what's the what would be the challenge
  405. 16:28with having a gigs worth of uh D
  406. 16:31flip-flops?
  407. 16:32>> Yeah.
  408. 16:40Yeah.
  409. 16:46>> Right. So, like unless there was
  410. 16:47somebody who's like, "All right, I have
  411. 16:48to have a thing where I like hot swap it
  412. 16:50off and on or I don't know what it would
  413. 16:51be, but that seems like a different
  414. 16:52problem." What's the other problem with
  415. 16:54having a gig of uh D flip-flops? Yeah,
  416. 16:57>> it's large.
  417. 16:58>> Yeah. So large in a sense that in in the
  418. 17:01IC world uh having memory takes up
  419. 17:04physical space and die the area of your
  420. 17:07chip is the cost function right so you
  421. 17:09want to make that thing as small as
  422. 17:10possible and on your particular uh
  423. 17:13device in lab I think it's only 325k
  424. 17:17of uh memory that's it on the entire
  425. 17:19device so it couldn't even there's not
  426. 17:20even room for a gig
  427. 17:23all right so that's the problem oh right
  428. 17:25352
  429. 17:27uh so we're not going to do that but
  430. 17:28instead Instead, what they're going to
  431. 17:30do is they're going to have a they have
  432. 17:31an external bus unit specifically for
  433. 17:33this which effectively emulates all
  434. 17:36those addresses. They aren't physical
  435. 17:38addresses in the sense of like there is
  436. 17:40a register to put things in. It just
  437. 17:42emulates any data that you would send
  438. 17:44in. You send it to this address range.
  439. 17:46It takes it and it forwards it over.
  440. 17:48Right? So, you have this little state
  441. 17:49machine in here that says, "Oh, I'm
  442. 17:51going to respond to this address and I'm
  443. 17:53going to store it over here." And if
  444. 17:54they ask for anything, then I'm going to
  445. 17:55go and look in external memory and pull
  446. 17:57it back. So really this becomes a little
  447. 17:59bus mechanism to talk back and forth.
  448. 18:02Now the core doesn't know that there's a
  449. 18:04bus inherently, right? The core is just
  450. 18:05like I'm putting memory in these
  451. 18:08addresses and this device is taking care
  452. 18:10of the rest. So now we have you might
  453. 18:12think about it is emulated uh registers
  454. 18:15or emulated memory. Um it's just
  455. 18:17physically backed you know this is
  456. 18:19another way to say it maybe physically
  457. 18:20backed memory but the uh locations don't
  458. 18:23physically exist but from a protocol
  459. 18:26point of view you can send data in it
  460. 18:28and it gets taken put into external
  461. 18:29memory. Yeah
  462. 18:32>> it's not I wouldn't use the term virtual
  463. 18:34memory because that has a specific
  464. 18:35connotation in uh processors but you
  465. 18:38could call it like maybe in the class of
  466. 18:40microcontrollers it would be like a
  467. 18:41virtual address or something.
  468. 18:43>> Yeah.
  469. 18:49Yes.
  470. 18:56>> How does a microcontroller or how does a
  471. 18:59uh
  472. 19:07>> this is for all microcontrollers in with
  473. 19:10this architecture. So um this is what
  474. 19:14ARM has laid out saying that it will
  475. 19:17support this architecture and then
  476. 19:19device manufacturers are free to
  477. 19:21implement underneath that however they
  478. 19:23want. So device manufacturers can't put
  479. 19:25SRAMM in external device space. I mean
  480. 19:29sure you could they could make a crazy
  481. 19:30machine that does that but uh the SRAMM
  482. 19:34has special IP path and DPath so
  483. 19:37instruction path and data path to
  484. 19:38optimize fetching from there and you
  485. 19:40won't get that same benefit if you put
  486. 19:42it up in external device space so the
  487. 19:45architecture says lay out all your stuff
  488. 19:47in this space you don't have to use it
  489. 19:48all but this is what we're going to give
  490. 19:50you
  491. 19:51>> then
  492. 19:55>> yes this is we are uh learning about the
  493. 19:58uh ARMv7-m
  494. 20:00architecture and so if you went to the
  495. 20:02application class processors yeah you
  496. 20:04can have many gigs
  497. 20:20>> um it's up to the device manufacturer
  498. 20:22for your particular devices I think they
  499. 20:24only do um the the bus structure that uh
  500. 20:28Infinion has provided you only does I
  501. 20:31think a quarter of a gig. That's as much
  502. 20:33as it can do. And they just didn't
  503. 20:35implement the bus to emulate more
  504. 20:38addresses.
  505. 20:42But I mean you could you could find
  506. 20:44probably a different product maybe not
  507. 20:45at Infinion but somewhere in the world
  508. 20:47that gives you the full gig. Is it?
  509. 20:56>> Uh, no. You can buy a gigs worth. I
  510. 20:59don't know why Infinion chose to do
  511. 21:00this. My guess is that they looked at
  512. 21:02the benefits versus the area and said,
  513. 21:04"Well, our customers don't want this."
  514. 21:06Like going for a full gig of external
  515. 21:08SRAMM is just not that important. So,
  516. 21:11we're not going to add the extra
  517. 21:12complexity and increase our diet cost
  518. 21:14for that trade-off.
  519. 21:21I don't know exactly because I didn't
  520. 21:23design it yet. But let's just imagine if
  521. 21:24you're able to handle uh larger and
  522. 21:27larger uh address spaces and we're going
  523. 21:29to talk about this a little bit later.
  524. 21:30Then you're going to increase your
  525. 21:32complexity of your bus system and you
  526. 21:34have to have more logic. So I'm sure
  527. 21:36it's just a design trade-off. I'm not
  528. 21:37sure why they chose it, but I can we can
  529. 21:39invent good reasons for it.
  530. 21:42What else we got? Yeah.
  531. 21:45Can you say that?
  532. 21:48>> Yep.
  533. 21:49So, um, in our toy example here,
  534. 21:53um, we're saying that the core is
  535. 21:56allowed to write data to all these
  536. 21:58addresses, right? But there's not memory
  537. 22:02on chip that represents it's at every
  538. 22:04one of those addresses, right? So,
  539. 22:06there's probably in there there's a few
  540. 22:08registers, right? There's a register for
  541. 22:10like load and store or like input in and
  542. 22:13out. and it says, "Okay, I'm gonna go to
  543. 22:16uh register one and it's going to go to
  544. 22:18set that's one register and then it goes
  545. 22:19I'm going to put it into the next memory
  546. 22:22location." Still the same register,
  547. 22:24right? It's just that this thing is
  548. 22:26pretending like it's a new uh address
  549. 22:29for for the core sake and the core is
  550. 22:31putting in sequential address reads even
  551. 22:33though it's the same thing because
  552. 22:34what's happening underneath is it's
  553. 22:35taking that data putting it off chip
  554. 22:37into SRAMM.
  555. 22:42>> Yeah. Yeah. and how the how big that
  556. 22:44buffer is and all that other stuff, I
  557. 22:46don't know. We can go look it up in the
  558. 22:47data sheet. But um from the core's point
  559. 22:49of view, it thinks there are addresses
  560. 22:51for each there's memory at each one of
  561. 22:52those addresses. It just doesn't know.
  562. 22:58>> Yeah,
  563. 23:04>> I would use multiple. This is a
  564. 23:07conceptual super IO pin. Um you probably
  565. 23:11I don't know. you're probably in an 8 or
  566. 23:1316 bit uh bus. Uh it depends on if it's
  567. 23:16parallel. There's there's a bunch of
  568. 23:18different protocols. So Quad Spy is one
  569. 23:20uh that they would use. That's a good
  570. 23:22question that wasn't clear. Any other
  571. 23:25questions?
  572. 23:28You guys are figuring out all the things
  573. 23:29I I forgot to tell you. That's great.
  574. 23:32Okay.
  575. 23:35Um All right. So, Methodon, what am I
  576. 23:37trying to teach here? Oh, basically this
  577. 23:39is just uh the big idea here is this
  578. 23:41loads and stores from the cores point of
  579. 23:42view. Um there's two basic ones I think
  580. 23:45about. There's like this emulated memory
  581. 23:47we just talked about, but there's also
  582. 23:49registers that exist in a peripheral. Um
  583. 23:52or it could be another place in there,
  584. 23:54but it's not like a me the focus of uh
  585. 23:58peripherals is not to be data storage
  586. 24:01per se. it is to data will represent uh
  587. 24:04some task that needs to be done and the
  588. 24:06core is just putting in data back and
  589. 24:08forth loads and stores but the
  590. 24:10peripheral is interpreting it as
  591. 24:12something else so that's like the two
  592. 24:13basic ways to think about memory mapped
  593. 24:15IO uh yeah and again it's just loads and
  594. 24:18stores okay and then I guess the other
  595. 24:20key is uh you know when you you're going
  596. 24:22to hear about some peripheral like
  597. 24:24that's and then you know be given some
  598. 24:26task that's really your call to start
  599. 24:28reading the data sheet in this class and
  600. 24:30then whenever you use it in industry
  601. 24:31Your data sheet is where it's going to
  602. 24:33tell you, okay, this peripheral has this
  603. 24:35functionality. Uh, it has these specs
  604. 24:38and then it'll tell you how to interface
  605. 24:40with it and which registers to put the
  606. 24:41data into to get some functionality. The
  607. 24:44ARM doesn't as a company doesn't know
  608. 24:46what's in those peripherals.
  609. 24:48Okay, so we're going to move on. We're
  610. 24:49going to talk about the bus structure of
  611. 24:51how we're transporting the data across
  612. 24:53the chip.
  613. 24:54So bus is just a set of wires and
  614. 24:57supporting circuitry and it's a protocol
  615. 24:59to send data back and forth between two
  616. 25:00locations. So one example would be a
  617. 25:02parallel bus where data in one clock
  618. 25:05cycle is sent across uh in this
  619. 25:08particular thing is eight bits across.
  620. 25:10Another type uh is a serial interface
  621. 25:12where multiple clock cycles data sent
  622. 25:14over. So we're thinking on chip. What do
  623. 25:17you guys think would be the type of bus
  624. 25:19structure that would be used?
  625. 25:28Why don't you take 30? Oh, go ahead.
  626. 25:30>> Why parallel?
  627. 25:43>> I think those are all true. I didn't
  628. 25:44think about the logic point. It is um it
  629. 25:48is much faster because you don't take
  630. 25:49time. And uh one of the things we'll
  631. 25:52learn about later on is that uh on chip
  632. 25:55it's easy to have parallelism. So you
  633. 25:57can have buses. It's when you're trying
  634. 25:58to get any information off chip that
  635. 26:00there's the real problem. You it's very
  636. 26:02hard to put a lot of parallel buses off
  637. 26:04chip because it just takes up uh GPIO
  638. 26:06pins. And you would think, oh, just put
  639. 26:08more on. You're actually getting really
  640. 26:10pin limited. The thing that limits
  641. 26:11application class processors as well as
  642. 26:13these little microcontrollers is you
  643. 26:15just can't have enough physical little
  644. 26:16bumps to have wires that come off chips.
  645. 26:18And then we have to invent things like
  646. 26:20serial protocols.
  647. 26:22So uh this is an example of um uh you
  648. 26:26know an Intel 88 here uh all the basic
  649. 26:31logic units right here we have carry and
  650. 26:33ad is old processor obviously with
  651. 26:35registers and stacks and then there's
  652. 26:38this bus structure underneath it and the
  653. 26:39bus structure here is uh partly it's to
  654. 26:42power provide data but it's also to ship
  655. 26:44or provide power. That's what uh the red
  656. 26:48and blue are. But the rainbow colors are
  657. 26:50there to actually that's the data path
  658. 26:52to send data back and forth between
  659. 26:54devices.
  660. 26:56Um one person asked me like why why are
  661. 26:59we making it so hard? Why do you need a
  662. 27:01bus structure? Just put the two things
  663. 27:03next together. Just run a wire. And
  664. 27:05that's okay. That's in a simple chip
  665. 27:07like that. Maybe you can do it and maybe
  666. 27:09that's essentially what they're doing.
  667. 27:10But the reality is when you have
  668. 27:11multiple destinations, how do you choose
  669. 27:14where the data is going to go? But you
  670. 27:15want you don't want to run a wire or a
  671. 27:17set of bus wires to every possible
  672. 27:19location. So a bus structure just
  673. 27:21becomes a necessary evil. It seems
  674. 27:23overly complicated what we're going to
  675. 27:24talk about today, but it's really hard
  676. 27:25to figure out an actual cheaper, simpler
  677. 27:29structure that would do the effectively
  678. 27:31the same job.
  679. 27:35Um, oh, I forgot to load this up, but
  680. 27:38um, you guys can uh look at false ad. So
  681. 27:41just to think through this, have did you
  682. 27:42guys in in 270 do bus structures at all?
  683. 27:47No. Okay. Oh, we'll do it. Um, let's
  684. 27:51see.
  685. 27:53Well, okay.
  686. 27:56Well, for the sake of time, uh, we're
  687. 27:58not going to show the default stat, but,
  688. 28:00uh, you can, uh, look play through this.
  689. 28:02Basically what's happening here is just
  690. 28:04a counter that counts up and then
  691. 28:06there's a bunch of D flip-flops and then
  692. 28:08on every clock cycle it transfers data
  693. 28:10over and then uh visualized here the B 0
  694. 28:14through B7 uh is this timeline
  695. 28:16underneath and you can just watch the
  696. 28:18counter pass data over and then the
  697. 28:20other one over there is just a display.
  698. 28:22It's a binary to to decimal display. And
  699. 28:25all we're just showing is you have a set
  700. 28:27of D flip-flops here happens to be eight
  701. 28:29of them. And on every clock cycle, it's
  702. 28:31going to send out whatever data is
  703. 28:32there. Whatever data comes out of the
  704. 28:33side is going to be transferred over to
  705. 28:35that side. That's just the big
  706. 28:37conceptual uh concept. Kind of like you
  707. 28:40learned about multi-stage processors
  708. 28:42where you had one set of registers that
  709. 28:43would pass data to the next stage. This
  710. 28:45is just uh for the function of passing
  711. 28:47data around the chip.
  712. 28:51Oh, and I I don't know why.
  713. 28:57Okay. Uh, so we're going to send data uh
  714. 28:59to different devices, right? And so here
  715. 29:01we're saying that in each one of these
  716. 29:03little blocks is a place where we need
  717. 29:05to send data. And so I want you to think
  718. 29:07work uh with your partners just kind of
  719. 29:09think about what are the signals that
  720. 29:10you would need other than data and
  721. 29:12clock, right? That if you need to
  722. 29:14transport data to arbitrary locations
  723. 29:15around the chip, what else do you need
  724. 29:17as part of that signaling structure? And
  725. 29:20uh the thing I should have motivated
  726. 29:21here is uh there's a clock and there's
  727. 29:23data, but there's other things that are
  728. 29:25needed. So take 60 seconds, think about
  729. 29:27what are the other structures or signals
  730. 29:29you're going to need.
  731. 29:56Next initiate.
  732. 30:17>> [clears throat]
  733. 30:22>> All right. What do we think? We got to
  734. 30:23send data from the core to all those
  735. 30:26different locations. What other signals
  736. 30:27do we need other than clock and data?
  737. 30:35Brave people. Who you?
  738. 30:38>> Well, we have a clock.
  739. 30:43>> I'm sorry.
  740. 30:46>> Uh, sure. That would be we want
  741. 30:48birectional data. Okay. So, now we want
  742. 30:50not only are we going to send data, but
  743. 30:52we have to send data back. So, we're
  744. 30:53going to need a different path.
  745. 30:57>> Interrupts. What would they No.
  746. 31:01Uh, but you'll learn about them later
  747. 31:03and you'll can tell me that was wrong.
  748. 31:04Okay.
  749. 31:06Chip select line.
  750. 31:07>> What's that?
  751. 31:07>> Chip select line.
  752. 31:09>> Chip select line. Uh so uh yes, we won't
  753. 31:14call it a chip select just because we
  754. 31:16are all on the same piece of silicon,
  755. 31:19but it would probably be helpful to be
  756. 31:21able to tell this peripheral
  757. 31:22specifically I'm talking to you. What
  758. 31:25else do we need?
  759. 31:29>> Yes. So we have addresses not only of
  760. 31:32just the peripheral but also of the
  761. 31:33registers in the peripheral.
  762. 31:36indicate.
  763. 31:38>> Okay. So, some control lines. Okay.
  764. 31:41Yeah.
  765. 31:44>> Oh, okay. Yeah, you guys may have been
  766. 31:46looking ahead in your slides. That's
  767. 31:48very clever. Okay. Let's see what we
  768. 31:50got. Um, so I said data. We're going to
  769. 31:52need address lines because there's a
  770. 31:54specific register that we're going to
  771. 31:56have to go to. Uh, control lines. So,
  772. 31:58that can be a select and enable. Um and
  773. 32:01then again the idea here is we're going
  774. 32:03to have multiple of these so that uh the
  775. 32:04data is going to go through to all of
  776. 32:06them uh or some signals are going to go
  777. 32:09to many of them. We may have a select
  778. 32:10line in particular. Okay, I think you
  779. 32:14guys got everything. Yep. Uh so in this
  780. 32:17world we have the terminology of
  781. 32:18requester and a completer. So requesters
  782. 32:21is just a thing that starts the
  783. 32:23transaction. Um there are ARC bus
  784. 32:26architectures where you could have
  785. 32:27multiple uh requesters or multiple
  786. 32:30masters you might say but in this world
  787. 32:32there's this one and that is essentially
  788. 32:34the uh APB bridge uh or the advant the
  789. 32:37high performance to uh peripheral bridge
  790. 32:40and then we have completers these are
  791. 32:42things that do the task that the
  792. 32:44requester has asked for. So they cannot
  793. 32:47initiate a conversation only the
  794. 32:49requester can but the completer does the
  795. 32:52task that's asked for. And so we can
  796. 32:54look through this example we have a
  797. 32:56store. So the core is going to uh you
  798. 33:00know execute this instruction and
  799. 33:02there's going to be some combinational
  800. 33:04logic that's basically looking at the
  801. 33:06output of the or the uh the cores lines
  802. 33:09right to say okay I recognize this is a
  803. 33:11store. It's this address and that
  804. 33:13address. And then there's some state
  805. 33:14machine here which is going to take that
  806. 33:16request and turn it into these logical
  807. 33:18lines which is going to transport the
  808. 33:20data across the device. And then you
  809. 33:21have to have a completer with some sort
  810. 33:23of uh state machine that's going to
  811. 33:25interpret that and then turn it into GPO
  812. 33:28pins. So this thing is trying to figure
  813. 33:30out you know I've got an address. Is
  814. 33:32that address in the things I care about
  815. 33:34the range I care about? It's got is it a
  816. 33:36load or a store? It has to generate some
  817. 33:38signals and transport some data. And
  818. 33:40then remember there's can be a completer
  819. 33:42is part is a peripheral let's say uh and
  820. 33:46it could have multiple GPO pins. So any
  821. 33:48one completer is looking for is this my
  822. 33:50address? Is it a loader store? Do I have
  823. 33:52to what task do I have to do? Is it
  824. 33:54asking for data?
  825. 33:59And then uh once the completer has been
  826. 34:02selected and it's responding correctly,
  827. 34:04then it might in any of the peripherals
  828. 34:07may have or almost always have more than
  829. 34:09one uh register in it. And then the
  830. 34:12address is selecting which uh peripheral
  831. 34:14address it goes to or register is put
  832. 34:16into.
  833. 34:17So any questions before we dive in.
  834. 34:22All right. So this is that was supposed
  835. 34:24to be high level. We're going to talk a
  836. 34:26little bit more details on the signal
  837. 34:27level. So before we talked about that
  838. 34:29there's this high performance bus and
  839. 34:31there's a low performance bus. We we
  840. 34:33shouldn't call low performance. The
  841. 34:34advanced peripheral bus. The peripheral
  842. 34:36bus and high performance bus are trying
  843. 34:38to do two different tasks. The advanced
  844. 34:41peripheral bus is generally lower power,
  845. 34:44simpler interface, but also very latent
  846. 34:47latency tolerant. If you have some
  847. 34:49temperature sensor or some Ethernet
  848. 34:52traffic that's really slow, the advanced
  849. 34:55peripheral bus can handle latency where
  850. 34:57the advanced uh high performance bus is
  851. 34:59really like I'm sending data to memory.
  852. 35:02I'm going to this external device maybe
  853. 35:04I'm using DMA where this is uh much
  854. 35:07faster uh and made to be deterministic.
  855. 35:10This also like a pipeline bus structure
  856. 35:14uh it can have multiple initiators or
  857. 35:17requesters with a DMA. So once you learn
  858. 35:19this one, you would have a you know
  859. 35:21enough to be able to read the data sheet
  860. 35:23and understand this. But we're not going
  861. 35:24to inherently teach this one uh in in
  862. 35:27this class. So, for the purposes of 373,
  863. 35:30we're going to be doing this. We're
  864. 35:32going to be talking about this interface
  865. 35:33here. There is a relatively short um
  866. 35:38manual. I don't actually expect you all
  867. 35:39to read it, but I think it's only like
  868. 35:4139 pages or so. So, if you had to, you
  869. 35:44could just not trust me and read the
  870. 35:45whole spec yourself. Yes.
  871. 35:56uh it's um it is
  872. 36:00very complex and so what we'll learn
  873. 36:03later on it's actually not even it has
  874. 36:05multiple requesters or multiple masters
  875. 36:07so and it has multiple lanes in it so
  876. 36:10you are able to control traffic from
  877. 36:13different devices so you may have DMA
  878. 36:15that's going to two different locations
  879. 36:16in memory while your core is talking to
  880. 36:19an ADC and so the complexity is high and
  881. 36:24I guess that would increase power
  882. 36:25consumption in area. So there is a
  883. 36:27logical reason to have both. Uh we did
  884. 36:30talk about I think on the first day that
  885. 36:33uh because Infinion is making um like
  886. 36:36real-time control hardware they actually
  887. 36:38have a uh their peripheral bus is a
  888. 36:42version of a high performance bus with
  889. 36:43some features taken away. So to your
  890. 36:46question, you could use either one. It
  891. 36:48just are you hitting your particular
  892. 36:49design goals.
  893. 36:53All right. So we'll talk a little bit
  894. 36:55about single notation. This is just in
  895. 36:57the data sheet and you'll see a lot of
  896. 36:58this um uh as we go through slides. So
  897. 37:02there's clock and then it's just showing
  898. 37:03you here are some transitions like
  899. 37:05transition from high to low. And this
  900. 37:07little gray area here is just saying
  901. 37:08that the spec is defining that there is
  902. 37:10some uncertainty. That's all it's
  903. 37:12saying. We don't really care and this is
  904. 37:14a a stable bus. We don't really care
  905. 37:16about the high impedance state or low
  906. 37:17impedance state. You may see it
  907. 37:19somewhere. And this is just showing that
  908. 37:20a bus is changing. Uh bus being that
  909. 37:23this would be a concatenation of
  910. 37:24multiple lines on top of each other. And
  911. 37:26that's why you see a top and a bottom
  912. 37:27where a single uh line could either be
  913. 37:30high or low. Okay.
  914. 37:34All right. So, uh we'll go through a
  915. 37:36bunch of signals. These are the signals
  916. 37:38that exist on your um on the advanced
  917. 37:41peripheral bus. You have a clock, right?
  918. 37:44Just one bit. Everything here is going
  919. 37:46to be clocked on the positive edge.
  920. 37:48There's the advanced peripheral address.
  921. 37:50So, this is the address of the
  922. 37:52registers. Okay, it's going to be uh in
  923. 37:55our world, it's going to be 32 bits.
  924. 37:57Then you have the pite signal. This is
  925. 38:00just binary high or low. And it's just
  926. 38:02defining is this a write operation or a
  927. 38:05read operation. And that's essentially
  928. 38:08the same as is this a store or a load.
  929. 38:10They could have called it store and
  930. 38:11load, but because it's its own spec,
  931. 38:12they're going to use a different
  932. 38:13terminology.
  933. 38:15Then you have a p data. There's also a
  934. 38:17read data bus. We'll show that later,
  935. 38:19but this is going to be 32 bits. And
  936. 38:21typically what you're shown is that
  937. 38:23there's um you know there's some data.
  938. 38:26And this is how we'll just we'll put
  939. 38:28some hex value here or hex value here
  940. 38:30just to indicate that uh there is data
  941. 38:33there and what that data would be.
  942. 38:36So one caveat. So the P address is
  943. 38:39probably not 32 bits wide in the real
  944. 38:41world, right? It's a good teaching
  945. 38:43mechanism for 373, but think about what
  946. 38:45you need to do. The the P adder address
  947. 38:48line only needs to have enough bits to
  948. 38:51cover the possible peripheral addresses,
  949. 38:53right? So it's unlikely you're going to
  950. 38:56have 4 gigabytes worth of uh peripheral
  951. 38:59addresses. It's going to be some smaller
  952. 39:01number. And so the what happens is that
  953. 39:04in this little state machine you have
  954. 39:06your address space. The core is sending
  955. 39:09out some addresses and then the
  956. 39:11requesttor maps it to a subset of those
  957. 39:14uh those possible numbers into a P
  958. 39:17address space and you will never see
  959. 39:19that P address space on your little
  960. 39:21microcontroller or your IDE. That's
  961. 39:23abstracted away. It's important to kind
  962. 39:25of understand how the microcontrollers
  963. 39:28and this processors work. But just a
  964. 39:30caveat, there's probably not 32 bits. In
  965. 39:33fact, you can go in the um the data
  966. 39:37sheet and there's about uh 4,800 or so
  967. 39:40different distinct memory mapped
  968. 39:42registers in the peripherals. So, you
  969. 39:45don't need 32 bits to represent every
  970. 39:46one of those registers. You probably
  971. 39:48only need 13 bits. So here I'm just
  972. 39:50saying that in reality the address lines
  973. 39:53only is probably 32 or 13 bits wide
  974. 39:56because you just don't need to represent
  975. 39:57every possible address that the
  976. 40:00microcontroller could address. Um but
  977. 40:02for simplicity uh and what we're trying
  978. 40:05to do here we'll just say it's the
  979. 40:06memory address equals the P adder
  980. 40:08address. It makes everything a lot
  981. 40:10simpler. Just when you go into industry
  982. 40:12just remember that those are not exactly
  983. 40:14the same. They just don't need to be the
  984. 40:15same.
  985. 40:17I'm sure that was confusing. What
  986. 40:18questions you have?
  987. 40:26Yes. Thank you.
  988. 40:33>> Yeah, it's just it's just a visual
  989. 40:35indication that the bus had certain data
  990. 40:36on it and then we went to some other
  991. 40:38data and it's showing you that there is
  992. 40:39a transition that occurred.
  993. 40:44I appreciate the question even if it's
  994. 40:46not about the slide. At least I know
  995. 40:47he's engaged.
  996. 40:51All right. Uh then we have some other
  997. 40:53bus structures here. So or bus signals.
  998. 40:55So P select that is kind of like a uh
  999. 40:58chip select although it's on the device.
  1000. 41:00And so P select is selecting the entire
  1001. 41:04peripheral or the entire completer. Now
  1002. 41:07remember that the completer itself uh
  1003. 41:10can have multiple registers and multiple
  1004. 41:12addresses inside of it. So basically
  1005. 41:14you're saying here's this big logical
  1006. 41:16block of uh you know combinational logic
  1007. 41:19and I'm going to turn this I'm going to
  1008. 41:21tell this entire thing okay I'm going to
  1009. 41:23select you versus the other peripherals
  1010. 41:25and then look at the particular address
  1011. 41:27inside and I'll send you um some data.
  1012. 41:31Okay
  1013. 41:34P enable basically is enabling uh saying
  1014. 41:38that the the transition is ready or the
  1015. 41:41the bus is ready. So, we'll talk about
  1016. 41:43this in a second, but there's a setup
  1017. 41:45phase and then an execution phase or
  1018. 41:47action phase. And the P enable says the
  1019. 41:50data on the bus is ready for the
  1020. 41:52peripheral to interact with. And P ready
  1021. 41:54is a signal that's generated by the
  1022. 41:56peripheral uh or we could say target or
  1023. 41:59completer. And this indicates that the
  1024. 42:02task it's supposed to do is done and
  1025. 42:04it's ready to move on to the next thing.
  1026. 42:07More precisely, well, we'll get to the
  1027. 42:08next one. All right. All right. So,
  1028. 42:10let's go through this example here. We
  1029. 42:12have the setup phase. So, the address,
  1030. 42:15you see that bus change symbol. It
  1031. 42:17doesn't matter what the data was before,
  1032. 42:18but the address has been put onto the
  1033. 42:20bus. The right condition has been set
  1034. 42:23either high or low. That indication
  1035. 42:25there where it's double, that just means
  1036. 42:27it's undefined. And then P select has
  1037. 42:30gone uh high telling that particular um
  1038. 42:33peripheral that okay, it's I'm talking
  1039. 42:35to you.
  1040. 42:37And then when those things are set in a
  1041. 42:39setup phase, then P enable goes high
  1042. 42:42telling the peripheral, okay, all that
  1043. 42:44data is ready and T3 is your time to do
  1044. 42:46action. Either I'm going to read data
  1045. 42:48out of you or I'm going to put data uh
  1046. 42:51into you. So it's your time to latch
  1047. 42:53that thing in. And then P ready uh
  1048. 42:56doesn't matter if it's high or low here.
  1049. 42:58It's just saying it could be either.
  1050. 42:59doesn't matter because it only is valid
  1051. 43:02uh to for the uh uh the requester to
  1052. 43:07think about or to measure when p enables
  1053. 43:09high. That's the only time that's valid.
  1054. 43:11So here it's saying I am ready and on t3
  1055. 43:13it will clock in that data.
  1056. 43:17So the spec is this two-phase. Oh it's
  1057. 43:20uh set up and access phase. So you set
  1058. 43:22up and then you access either at T3
  1059. 43:26you're putting data in or taking data
  1060. 43:27out.
  1061. 43:31Uh, yep. And then you're latching data
  1062. 43:32in. And then this would just repeat.
  1063. 43:34Then you would go to the next one. You
  1064. 43:35do another setup phase, another access
  1065. 43:37phase. So maybe there's multiple reads
  1066. 43:39to one peripheral or it'll go to a whole
  1067. 43:42another peripheral. And then P select
  1068. 43:43will be diserted. It'll choose a
  1069. 43:46different P select, different addresses
  1070. 43:47will be um uh put on the bus. Different
  1071. 43:50data will be put on the bus.
  1072. 43:54>> Yeah.
  1073. 43:54>> So are you using the P select to
  1074. 44:02Yeah,
  1075. 44:06>> correct. So, so you could imag you could
  1076. 44:09design this protocol to do other things
  1077. 44:11as well. It's not like this is the only
  1078. 44:12way to do it, but they're trying to be
  1079. 44:14safe in the sense that there's a setup
  1080. 44:16phase which guarantees the buses uh
  1081. 44:18stable and then there's this access
  1082. 44:20phase where data is actually latched in.
  1083. 44:28And this slide just more for you guys
  1084. 44:30just to have it written out what's going
  1085. 44:32on. Um so here we'll do we'll wire up
  1086. 44:35what it looks like for two devices here.
  1087. 44:37So um every device gets there's one p
  1088. 44:42data path which means the requester
  1089. 44:44sends the same data to everything. Now
  1090. 44:46we have to have control lines so that
  1091. 44:48say completer one doesn't actually try
  1092. 44:51to execute when it was completer zero's
  1093. 44:53task and so uh we also have write and
  1094. 44:57enable goes to every device as well.
  1095. 44:59Those lines are shared.
  1096. 45:03The address also goes to every device.
  1097. 45:05Right? What's different is that every
  1098. 45:08one of the completers or the peripherals
  1099. 45:11has its own P select line. So there's
  1100. 45:14one I guess I got my naming my numbering
  1101. 45:16convention wrong here but P select
  1102. 45:18should is going up to completer zero P
  1103. 45:20select one is and P select 2 is going to
  1104. 45:22completer one right so that is how it's
  1105. 45:25telling this particular device now I'm
  1106. 45:27talking to you even though the addresses
  1107. 45:30are going to be uh there you know the
  1108. 45:33addresses are going to be duplicated
  1109. 45:35there could be multiple um resist or
  1110. 45:37registers in there um so address alone
  1111. 45:40is not enough you need to be selected
  1112. 45:42and that's also just a way to like maybe
  1113. 45:44the device is in power down mode or
  1114. 45:46something in some other way and that's
  1115. 45:47just a way way to select it and tell it
  1116. 45:49I'm talking to you and then a clock is
  1117. 45:52provided to all of them shared and then
  1118. 45:55each one has a data path back. So the
  1119. 45:59spec is a specification not a hardware
  1120. 46:03um specification it's a protocol
  1121. 46:05specification. So it says that uh each
  1122. 46:07one of the completers and again there's
  1123. 46:09going to be lots of them on your device
  1124. 46:11has a data pass back that they can put
  1125. 46:13data on whenever they want. There's no
  1126. 46:15bus contention uh going back to the
  1127. 46:18bridge. It's the bridge's responsibility
  1128. 46:20to mx in the correct data uh to look at
  1129. 46:23the right thing. So it's unlikely that
  1130. 46:26there actually for everyone there's a
  1131. 46:2732-bit bus going back there probably
  1132. 46:29have MXes defined somewhere in the
  1133. 46:32hardware. But for the purpose of the
  1134. 46:34spec, each one of those has a 32-bit bus
  1135. 46:37back to the uh the bridge or the
  1136. 46:39requester.
  1137. 46:48>> Yes.
  1138. 46:59>> No, the hardware manufacturer does. So
  1139. 47:01you as a user, this is um part of the
  1140. 47:05class where like I need to teach you
  1141. 47:07things that you'll never see, right?
  1142. 47:09Otherwise, everything just becomes
  1143. 47:11magic. That is one of the problems with
  1144. 47:12this class is that uh we're in lecture
  1145. 47:15specifically, I'm trying to teach you
  1146. 47:16the low level so you can reason about
  1147. 47:18how chips work for the rest of your
  1148. 47:19life. However, the tools have gotten so
  1149. 47:22complicated that they just wizzywig
  1150. 47:23everything for you and then you just
  1151. 47:25hope it works, right? And then it
  1152. 47:26becomes to the point of like you'll get
  1153. 47:28I I've certainly done this where I just
  1154. 47:30trusted the tools to the point where
  1155. 47:31they break and I can't get anything
  1156. 47:32done. Well, hopefully this background
  1157. 47:34will will help you reason through it.
  1158. 47:37And then then you would go to like the
  1159. 47:39GNU tools and you could get, you know,
  1160. 47:41full control over every last little
  1161. 47:43parameter if you had to.
  1162. 47:46Any other questions? We're going to go
  1163. 47:47through an example shortly.
  1164. 47:50What? I must have missed something here.
  1165. 47:52Oh, pre ready. Whoops. uh P ready. Each
  1166. 47:55individual device has a P ready that's
  1167. 47:57going to dictate when uh the completer
  1168. 48:00is done with its task, right? When it's
  1169. 48:02ready to move on. And we showed a two
  1170. 48:05access phase or was it one setup phase
  1171. 48:07and one access. We'll see later that the
  1172. 48:10access phase could take longer. It's
  1173. 48:12there's no requirement that it only
  1174. 48:13takes one cycle.
  1175. 48:17All right. So, let's Oh, and then
  1176. 48:18specifically, I kind of showed this
  1177. 48:20before. We're specifically talking about
  1178. 48:21the interaction between the bridge here,
  1179. 48:24the advanced high performance bus to the
  1180. 48:27advanced peripheral bus. That is the
  1181. 48:29requester and then the peripherals are
  1182. 48:32the completers just to make it clear.
  1183. 48:36All right. So let's go through an
  1184. 48:39example here.
  1185. 48:41Let's see.
  1186. 48:44So what we're going to do here is we're
  1187. 48:45going to have try and link code to
  1188. 48:48what's happening on these bus
  1189. 48:49transactions. So we have actually I'll
  1190. 48:53send hand these out [sighs] get started.
  1191. 48:55So I'm going to try let's see can you
  1192. 49:01just pass one for your row here and then
  1193. 49:03pass that up. Get one for your row and
  1194. 49:06oh you're going to need more. Pass that
  1195. 49:08up and then I'm going to deputize you
  1196. 49:11for the whole front.
  1197. 49:13And then
  1198. 49:16if you could just pass this way and then
  1199. 49:18up and then I don't know you guys can
  1200. 49:21race. See what happens.
  1201. 49:27Okay. So I'll set the problem up for you
  1202. 49:29since you don't know what you're doing.
  1203. 49:38All right. So assume we have multiple
  1204. 49:39targets here.
  1205. 49:42uh we have device one and device two at
  1206. 49:45these particular address ranges and
  1207. 49:47we're going to execute this code. So
  1208. 49:49store
  1209. 49:51uh the value that is in R0 to location
  1210. 49:55R1 + 4.
  1211. 50:02And then just to review what would that
  1212. 50:04look like if we're looking at just the
  1213. 50:05register in abstract memory? Well, here
  1214. 50:08we have the the device the the the
  1215. 50:12memory region for device one could say
  1216. 50:14peripheral one and the memory region for
  1217. 50:16per uh device two peripheral two and we
  1218. 50:19have our registers and we have some data
  1219. 50:22in memory so or in registers we have
  1220. 50:241,00 and coffee in there and then we're
  1221. 50:27going to do a store. So then we're going
  1222. 50:29to do store the uh the value of R0
  1223. 50:33that's located at R1 plus 4 and we're
  1224. 50:37going to put it into this device. Okay.
  1225. 50:39Right. So now we we see what's going to
  1226. 50:41happen. We know the address of where it
  1227. 50:42went and there's the actual the data
  1228. 50:45that's been sent. And from that I want
  1229. 50:49you to figure to draw in what must have
  1230. 50:52been those bus lines,
  1231. 50:55right? what signals occurred
  1232. 50:58uh to actually that were sent across the
  1233. 51:01APB to accomplish that goal was set up
  1234. 51:04there.
  1235. 51:42I'm on the right.
  1236. 51:45[snorts]
  1237. 51:55I don't know.
  1238. 52:29>> [sighs]
  1239. 52:45>> Thank you.
  1240. 52:52>> [groaning]
  1241. 53:04[snorts]
  1242. 53:24>> Look at
  1243. 53:43[snorts]
  1244. 53:49[snorts]
  1245. 53:50this one.
  1246. 53:59I do not
  1247. 54:20wish
  1248. 54:49>> [clears throat]
  1249. 54:50>> That's
  1250. 54:51So
  1251. 55:22>> [clears throat]
  1252. 55:28>> That's fantastic. That's
  1253. 55:47All right.
  1254. 56:00>> [snorts]
  1255. 56:02[clears throat]
  1256. 56:11>> That's true.
  1257. 56:22Here's
  1258. 56:27what I think.
  1259. 56:49Thank you. [clears throat]
  1260. 56:51[snorts]
  1261. 57:24That makes sense.
  1262. 57:47I don't know what
  1263. 58:24You can just
  1264. 58:32Expressing
  1265. 59:12All right.
  1266. 59:28Thank you.
  1267. 59:55All
  1268. 1:00:07right.
  1269. 1:00:19Oh yeah.
  1270. 1:00:49I think you're ready.
  1271. 1:00:57Are you ready?
  1272. 1:01:08[clears throat]
  1273. 1:01:38>> [groaning]
  1274. 1:01:50>> Brotherhood.
  1275. 1:01:55[clears throat]
  1276. 1:02:11All right, one setup. I should have made
  1277. 1:02:13it a little bit more clear. Oh, now it
  1278. 1:02:16says P. This is I don't know why it says
  1279. 1:02:18P now. The slides got away from me. But
  1280. 1:02:20we have device one or peripheral one,
  1281. 1:02:22device two. This is the signals that
  1282. 1:02:23that device sees. That's what you're
  1283. 1:02:25supposed to be drawing. I should have
  1284. 1:02:27made that clear, but uh I think I saw
  1285. 1:02:29some great answers out there. So, let's
  1286. 1:02:31get started. What is uh address?
  1287. 1:02:35>> Oops, I gave it away. What's the
  1288. 1:02:36address?
  1289. 1:02:380x 4
  1290. 1:02:41>> four. Exactly. Right. Because we did
  1291. 1:02:43post indexing like or indexing right
  1292. 1:02:46there. Right. So it's it's incremented
  1293. 1:02:48the address. And so both devices are
  1294. 1:02:50going to see the same thing. So if we go
  1295. 1:02:52over here, this is kind of like your
  1296. 1:02:55guide. This is a this is the guide. And
  1297. 1:02:58we get to see address is goes the same
  1298. 1:03:01address goes to all devices.
  1299. 1:03:04Okay. Same data goes to all devices.
  1300. 1:03:07It's only certain signals that are
  1301. 1:03:09different per device and then those
  1302. 1:03:11devices react differently. Okay.
  1303. 1:03:19Okay. And then oh I gave it away but
  1304. 1:03:21we're writing right because this is a uh
  1305. 1:03:25store action. So data is going into the
  1306. 1:03:27device and then that is shared. How
  1307. 1:03:31about P select? What's P select for Oh,
  1308. 1:03:33you have a question.
  1309. 1:03:35How do we how do we know when
  1310. 1:03:43>> well okay so for so the specification
  1311. 1:03:46always starts at T1 T0 this the diagrams
  1312. 1:03:49not the actual spec so you just always
  1313. 1:03:51see it this way and for whatever reason
  1314. 1:03:53the diagrams always just start on T1 I
  1315. 1:03:55don't care when if you guys wanted to
  1316. 1:03:57put it at T3 you could but you're going
  1317. 1:03:58to have to draw some extra lines because
  1318. 1:04:00you won't have enough for the access
  1319. 1:04:01space so the exact time occurs doesn't
  1320. 1:04:03really matter
  1321. 1:04:10Ah, so we're going to assume this is a
  1322. 1:04:13two cycle interaction. Um, we didn't
  1323. 1:04:16give you enough information
  1324. 1:04:18for you to know all things. We just know
  1325. 1:04:19that there's a register that's going to
  1326. 1:04:21accept some some data. So now we're
  1327. 1:04:23going to have a a setup phase and then
  1328. 1:04:25an access phase. We'll learn later that
  1329. 1:04:26there's got there's these weight states,
  1330. 1:04:28but yes, you did not have enough
  1331. 1:04:29information to know every aspect of
  1332. 1:04:32this.
  1333. 1:04:34Okay. So, what what is what's the P
  1334. 1:04:37select line for P1 or D1?
  1335. 1:04:46>> Yeah.
  1336. 1:04:51>> Sure. But and how is that contrast to
  1337. 1:04:54device 2 or P2?
  1338. 1:04:57>> This low. Right. So that's one of those
  1339. 1:04:59signals that's different between uh all
  1340. 1:05:03every peripheral gets their own select
  1341. 1:05:04line. And so here we're saying everybody
  1342. 1:05:07got the address but P select selects
  1343. 1:05:09that particular device. So here we saw P
  1344. 1:05:12select go high in the setup phase which
  1345. 1:05:15I arbitrarily chose to start at T1. And
  1346. 1:05:18now that that peripheral is going to
  1347. 1:05:20respond.
  1348. 1:05:22Uh everybody gets P enable. Okay. That's
  1349. 1:05:26just all that is is a signal that says
  1350. 1:05:28the setup phase is done and now you're
  1351. 1:05:30in the access phase.
  1352. 1:05:33What about pite data? What's p data?
  1353. 1:05:38I think I heard it or somebody was
  1354. 1:05:40coughing. What are the two?
  1355. 1:05:51>> What is it the same for both?
  1356. 1:05:53>> Yep. Same for both.
  1357. 1:05:56And then P ready.
  1358. 1:05:58I guess I I underspecified what P ready
  1359. 1:06:00is.
  1360. 1:06:02But what do you think P ready does?
  1361. 1:06:08>> Yeah.
  1362. 1:06:13>> Yeah. So we expect that P1 P ready is
  1363. 1:06:16going to be high at some point. It
  1364. 1:06:18doesn't actually matter what P2 ready
  1365. 1:06:21line does. Um, and here we're just
  1366. 1:06:23showing it could be either thing.
  1367. 1:06:25There's the only time that's valid. It
  1368. 1:06:28only really matters what P ready is is
  1369. 1:06:30when the device has been P enabled.
  1370. 1:06:32That's it. Other times it doesn't
  1371. 1:06:33matter, but at least then we knew it was
  1372. 1:06:35high and then that T3 data was clocked
  1373. 1:06:38in. So coffee gets clocked in. Now those
  1374. 1:06:41people who took like uh 270 or thinking
  1375. 1:06:44about setup and hold time and all that
  1376. 1:06:45other stuff, don't worry. This is just a
  1377. 1:06:47specification, not a hardware
  1378. 1:06:48engineering documentation. Yeah.
  1379. 1:07:00high again.
  1380. 1:07:01>> Uhhuh. So why did it go low? Uh well,
  1381. 1:07:05first of all, uh P select is only only
  1382. 1:07:07matters when it's enabled. And then here
  1383. 1:07:11what I didn't explain it well yet is
  1384. 1:07:13that P uh the P ready is defined by uh
  1385. 1:07:18the peripheral and it just says I have
  1386. 1:07:20clocked the data in this next cycle. The
  1387. 1:07:22data is clocked in and then it's ready
  1388. 1:07:24to for the next instruction. Did that
  1389. 1:07:26answer your question? Maybe you asked
  1390. 1:07:27something different.
  1391. 1:07:30And so we have to have the setup phase
  1392. 1:07:32and then the access phase. The access
  1393. 1:07:34phase we'll see could take longer. Uh
  1394. 1:07:37but then that would be controlled by the
  1395. 1:07:39peripheral.
  1396. 1:07:40>> Yeah.
  1397. 1:07:45>> We are making that assumption.
  1398. 1:07:47>> Because that's the only thing I've
  1399. 1:07:48taught you so far. So I was I should
  1400. 1:07:49have been more clear about that.
  1401. 1:07:54>> Yeah.
  1402. 1:08:02>> Um why is P right? I think it's because
  1403. 1:08:05pite does not matter. This is just their
  1404. 1:08:07documentation but uh p doesn't matter
  1405. 1:08:10because uh it doesn't have to be defined
  1406. 1:08:13at that stage. P select has to be
  1407. 1:08:14deasserted. P select should only go high
  1408. 1:08:16when the device is actually selected.
  1409. 1:08:19But you're right, there's no reason why
  1410. 1:08:20P write couldn't be some other data.
  1411. 1:08:22It's not like it has to be that.
  1412. 1:08:35Why? P1 was the one that went high
  1413. 1:08:38because when the um requester or the
  1414. 1:08:41bridge was interpreting the memory
  1415. 1:08:44access codes that came from the uh
  1416. 1:08:47controller or from the core, right? When
  1417. 1:08:49it said this is the address I want to go
  1418. 1:08:51through, it looked up in that address
  1419. 1:08:52range and said this address range resp
  1420. 1:08:55is to device one or P1 and therefore I
  1421. 1:08:59should only select it. Then it's because
  1422. 1:09:00the address matched that range.
  1423. 1:09:05>> Yeah.
  1424. 1:09:16Is there high transition and uh
  1425. 1:09:19impedance change
  1426. 1:09:20>> impedance change
  1427. 1:09:23uh the impedance change here is in the
  1428. 1:09:26middle
  1429. 1:09:27right and that is essentially saying
  1430. 1:09:29that which is a case we probably will
  1431. 1:09:31not discuss is when the bus disconnects
  1432. 1:09:34through triates disconnects from the
  1433. 1:09:36like the device disconnects from the
  1434. 1:09:37from the bus and the bus impedance or
  1435. 1:09:39the data is undefined it's undriven
  1436. 1:09:43>> uh so I would not worry about high
  1437. 1:09:44impedance or high impedance to stable
  1438. 1:09:47does that answer your question.
  1439. 1:09:49>> Yes.
  1440. 1:09:50>> Okay. You can ask it again in the better
  1441. 1:09:52way that I understand.
  1442. 1:09:55>> Okay.
  1443. 1:09:56>> Ah, yes. That's probably the best answer
  1444. 1:09:58I could have given. Don't worry about
  1445. 1:09:59it. I should probably just I was lazy
  1446. 1:10:02when I copy and pasted that. I could
  1447. 1:10:04just like uh I know crop that out. All
  1448. 1:10:08right. How are we feeling? Any other
  1449. 1:10:09questions?
  1450. 1:10:11>> Yeah.
  1451. 1:10:13>> What does bus stable mean?
  1452. 1:10:15bus stable just means so those gray
  1453. 1:10:17parts are the transition and you're just
  1454. 1:10:19saying that the the data is defined then
  1455. 1:10:25all right so if I wanted to review this
  1456. 1:10:28problem I would think through some of
  1457. 1:10:32like these diagram like read this slide
  1458. 1:10:35come back read this slide to figure out
  1459. 1:10:37what's supposed to be happening in here
  1460. 1:10:39and then knowing where the signals go
  1461. 1:10:42this diagram is is uh describing how
  1462. 1:10:44those signals move around. And then uh
  1463. 1:10:47the part I didn't explain well was just
  1464. 1:10:50that um
  1465. 1:10:53these signals are from the inputs to the
  1466. 1:10:56peripheral. This is what the peripherals
  1467. 1:10:58read. That's what this diagram is trying
  1468. 1:11:00to show you.
  1469. 1:11:02All right. Any other questions?
  1470. 1:11:09>> Yeah.
  1471. 1:11:13ah P uh enable it says um that the
  1472. 1:11:19device or the the data on uh the bus is
  1473. 1:11:23stable and now we're ready to go into
  1474. 1:11:25the access phase. P ready is the only
  1475. 1:11:28signal that comes uh in this diagram is
  1476. 1:11:31the only signal that comes from the
  1477. 1:11:32peripherals. Later on we'll see examples
  1478. 1:11:34where data comes from them and that is
  1479. 1:11:36the response. That's that kind of hand
  1480. 1:11:38shaking that says okay I'm ready to
  1481. 1:11:39clock in the data. I'm prepared to do my
  1482. 1:11:42task.
  1483. 1:11:49>> T1.
  1484. 1:11:53>> So T1 to T T T T T T T T T T T T T T T T
  1485. 1:11:55T T T T T T T T T T T T T T T T T T T T
  1486. 1:11:55T T T T T0 to T T1 is just dead. There's
  1487. 1:11:57nothing really going on. The only thing
  1488. 1:11:58we care about is T1 to T2, which is a
  1489. 1:12:01setup, and then T2 to T3. And then this
  1490. 1:12:04is the next setup for the next cycle. So
  1491. 1:12:06we just go back and forth between setup
  1492. 1:12:08and access.
  1493. 1:12:11Yeah.
  1494. 1:12:23>> Yeah. Um, P select has said you are the
  1495. 1:12:26device that I'm talking to. So, device
  1496. 1:12:28one, it does not matter. And that's kind
  1497. 1:12:31of what the diagram is showing you. It
  1498. 1:12:32doesn't even matter what P Ready is on
  1499. 1:12:34device 2. The the um requester is not
  1500. 1:12:37going to listen to it. is not selected.
  1501. 1:12:49>> Correct. Yep. [snorts]
  1502. 1:12:51Yep. Yeah. And there's no U. If we go
  1503. 1:12:55back here,
  1504. 1:13:02um, it could definitely be the case
  1505. 1:13:03where you have a peripheral that's just
  1506. 1:13:05taking a long time and it's known to
  1507. 1:13:07take a long time and it's going to
  1508. 1:13:09collect its data and send data out when
  1509. 1:13:11it's ready and the requester could go
  1510. 1:13:13and do other tasks, right? And then then
  1511. 1:13:16it will go look to see if P ready has
  1512. 1:13:18gone high. Oh, it's finally high. Fine,
  1513. 1:13:19I'll take the data out of out of this.
  1514. 1:13:21So, there's a lot of things that are
  1515. 1:13:22slow. temperature reading is slow.
  1516. 1:13:24Talking on serial buses is slow. All
  1517. 1:13:26these things are slow. So it just is a
  1518. 1:13:29basically you can imagine it's an
  1519. 1:13:30interrupt to the requester that says
  1520. 1:13:32okay now uh this thing is done.
  1521. 1:13:40What other questions do we have? Yeah.
  1522. 1:13:53Correct. Yep. You can only read and
  1523. 1:13:55write to one peripheral at a time. That
  1524. 1:13:57is the difference between um the high
  1525. 1:14:00performance bus and the peripheral bus.
  1526. 1:14:02The high performance bus lets there's
  1527. 1:14:04multiple what they call lanes or
  1528. 1:14:06channels. So multiple transactions can
  1529. 1:14:08occur. The peripheral is just one
  1530. 1:14:10requesttor to multiple uh completers and
  1531. 1:14:13just one at a time.
  1532. 1:14:17All right.
  1533. 1:14:18Let me get through one or two more
  1534. 1:14:21slides and then we can call it. Um, all
  1535. 1:14:24right. So, what's inside? What's
  1536. 1:14:25literally inside these things? We talked
  1537. 1:14:27a little bit about it. There is a bus
  1538. 1:14:29interface, right? There's the bus,
  1539. 1:14:31there's some bus logic and then there's
  1540. 1:14:34uh some custom logic that thing is
  1541. 1:14:36doing. So, we'll kind of go through that
  1542. 1:14:37example. So, here we have an external
  1543. 1:14:40LED that we're trying to light. Okay.
  1544. 1:14:43And the prompt of this is say I want to
  1545. 1:14:45control an LED which is connected to a
  1546. 1:14:47GPO pin a single GPO pin um with the
  1547. 1:14:51lowest significant bit of this 32-bit
  1548. 1:14:53register. So how this is that kind of
  1549. 1:14:56front matter. How do we get this
  1550. 1:14:57peripheral to respond to the correct
  1551. 1:14:59addresses and the and the correct bus
  1552. 1:15:01traffic. So first we got to wire it up.
  1553. 1:15:04So there's a lot of wiring. So we got P
  1554. 1:15:06write data now all 32 bits because
  1555. 1:15:08that's a 32-bit register just because
  1556. 1:15:10it's set it and I use some nomenclature
  1557. 1:15:12here where I have the little uh zero
  1558. 1:15:14through 31 and this bus slash shows it's
  1559. 1:15:1632 uh wide and then I have to connect
  1560. 1:15:20the output of that to this uh to this
  1561. 1:15:22GPO pin which happens to be connected to
  1562. 1:15:24LED and I'm going to denote that it's a
  1563. 1:15:26single line and I'm going toote that
  1564. 1:15:28it's a zeroth line a zeroth register
  1565. 1:15:31output
  1566. 1:15:33P clock is going to go
  1567. 1:15:35I mean there are technically different
  1568. 1:15:36ways to architect this but we're just
  1569. 1:15:38showing you one example. So here what
  1570. 1:15:41has to be true for this have to be true
  1571. 1:15:42you'd have to have right would have to
  1572. 1:15:44be high enable would have to be high p
  1573. 1:15:46select would have to be high and the
  1574. 1:15:49correct address I haven't defined what
  1575. 1:15:50the address is but you could use an
  1576. 1:15:52andgate uh here we're just looking at
  1577. 1:15:54the lowest eight bits so I don't have to
  1578. 1:15:55draw 32 little bubbles
  1579. 1:15:58and then if both those are true then
  1580. 1:16:01we're going to enable the uh d flip-flop
  1581. 1:16:04here or register bank to accept new data
  1582. 1:16:07into it without that enabled down you
  1583. 1:16:09know the enable is always high then
  1584. 1:16:11every clock cycle will take whatever
  1585. 1:16:12data is on the bus but we have to only
  1586. 1:16:14enable that to accept new data when
  1587. 1:16:17those conditions are met
  1588. 1:16:19and then in this particular case because
  1589. 1:16:21we know the architecture this will
  1590. 1:16:23happen immediately so P ready can be
  1591. 1:16:25held high immediately at all times just
  1592. 1:16:28because we know this will execute on the
  1593. 1:16:30first access phase there's no reason to
  1594. 1:16:32wait
  1595. 1:16:36how's that
  1596. 1:16:39Do you think that logic would work? Do
  1597. 1:16:41it satisfy the timing diagram?
  1598. 1:16:45>> Yeah.
  1599. 1:16:52>> Uh the purpose is I didn't define an
  1600. 1:16:54address but it purpose is just to mask
  1601. 1:16:56out a particular address. So this
  1602. 1:16:58register is located at some location.
  1603. 1:17:01Yeah. And uh and you could imagine a
  1604. 1:17:04peripheral with multiple 32-bit
  1605. 1:17:05registers and then you'd have to turn on
  1606. 1:17:07each individual register.
  1607. 1:17:11>> All right, we'll go through one more
  1608. 1:17:12slide and I'll let you guys go. Maybe
  1609. 1:17:14two more slides, I don't know. So here's
  1610. 1:17:16the example with multiple registers.
  1611. 1:17:19Um we have two and then there's
  1612. 1:17:21different addresses ranges. So reg a
  1613. 1:17:24should only respond to 1,00 reg B should
  1614. 1:17:27only respond to 1004. These are in the
  1615. 1:17:31same peripheral. So P select can no
  1616. 1:17:33longer make that selection for us. P
  1617. 1:17:35select just says this peripheral should
  1618. 1:17:37turn on. So we need some other mechanism
  1619. 1:17:40to enable this to tell which register
  1620. 1:17:43should be uh enabled to accept data.
  1621. 1:17:47So here we'll use the same mechanism. We
  1622. 1:17:49can use a simple andgate. Now we'll have
  1623. 1:17:52two different uh adders.
  1624. 1:17:55And uh you can see that I was very
  1625. 1:17:56clever and I have one bubble missing.
  1626. 1:17:59I'll give you a better mechanism so you
  1627. 1:18:00don't have to do this on the exam but
  1628. 1:18:02there's this one bubble missing and now
  1629. 1:18:04we're going to say when these is true
  1630. 1:18:06and these things are true then we're
  1631. 1:18:07going to enable that and the contrary is
  1632. 1:18:11when this is true and this is true this
  1633. 1:18:13is going to be enabled so basically you
  1634. 1:18:16have to be writing the uh uh peripheral
  1635. 1:18:20has to be selected enable has it has to
  1636. 1:18:22be enabled to get to the top one it has
  1637. 1:18:25to have the right address or and if you
  1638. 1:18:27want to go to the bottom one it has have
  1639. 1:18:28to have the right address. It could be
  1640. 1:18:30some other address. And if it's not one
  1641. 1:18:32of those two, then nothing will happen.
  1642. 1:18:34Okay?
  1643. 1:18:36Then uh data is going to come in 32 bits
  1644. 1:18:38wide. That's what's going to get clocked
  1645. 1:18:40in. If all those things are valid, those
  1646. 1:18:42get clocked in. And in this particular
  1647. 1:18:44case, because it's just a register, it
  1648. 1:18:46can do this in one access cycle. It does
  1649. 1:18:48not need a wait state. It doesn't need
  1650. 1:18:50anything longer. So P ready can just be
  1651. 1:18:52pulled high.
  1652. 1:18:59Yeah.
  1653. 1:19:09>> Oh, why is there a bubble weird bubble
  1654. 1:19:11logic there? So, that's trying to mask
  1655. 1:19:13for four. The other one's masking for
  1656. 1:19:16zero.
  1657. 1:19:17And then the last slide I'll show you
  1658. 1:19:20here is when we when you do your
  1659. 1:19:22homework or there's exam I just try to
  1660. 1:19:23make some easier notation for you. So
  1661. 1:19:25instead of doing bubble logic which is
  1662. 1:19:27horrible. Don't do bubble logic. I can't
  1663. 1:19:29read it. You can't write it fast enough.
  1664. 1:19:31Just write down the word and add or mask
  1665. 1:19:33and just write down the thing you're
  1666. 1:19:35masking for in binary and that'll make
  1667. 1:19:37it easy for me. Or you could do it in
  1668. 1:19:38hex. I don't care. Uh and then these are
  1669. 1:19:41the different versions of d flip-flops.
  1670. 1:19:44They all you know you can have ones with
  1671. 1:19:45enable. You could have reset if you
  1672. 1:19:46want. You could take reset away. And
  1673. 1:19:48then please on your homeworks and your
  1674. 1:19:50exams to tell us how big these lines
  1675. 1:19:52are. Right? So eight bits. If you're
  1676. 1:19:55going to split lines apart, tell us
  1677. 1:19:57where the bits go. And then you get
  1678. 1:19:59logical.

About this transcript

This page contains the full transcript of EECS 373 - Fall 2026 - Lecture 4: “Memory Mapped IO / APB Bus by Interactive Sensing and Computing Lab , generated from the public captions YouTube serves with the video. The transcript has 11,268 words across 1,678 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.