YouTube2Text

EECS 373 - Fall 2026 - Lecture 15: "DACs" — Transcript

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

Full transcript

  1. 0:00All
  2. 0:02right.
  3. 0:12All right, we're going to get started.
  4. 0:14Let's see here.
  5. 0:17All right, so
  6. 0:19I talked to almost all of you. 30 groups
  7. 0:21is a lot. We saw some more
  8. 0:23group discussions to go through,
  9. 0:26but because we changed schedule around a
  10. 0:28little bit
  11. 0:30Project
  12. 0:31revisions are due on Friday. Please
  13. 0:34label your revised project proposal as
  14. 0:37revision so we can look at the delta
  15. 0:39between the first and the second. You're
  16. 0:40only really graded on the second and
  17. 0:42really the purpose of the project
  18. 0:44proposal is to force you to think
  19. 0:46through all the pieces of your project
  20. 0:50and kind of get your head around the
  21. 0:51scope.
  22. 0:52The thing I want you all to think about
  23. 0:54in the like the next week or so is
  24. 0:57and maybe next two weeks is really you
  25. 0:58need to
  26. 0:59You have a very vague notion of some
  27. 1:01aspects of your project and you need to
  28. 1:02start getting line of sight on them and
  29. 1:04understanding how complicated they are.
  30. 1:07How does it really work? If you can't
  31. 1:09gauge how much work is ahead of you,
  32. 1:11you're in a lot of trouble. So if maybe
  33. 1:13you have lots of questions about how
  34. 1:15your wireless module is going to work
  35. 1:16and it feels like a opaque black box and
  36. 1:18it's horrible, right? Like it's just
  37. 1:19complete unknown. You don't know
  38. 1:21anything about RF, well start doing some
  39. 1:23research online, get the parts, go talk
  40. 1:25to James, go talk to me or the IAs and
  41. 1:28get that information so it's not
  42. 1:29overwhelming so you know like how much
  43. 1:31work is it going to take to get that
  44. 1:33done.
  45. 1:34I worry when there's unknowns in your
  46. 1:36mind and then you get to like a week
  47. 1:38before the deadline and you just haven't
  48. 1:39even started it. That's usually a recipe
  49. 1:41for disaster.
  50. 1:44Okay.
  51. 1:46Oh, anyways, yeah. So the revised
  52. 1:47version put it in your project folders.
  53. 1:50Homework 7 is due on Monday. It's going
  54. 1:52to be on DAX.
  55. 1:56And then the homework solutions for
  56. 1:59homework 7 were released today and
  57. 2:00there's um
  58. 2:02uh practice exams online uh right now.
  59. 2:06And we have our fi- second fi- or second
  60. 2:08midterm uh next week, so a week from
  61. 2:11Friday in Dow. I promise I will actually
  62. 2:15check it to see if you can complete it
  63. 2:17on within the scope of the time.
  64. 2:19I'll even ask other people to check it.
  65. 2:22I mean we all uh
  66. 2:24uh not all the IAs got to look at it,
  67. 2:25but me and um
  68. 2:26James did and uh I think we just made it
  69. 2:29a little bit too long.
  70. 2:30Uh it's going to be the same kind of
  71. 2:31format. You'll get a data sheet, maybe
  72. 2:33that Wednesday beforehand. We'll have a
  73. 2:35review time in class where we'll go over
  74. 2:38the data sheet. We'll do a review of the
  75. 2:39exam. So, it shouldn't be very different
  76. 2:42from what you're already seeing um
  77. 2:46uh on your practice exams.
  78. 2:47Any questions so far?
  79. 2:53Uh and then next week after the exam,
  80. 2:55we're going to do student presentations,
  81. 2:57so there's documentation should be
  82. 2:58posted online. Um basically, these are
  83. 3:01you will come up for
  84. 3:03haven't figured exact time, but say 12
  85. 3:05to 15 minutes. Your team will talk about
  86. 3:07some piece of technology. So, this is an
  87. 3:08opportunity for you to deep dive, learn
  88. 3:11about some piece of embedded systems,
  89. 3:12then you will present to the rest of the
  90. 3:13class, so the rest of the class will
  91. 3:15learn about uh that piece of embedded
  92. 3:16system. So, an example would be how does
  93. 3:19XB work? So, a lot of people have
  94. 3:20wireless on their uh projects. Uh so,
  95. 3:23having a team describe how to interface
  96. 3:26with XB and get it working is benefit
  97. 3:28for the entire group or of entire class,
  98. 3:30so we'll probably have that team go
  99. 3:31earlier. And if it's I know there's a
  100. 3:33team that's going to use like a magnetic
  101. 3:35strip reader. Not many people are going
  102. 3:36to use that. It's still good knowledge
  103. 3:37to know, so we'll probably have that
  104. 3:39person go in the end. So, it's twofold.
  105. 3:41First, it helps you as part of your
  106. 3:43program requirements, uh present, uh you
  107. 3:45know, get feedback on presenting skills.
  108. 3:47Um it also helps teach the rest of the
  109. 3:49class about some nuanced piece of
  110. 3:52hardware.
  111. 3:53Um I typically assign topics based on
  112. 3:57your project proposals trying to load
  113. 3:58balance across um
  114. 4:01uh
  115. 4:02you know, all the teams not everybody
  116. 4:04can obviously do wireless, uh but try
  117. 4:06and load balance against the projects.
  118. 4:08Um
  119. 4:10if you're if you get assigned a topic
  120. 4:12and it seems completely weird, like
  121. 4:13that's not part of your project, just
  122. 4:15let me know.
  123. 4:16And then I and James will do practice
  124. 4:18presentations with you. We you'll come
  125. 4:19for like 15 minutes and just give it
  126. 4:21give it a practice talk and we'll give
  127. 4:23you feedback on like how to improve it,
  128. 4:25uh how to make it better for a general
  129. 4:26audience, all those sorts of things.
  130. 4:28And then while you're doing practice
  131. 4:30talks, man you know,
  132. 4:32uh attendance is required and you will
  133. 4:34be your there will be a peer grading
  134. 4:36component to this. Well, people will be
  135. 4:37voting, ranking, and those sorts of
  136. 4:39things and giving feedback. Um
  137. 4:42yeah, any questions?
  138. 4:48Oh.
  139. 4:49Okay.
  140. 4:51And so as you can see, we're getting to
  141. 4:52the end of the semester. Things are
  142. 4:54going to change, so we got our midterm
  143. 4:55coming up next week.
  144. 4:57Do a little bit of PCB design, some
  145. 4:59extra work, and then it's student
  146. 5:00presentations. And then I'm not exactly
  147. 5:03sure when the presentations are going to
  148. 5:04start stop. I haven't uh filled out the
  149. 5:06entire schedule.
  150. 5:08But uh after at least after
  151. 5:10Thanksgiving, there's no formal class
  152. 5:12anymore. This is just dedicated time for
  153. 5:14you to uh do your projects. I have
  154. 5:17milestone meetings milestone meetings
  155. 5:19are typically
  156. 5:21uh by request. Either I'm requesting of
  157. 5:23you to come and talk to us, or you're
  158. 5:25requesting to meet with one of us um
  159. 5:27outside of like just uh catch James or
  160. 5:29the IAs in the lab. So those are not
  161. 5:31inherently mandatory for everyone.
  162. 5:34Um and then we have the expo is going to
  163. 5:36take it'll be outside of class time.
  164. 5:39Um like it'll be on that Wednesday, but
  165. 5:40because there are so many
  166. 5:42uh students this semester, it's going to
  167. 5:44have to start earlier and end later. You
  168. 5:46at least need to have somebody there to
  169. 5:48man your booth. I understand someone
  170. 5:49might have class at a different time.
  171. 5:51But uh that's what we're uh we're going
  172. 5:53to have to
  173. 5:54well, it's going to have to be outside
  174. 5:55of class time. We can't just completely
  175. 5:57limit it to class time.
  176. 5:59All right, any logistics questions?
  177. 6:06I'm not that well organized. You must
  178. 6:07have questions.
  179. 6:12Okay.
  180. 6:14All right. So, this set of lectures
  181. 6:16we've been talking about
  182. 6:18analog trying to get these analog
  183. 6:19signals into the digital world and vice
  184. 6:21versa. We've talked about analog signals
  185. 6:23in general and then ADCs and now we're
  186. 6:25going to talk about DACs, which are
  187. 6:26digital to analog converters. There's
  188. 6:29several different types and then the
  189. 6:30specific ones that you have on your
  190. 6:32device.
  191. 6:33Oh.
  192. 6:36Uh there's some good references.
  193. 6:38So, DACs, the equivalent mental model
  194. 6:40here is, you know, a function generator.
  195. 6:43This is going to be able to produce
  196. 6:45arbitrary waveforms. That's the goal
  197. 6:47under certain limitations. So, you want
  198. 6:49a device that is sure can do an like a
  199. 6:52digital value. Sorry, not digital value.
  200. 6:54Like a analog voltage value, but really
  201. 6:56it's more about doing time series
  202. 6:58things. So, can you make a sine wave or
  203. 7:00a square wave or a triangle wave or some
  204. 7:02arbitrary thing? And so, the function
  205. 7:04generator you have there is very um
  206. 7:07capable,
  207. 7:08but your little microcontrollers are
  208. 7:10also pretty capable in the sense that it
  209. 7:12can go up to several megahertz. This is
  210. 7:14maybe 20 megahertz is pretty standard
  211. 7:16for a cheap benchtop piece of equipment.
  212. 7:18And this one will go to like plus or
  213. 7:19minus 20 volts. Your little DAC will
  214. 7:21only go like plus or minus zero to three
  215. 7:24volts or 3.3 volts. So, different in
  216. 7:26range and you could probably adjust that
  217. 7:28if you had an amplifier on the output,
  218. 7:30but
  219. 7:31uh that is essentially what your
  220. 7:32microcontroller can do is arbitrary
  221. 7:34functions.
  222. 7:35Um and then there's lots of nuance about
  223. 7:37how to get that to work.
  224. 7:39Um the other alternative way of looking
  225. 7:40at this is just a just a speaker, right?
  226. 7:42So, when you think about
  227. 7:44uh you know, the headphone jack, all
  228. 7:46those jacks and microphone accessories
  229. 7:49on your consumer electronics are just
  230. 7:50highly optimized ADCs and DACs and
  231. 7:53usually they're optimized cuz they're
  232. 7:54trying to target specifically the audio
  233. 7:57band and how humans hear in
  234. 8:01uh sound. So, that that's slightly
  235. 8:02different than just an arbitrary
  236. 8:03function generator or arbitrary
  237. 8:06ADC.
  238. 8:08So, as you can imagine, we're
  239. 8:09essentially going to be doing the
  240. 8:10opposite of an ADC. Here, you're going
  241. 8:12to have some digital code, right? Some,
  242. 8:15uh, binary values that are going to, uh,
  243. 8:17be turned into an analog value. Now, it
  244. 8:19should be clear like this is just one
  245. 8:21point on that sine wave and you would be
  246. 8:23changing that bit value over time to
  247. 8:26approximate a sine wave. Uh, it's not
  248. 8:27that you just put one value like that
  249. 8:29binary code that yields a sine wave. Um,
  250. 8:32but that's the idea is you have some
  251. 8:34digital input it'll be turned into an
  252. 8:35analog output.
  253. 8:38Uh,
  254. 8:39yeah. Any
  255. 8:42questions?
  256. 8:44Okay. So, when we talked about, uh,
  257. 8:46ADCs, we had all these caveats about
  258. 8:49like, "Oh, we had the sample and hold
  259. 8:51circuit." We had to figure out why we
  260. 8:52wanted to have a sample and hold
  261. 8:54circuit. We talked about, "Hey, wait a
  262. 8:56second, if it's a really weak signal,
  263. 8:58right? Maybe it won't be able to charge
  264. 9:00up the input capacitor and we'd have to
  265. 9:01have special caveats for that." And then
  266. 9:04I said, "Oh, you know, maybe, uh, as I
  267. 9:06sample the thing, I'm going to have to
  268. 9:08hold it, uh, because the, um, the
  269. 9:12conversion process is going to take a
  270. 9:13while."
  271. 9:14Um, so we have those same sort of ideas
  272. 9:17related to, uh, DACs. So, one of them is
  273. 9:19loading effects.
  274. 9:21So, remember the DAC is trying to drive
  275. 9:23a signal outside of the device.
  276. 9:25And so, the way to think about loading
  277. 9:27effects here are just a simple voltage
  278. 9:29divider. Here, we have a a DAC module,
  279. 9:31has some finite resistance, and then you
  280. 9:34have a load that has some finite, uh,
  281. 9:36amount of resistance. And so, ideally,
  282. 9:38you would say that your, uh, DAC would
  283. 9:39have, uh, zero source resistance. That
  284. 9:42would be the best. And it's just not
  285. 9:43possible, but that's what you'd want.
  286. 9:45And you want your load resistance to be,
  287. 9:47you know, infinite, really, really high.
  288. 9:49And that would be nice, uh, and then
  289. 9:50whatever voltage you put out on the V
  290. 9:52desired would be the voltage output. You
  291. 9:54can you can look at the math there and
  292. 9:56figure that out. Um, but the reality is
  293. 9:58that, uh, the load is not going to be
  294. 10:01finite. It's going to be some value and
  295. 10:03it could be capacitive or inductive,
  296. 10:04which would also create, uh, challenges.
  297. 10:06So, can you guys take like 30 seconds
  298. 10:09and tell me what are some what are some
  299. 10:11things that have uh standard loads or
  300. 10:13even hard loads to drive?
  301. 10:16Take Take 30 seconds, talk amongst
  302. 10:17yourself.
  303. 10:31>> [clears throat]
  304. 10:42[clears throat]
  305. 10:55>> What do you think? What would be a load
  306. 10:57that you'd have to drive typical
  307. 10:58embedded systems with a DAC?
  308. 11:07Yeah.
  309. 11:08Speakers. What's the resistance of a
  310. 11:09speaker typically?
  311. 11:164 8 ohms. Yeah, so 8 16. Depends like
  312. 11:19home speakers for some reason I think
  313. 11:20are like 8 and like car speakers are 16
  314. 11:22or something like that. Maybe it's 4 and
  315. 11:248. Like you know, it's kind of
  316. 11:26surprising. Why are they so low? Well,
  317. 11:28they're actually inductors.
  318. 11:29Uh there's inductive mode There's an
  319. 11:30inductive element that's trying to push
  320. 11:32this uh magnet back and forth.
  321. 11:34Um what are some But that's really
  322. 11:36small, right? So, if you have 8 here and
  323. 11:38anything over there, right? You're going
  324. 11:40to get a
  325. 11:41anything even high, you're going to get
  326. 11:43something less than your desired
  327. 11:44voltage. Now, you're going to have to
  328. 11:45have some amplification. So, imagine
  329. 11:47here that our load is very a small
  330. 11:49number. Uh
  331. 11:51So, okay. So, some standard loads like
  332. 11:53just even a GPIO pin on a
  333. 11:55microcontroller is like 100k.
  334. 11:57Um which is not that bad, but if you're
  335. 12:01trying to do some exact measurement,
  336. 12:02it's fine. Uh it can be a problem. A
  337. 12:05capacitor, anything with capacitance is
  338. 12:07hard.
  339. 12:08Um so, there's a lot of different loads
  340. 12:09that could be a problem.
  341. 12:12And so, the way to get around that
  342. 12:14is
  343. 12:15um you can use a voltage buffer. So this
  344. 12:17is kind of like the same topology that
  345. 12:19you saw inside a um
  346. 12:23uh
  347. 12:24the sample and hold circuit. It's just
  348. 12:26that here we're trying to buffer the
  349. 12:27output. So whatever is there on our
  350. 12:29source is that input into V V in is very
  351. 12:32very small. So the desired
  352. 12:35the drop is going to be zero or nearly
  353. 12:37zero cuz there's no current going
  354. 12:39through R0. And then the op-amp is
  355. 12:41taking the responsibility of driving as
  356. 12:43much current as required to drive that
  357. 12:45load. So here aside from the
  358. 12:48inaccuracies in the op-amp um
  359. 12:51uh you're going to get V out is going to
  360. 12:52be the same as V in or V desired. So
  361. 12:55that's a that's the value of that.
  362. 12:58And so we can look at this in like a
  363. 12:59little circuit example here.
  364. 13:03Let's see.
  365. 13:06All right. So here I'm going to vary
  366. 13:08these little sliders, vary the value of
  367. 13:10these resistors. Is that true?
  368. 13:13No. Wait. No, for some reason I'm
  369. 13:15varying RS. I don't like that.
  370. 13:18Mhm. Well, that gives you example here.
  371. 13:20Let's try and do this.
  372. 13:23Uh slider.
  373. 13:30All right.
  374. 13:33It did not work. Oh, there we go. Okay.
  375. 13:36R load for both of them. So here as I
  376. 13:38change the resistance you can see that
  377. 13:39this voltage no matter what this
  378. 13:40resistance is is always five and that is
  379. 13:43going to be some other value. So here is
  380. 13:44this you can see here's the challenge
  381. 13:46and it gets much worse if you're trying
  382. 13:47to do like an AC signal into a DAC or
  383. 13:51into a capacitor. You get some weird
  384. 13:53effects or an inductor.
  385. 13:56Okay.
  386. 13:57Any questions on why you would need a
  387. 13:58voltage buffer for an output?
  388. 14:02Is this you people you guys remember
  389. 14:03this from 215?
  390. 14:05Does this seem like intuitive knowledge?
  391. 14:09>> [snorts]
  392. 14:10>> No? You guys Yeah.
  393. 14:12Go ahead.
  394. 14:12>> Yes, sir.
  395. 14:14What's the reason that we just don't
  396. 14:15make the
  397. 14:16uh load very high
  398. 14:20>> You don't have that option. You're
  399. 14:22trying to drive some load. So, if it's a
  400. 14:23speaker, right? Um it could be 8 ohms.
  401. 14:26You don't have a choice.
  402. 14:28Um if you were trying to drive like uh
  403. 14:31you don't really drive motors this way,
  404. 14:32but I mean technically you could.
  405. 14:34There's a lot of weird
  406. 14:35um
  407. 14:36things. I don't know why I can't think
  408. 14:37of any, but like a piezoelectric speaker
  409. 14:39is like is a high impedance thing, but
  410. 14:41slightly capacitive. And then you get
  411. 14:42some a loading conditions.
  412. 14:45Um
  413. 14:47You could even think of like an LED if
  414. 14:48you're trying to do dimming an LED with
  415. 14:50voltage, which is probably the wrong way
  416. 14:51to do it. You would still have some load
  417. 14:53on that that would uh change the output
  418. 14:55voltage.
  419. 14:59Yeah.
  420. 15:06Correct.
  421. 15:08Right. That's true. I forgot to tell you
  422. 15:09why we care. I just started I I just
  423. 15:12knew I cared. I forgot to tell you why.
  424. 15:14We're going to spend the rest of lecture
  425. 15:15trying to make our desired or the output
  426. 15:18of this
  427. 15:19uh thing right here. We're going to
  428. 15:20figure out all these fancy ways to make
  429. 15:22this analog voltage, but then I don't
  430. 15:24want to get corrupted by my load. So,
  431. 15:26that's why we're putting this buffer in
  432. 15:27between.
  433. 15:30It's a good question.
  434. 15:32Okay.
  435. 15:36All right, there's loading effects. So,
  436. 15:37let's talk about like the simplest
  437. 15:40uh possible analog output. In fact, you
  438. 15:42don't even need a full DAC for this. And
  439. 15:44this is a great way if you just need to
  440. 15:46like add a buzzer to your to your final
  441. 15:49project. You're like, "I just need a few
  442. 15:51extra points. I don't want to put time
  443. 15:52and effort into this. I just want to get
  444. 15:54points as fast as possible." This is a
  445. 15:55way to do it.
  446. 15:57You don't even need a DAC.
  447. 15:59Uh like the full DAC on your device, but
  448. 16:01it still is a version of getting an
  449. 16:02analog output.
  450. 16:05So, imagine you have a GPIO pin and
  451. 16:06you're just going to put PWM signals
  452. 16:08through. You can see here this is like
  453. 16:10an RC filter. And so, the idea here is
  454. 16:12that you're going to smooth out the um
  455. 16:16the high frequency components, leaving
  456. 16:18only the low frequency components. And
  457. 16:20then you will get over time, you will
  458. 16:22get an analog output on average. And so,
  459. 16:26um, it would turn into something like
  460. 16:27this. This would be a better example
  461. 16:29where I have a bit stream going out and
  462. 16:31then this is the filtered version. And
  463. 16:33you still get some distortion because
  464. 16:35basically there's an RC discharge going
  465. 16:37on here. And so you're charging up and
  466. 16:38discharging. But by varying the duty
  467. 16:41cycle, uh, you will be able to uh,
  468. 16:44create a very high value or a low value.
  469. 16:48So let's see an example of that.
  470. 16:52Uh, here.
  471. 16:56All right. So here is this something
  472. 16:57that makes a square wave or a uh, that
  473. 16:59we can change the duty cycle on. And
  474. 17:01then this is just an output buffer just
  475. 17:02to show that that exists. I didn't put a
  476. 17:04load resistor on there. And here's the
  477. 17:06filter.
  478. 17:07And so if I change Oh, and then down
  479. 17:09here we can see the red lines are the
  480. 17:12output of the the PWM pin.
  481. 17:15Let's say. And then this is Let's see
  482. 17:17what's over here. And this is the blue
  483. 17:19line down there is the analog output
  484. 17:21voltage. As I changed my duty cycle,
  485. 17:25you can see that on average that value
  486. 17:27raises and lowers.
  487. 17:29So here, now I have a higher value. And
  488. 17:32this is all I did was change the duty
  489. 17:33cycle of something and now I have a
  490. 17:34different analog value. And the reason
  491. 17:37we have the buffer on there is because I
  492. 17:38put any load on the output, right? It
  493. 17:40would that resistor that 5K resistor is
  494. 17:42very large. So I get a big voltage drop.
  495. 17:45And so this is like a very cheap way to
  496. 17:46make an analog signal.
  497. 17:50And so, that some of the challenges with
  498. 17:51this version here is that
  499. 17:54um, it's actually fairly slow in a sense
  500. 17:56compared to your clock. It makes it have
  501. 17:58to have multiple clock wave signals to
  502. 18:01change this. So compared to something
  503. 18:02that would maybe in one clock cycle be
  504. 18:05able to produce an analog output, this
  505. 18:07is particularly slow way of doing it.
  506. 18:09Um, and there's a lot of there's ripple
  507. 18:11on it. And it's hard to reduce that
  508. 18:13ripple under all conditions. Maybe
  509. 18:14certain certain frequencies,
  510. 18:17uh, you could do it well, but certainly
  511. 18:18not all possible scenarios Can you get
  512. 18:21rid of that signal?
  513. 18:26Any questions here?
  514. 18:33So
  515. 18:34a piezoelectric buzzer would be a great
  516. 18:35example here and you'll you won't get
  517. 18:37high fidelity sound but you'll certainly
  518. 18:39get buzzers and tones if you needed to
  519. 18:41indicate something.
  520. 18:42Uh
  521. 18:44yeah.
  522. 18:46Okay.
  523. 18:48All right, so that's like the simplest
  524. 18:49way and then we can go to some of the
  525. 18:51more classic ways of making um
  526. 18:55uh resistors. Uh I mean
  527. 18:58DACs. So oops, let's go this way. So the
  528. 19:03resistor um resistor voltage divider is
  529. 19:06kind of like the flash ADC. It's kind of
  530. 19:08the inverse. So here we'll have a
  531. 19:11voltage ladder and this produces all the
  532. 19:14possible voltages. Now if you remember
  533. 19:16back to the ADC version this voltage
  534. 19:18ladder was the references, right? This
  535. 19:20was
  536. 19:21if you had a voltage of this particular
  537. 19:23value you would compare and see if you
  538. 19:26were higher and lower and that would
  539. 19:27produce the output. Here you have a
  540. 19:29voltage ladder and then you're selecting
  541. 19:31which one of those voltages voltage do
  542. 19:33you want to have on the output.
  543. 19:35So we can take a a look at that.
  544. 19:39Oops.
  545. 19:47Uh so here we're just going to
  546. 19:49have a binary selection. This is
  547. 19:51the last version I showed you before it
  548. 19:53was there's no decoder but this
  549. 19:55structure essentially makes
  550. 19:56encoder let's say that we can use to
  551. 19:59change my take the binary value into
  552. 20:01like
  553. 20:03um
  554. 20:04one hot encoding space.
  555. 20:06And so here I can change like if I have
  556. 20:08all the switches are low then I'm
  557. 20:11connecting the bottom thing and you see
  558. 20:13it's like negative nano volts. That's
  559. 20:14just be as kind of maybe the error and
  560. 20:16false start but should be effectively
  561. 20:19zero and nano volts is zero and then
  562. 20:21here I can add in let's do the lowest
  563. 20:23bit. I don't know this is the lowest
  564. 20:24bit. And then I can add in particular
  565. 20:27things in here. Multiple things are
  566. 20:28being switched in at once, but then
  567. 20:29these outputs are actually uh deciding
  568. 20:31what goes in. And so now I can hit my
  569. 20:33binary value to hit any one of these
  570. 20:36three-bit values here.
  571. 20:38And basically all you're just doing is
  572. 20:39having a switching network that selects
  573. 20:42the voltage is already here.
  574. 20:47What questions you have?
  575. 20:53Why don't you take a a couple minutes or
  576. 20:55a minute to talk amongst yourselves
  577. 20:56about the pros and cons and reflect upon
  578. 20:59the pros and cons of a flash ADC and see
  579. 21:01if those kind of cuz this is like the
  580. 21:03mirror image of a flash ADC. So like
  581. 21:05what are the pros and cons of this
  582. 21:06particular topology?
  583. 21:15>> [clears throat]
  584. 21:38[snorts]
  585. 21:56>> You guys are quiet.
  586. 21:58Normally if I give you a chance to talk
  587. 21:59like you you can't stop. You're excited
  588. 22:01to talk to each other.
  589. 22:03Like no.
  590. 22:07All right, what's what's the one
  591. 22:08advantage of this uh style compared to
  592. 22:12uh well I have you haven't seen any
  593. 22:14other ones. You saw one other one. So
  594. 22:15what's the advantage compared to the
  595. 22:16other ADC that or DAC that you saw?
  596. 22:26Yeah.
  597. 22:28Very fast. You call it a flash
  598. 22:30DAC if you want, nobody calls it that,
  599. 22:31but it's called a R RC ladder. Um
  600. 22:35Uh but yes, it's very flat fast. So this
  601. 22:37because, you know, all the values here
  602. 22:40are instantly available and all you have
  603. 22:42to do is switch between them. There's
  604. 22:44not even um
  605. 22:45uh just switching delay. There's no
  606. 22:47other um there's no comparators even
  607. 22:50involved. So it's actually pretty um
  608. 22:54power or you don't have the power
  609. 22:55consumption of the comparators, just of
  610. 22:57the uh resistor ladder.
  611. 22:59What else? What are some other uh what's
  612. 23:01the disadvantage?
  613. 23:04Yeah.
  614. 23:09Yeah, so um it's it's it's typically
  615. 23:12more like it wasn't manufactured
  616. 23:14correctly, that's typically what it is.
  617. 23:16And it it still remains hard to get all
  618. 23:18those uh voltage steps to be perfectly
  619. 23:20accurate. Maybe only with eight
  620. 23:22resistors it's not that big a deal, but
  621. 23:23you know, if you had um you know, 32 or
  622. 23:26128 resistors, okay, it's going to get a
  623. 23:28little bit harder. And so you imagine
  624. 23:30that if one of them was 99, that means
  625. 23:32that little step or you you know, even
  626. 23:34smaller, that little step is going to be
  627. 23:35slightly different, right? That little
  628. 23:37uh step from one binary value to another
  629. 23:40binary value, that that voltage step
  630. 23:42would be smaller than you would expect
  631. 23:43or could be larger. So that's that's the
  632. 23:45challenge. Any other advantages or
  633. 23:47disadvantages?
  634. 23:52Yeah.
  635. 23:55That's probably higher power
  636. 23:56consumption. I guess we didn't really
  637. 23:57talk about we don't have much to give it
  638. 23:59an example to, but yeah, you do have to
  639. 24:01have um this voltage ladder going, which
  640. 24:03may be not that bad um because there's
  641. 24:06no other switches or anything. I mean,
  642. 24:07the switches are pretty minimal, but
  643. 24:09they aren't like comparators and stuff,
  644. 24:10but it's not the cheapest. Uh it's
  645. 24:12probably also pretty large on silicon.
  646. 24:15Uh a non-obvious problem and probably a
  647. 24:18problem most embedded people wouldn't
  648. 24:19consider because either it's already in
  649. 24:21your microcontroller and you don't care
  650. 24:22how much how big it is or uh you're
  651. 24:25buying an external module and the size
  652. 24:26doesn't matter. But I think that would
  653. 24:27proportionally say that this topology
  654. 24:29could be expensive in this in a sense
  655. 24:31that
  656. 24:32uh it takes up more area and the area of
  657. 24:34your silicon is the the forcing function
  658. 24:36for cost.
  659. 24:39I don't know. What else is there?
  660. 24:40Complexity is relatively simple. There's
  661. 24:42not much going on here. So, that's nice.
  662. 24:48Okay.
  663. 24:49Uh
  664. 24:50let's see.
  665. 24:53Okay. So, one of the challenge here the
  666. 24:55the challenges of this one is now we
  667. 24:57have to have um
  668. 24:59a switch for every particular value,
  669. 25:01right? So, what happens if you wanted to
  670. 25:03reduce the number of switches?
  671. 25:05Um so, we can think about some
  672. 25:08structures.
  673. 25:09Um you know, it would be more effective
  674. 25:11if we didn't have to do that binary
  675. 25:13encoding with those switches if we could
  676. 25:14just actually switch the voltage in. And
  677. 25:16so, we're going to use an analog
  678. 25:17structure to help us and that's the
  679. 25:19summing amplifier. Did you guys see
  680. 25:21summing amplifiers in 215? Those that
  681. 25:23took 215?
  682. 25:26Yeah. Okay.
  683. 25:28Um really remember this class you don't
  684. 25:30have to know anything about analog. I
  685. 25:31promise. You just have to have like
  686. 25:33basic intuitive knowledge. It sums some
  687. 25:35voltages. That's all this thing does.
  688. 25:37So, we'll see an example of how does a
  689. 25:38summing volt you know, amplifier sums
  690. 25:40some voltages? There's an equation here.
  691. 25:42It's a gain factor. And then uh the
  692. 25:45trick with this topology is that it
  693. 25:47gives a negative voltage output. We can
  694. 25:49assume that on your devices uh that the
  695. 25:52analog engineers have done a good job of
  696. 25:54actually producing a positive voltage
  697. 25:56output and all the inputs are going to
  698. 25:57be negative voltages. It's not that hard
  699. 25:59to do all that. It's just the extra
  700. 26:01circuitry to demonstrate that to you
  701. 26:02would be kind of hard. So, I won't do
  702. 26:04that. But, uh you can conceptually see
  703. 26:06how it would work.
  704. 26:07And so, here
  705. 26:09Uh wait a second. Where Oh, you're off
  706. 26:11to side. Why? Why?
  707. 26:17Come on. Pinch.
  708. 26:22Okay.
  709. 26:24Um okay. So, anyways, here
  710. 26:27Is there a
  711. 26:28view fit?
  712. 26:32I don't remember.
  713. 26:35I don't know. All right.
  714. 26:36Well, anyways, uh so here we have some
  715. 26:38two voltages and we have the output
  716. 26:40voltage and it's just a simply All
  717. 26:42right, so I change these two voltages.
  718. 26:44Um they happen to be negative in this
  719. 26:45example, so we get a positive output,
  720. 26:47but you can just see that they're
  721. 26:48summing them and here really the trick,
  722. 26:50the conceptual trick, is that the
  723. 26:52current being driven through this node
  724. 26:54here, we can add currents together
  725. 26:56easier than you can add voltages
  726. 26:58together. So, here we're going to sum
  727. 27:00these volt- these currents together. I
  728. 27:01have a current that's being defined
  729. 27:03going through uh resistor one and
  730. 27:05another current being defined going
  731. 27:07through resistor two. This node is
  732. 27:09always uh uh
  733. 27:12uh equal to zero. It's being trying to
  734. 27:13be driven to zero. And now this voltage
  735. 27:16uh divide or so this resistance divided
  736. 27:18by the voltage drop across here defines
  737. 27:20the current. So, as I increase my uh
  738. 27:23voltage, let's say
  739. 27:25or decrease my voltage
  740. 27:27uh in this particular case, but increase
  741. 27:28the voltage drop across this thing, more
  742. 27:32Oh, god, the whole time it was I was
  743. 27:34doing so good. I was just in there and
  744. 27:37it Oh,
  745. 27:38Jesus.
  746. 27:41Oh, man, I'm not going to be able to do
  747. 27:43that that good again.
  748. 27:45Oh, man.
  749. 27:48All right, thank you for letting me
  750. 27:49know. All right.
  751. 27:53One nice guy, the rest of you were like,
  752. 27:54let's see how far he can go.
  753. 27:57All right. Uh what I want to show you, I
  754. 27:59don't know. You guys have to imagine
  755. 28:00what I was talking about. Um
  756. 28:03Anyways, I changed this voltage in here
  757. 28:06and uh you can see the voltage out here
  758. 28:08is proportionally changing. Yes, it's
  759. 28:10negative, but we're going to ignore that
  760. 28:11fact for a second.
  761. 28:13And so it's doing the summing action and
  762. 28:15the trick, the conceptual trick, is that
  763. 28:17it's the current through here is the
  764. 28:19summation of the current going through
  765. 28:21here and here. And you could have n
  766. 28:23number of branches and so the voltage
  767. 28:25drop uh the voltage drop across this
  768. 28:27thing creates the current and now I can
  769. 28:30create different voltage drops because I
  770. 28:31can change these voltages.
  771. 28:34Let's see like that. And now we see that
  772. 28:36it's pulling more current as I increase
  773. 28:38this current as I increase this voltage
  774. 28:40here or increase the voltage drop, I'm
  775. 28:42pulling more current. Yeah, you can see
  776. 28:44that there. And so now that value is
  777. 28:47larger. So we're going to sum the
  778. 28:49currents together. That's the the trick.
  779. 28:50That's all you have to remember. This
  780. 28:52allows you to have voltage that sums the
  781. 28:54current.
  782. 28:56All right.
  783. 28:58What questions you have?
  784. 29:03Okay.
  785. 29:06Yeah, ch-ch-ch. So now we can take
  786. 29:08advantage of that. So here this is the
  787. 29:10R2R ladder. Basically, the idea is we
  788. 29:13want to have a voltage ladder that idea
  789. 29:17but instead of having lots of switches
  790. 29:20or instead of having lots of switches,
  791. 29:22we want to minimize the number of
  792. 29:23switches. Um and there's good reasons
  793. 29:26for that as well. And so here what we're
  794. 29:28going to do is we're going to use these
  795. 29:30to create different currents of
  796. 29:32different proportions. And so uh by
  797. 29:35sizing them correctly so we have the
  798. 29:36first ladder, all those are R uh value R
  799. 29:40and it could be any value R per se, but
  800. 29:43say it's like, you know, a kiloohm. And
  801. 29:44then all the resistors in this part are
  802. 29:472R. And so making resistors that are
  803. 29:51uh matched is easier than making
  804. 29:53infinite number of values. And then
  805. 29:55things that are double are easy because
  806. 29:57in layout you would just double the
  807. 29:59resistance or double the stack that you
  808. 30:00would come up and come down. And so now
  809. 30:03you basically have two resistors of R
  810. 30:05size just linked together. And so now
  811. 30:07these are still structures that are
  812. 30:08pretty good at being the same size,
  813. 30:10which is nice when you're manufacturing.
  814. 30:12The the the errors are a little bit more
  815. 30:14tolerable. And so now they're going to
  816. 30:16produce different currents through here
  817. 30:18and then we're going to
  818. 30:19uh sum those switches together. So for
  819. 30:21example, you're going to see here this
  820. 30:22would be half the current, quarter the
  821. 30:24current, eighth, and a 16th. And then
  822. 30:26you can walk through this math to kind
  823. 30:28of figure out, okay, I can switch those
  824. 30:30in. So here's the switching factor say
  825. 30:31they're one or zero. And then that's
  826. 30:33going going added into my summing
  827. 30:35amplifier, which will pull current in
  828. 30:37through here.
  829. 30:39Okay?
  830. 30:42Now, I won't make the same mistake.
  831. 30:44Okay.
  832. 30:49So, here is that voltage ladder. Uh here
  833. 30:52is 50k and 100k, doesn't really matter.
  834. 30:54And as you can see, there's actually no
  835. 30:56current going through here cuz
  836. 30:57everything's disconnected. And if I go
  837. 30:59to one of the smaller bits here, I get a
  838. 31:02small amount of current coming through.
  839. 31:04And you could do it binary style. You
  840. 31:06could go one at one at a time.
  841. 31:08But then you can also do um
  842. 31:11do them together. So, here this is like
  843. 31:13a full one, I get -8, and then I can do
  844. 31:15a next one, get 12. And so, now this
  845. 31:18summation of this current coming through
  846. 31:20here
  847. 31:21is what's happening. So, it's really
  848. 31:23each one of these paths, I don't know if
  849. 31:25you can see it. Yeah, I can see these
  850. 31:26current kind of creeping through. So,
  851. 31:28that's uh the flow you see is
  852. 31:30proportional to how much current there
  853. 31:32is.
  854. 31:33And um
  855. 31:35you can see this one is
  856. 31:36approximately twice as much as this, and
  857. 31:38onward and upward. And so, this is the
  858. 31:40way that I can eliminate the number of
  859. 31:42switches and have slightly less
  860. 31:44resistors to get a analog uh voltage
  861. 31:47output.
  862. 31:52Yeah.
  863. 31:54Sure.
  864. 32:03Yeah, you just put some voltage up here,
  865. 32:05you mean?
  866. 32:06Yeah, you just put some voltage.
  867. 32:13Sorry. This This one?
  868. 32:21Yeah, I think that is saying Wait,
  869. 32:23that's a good question. So, where So, IR
  870. 32:26is
  871. 32:29How does IR get in here? So, this is the
  872. 32:31quarter, half,
  873. 32:32uh eighth.
  874. 32:36I think IR is this value Oh, no, this is
  875. 32:38just a constant, I think, that is in
  876. 32:40that formula. I'd have to look through
  877. 32:41that.
  878. 32:42Did that answer your question? Not
  879. 32:43really.
  880. 32:46Yeah, I mean, it's just the voltage that
  881. 32:48would be coming through
  882. 32:51So, what IR So, how do you How is IR
  883. 32:53defined in this equation? I I can't
  884. 32:54really see.
  885. 33:00Yeah, but there's like this constant
  886. 33:01offset. I'm just trying to figure out
  887. 33:03IRS. This is a good point. Let me Maybe
  888. 33:06this diagram doesn't match this math.
  889. 33:08Maybe that's the problem. Maybe in this
  890. 33:09particular diagram there is this that is
  891. 33:12not here. You could have a line that
  892. 33:14comes directly to a switch and it's not
  893. 33:16divided.
  894. 33:18Um
  895. 33:19So, yeah, maybe that's wrong. Okay, I'll
  896. 33:21look at that. That's good good question.
  897. 33:23Yep.
  898. 33:24Oh.
  899. 33:27All right, so why don't you take a
  900. 33:28minute and talk amongst yourselves.
  901. 33:30What's the advantage or disadvantage of
  902. 33:32this one compared to the other op amps
  903. 33:34or sorry, DACs that you've seen?
  904. 34:43>> Mr. Harris
  905. 35:07>> All right, what do you think? What are
  906. 35:08some advantages or disadvantages of this
  907. 35:11particular topology?
  908. 35:18Yeah.
  909. 35:27Uh
  910. 35:28so, it's expensive to do this because of
  911. 35:29the size of the resistors, you said?
  912. 35:34Yeah. Yeah.
  913. 35:35Yeah.
  914. 35:36Um is it worse in terms of resistors
  915. 35:39than it than the for the number of bits
  916. 35:41than the ladder that we saw last time?
  917. 35:46I think it's slightly better. It's not a
  918. 35:48magically better. Slightly better.
  919. 35:52Okay.
  920. 35:54What are some
  921. 35:55um advantages or disadvantages? Anything
  922. 35:58else?
  923. 36:00Yeah.
  924. 36:07Yeah.
  925. 36:11Yeah, and it's always in comparison to
  926. 36:13other things. So, like all of them you
  927. 36:15need to add more resistors, right? So,
  928. 36:16like but there is uh inherent issues
  929. 36:19with uh some topologies, right? That you
  930. 36:21to get to higher and higher DACs is
  931. 36:22going to take uh be challenging.
  932. 36:25Um and it's also the same for um higher
  933. 36:28bits for ADCs.
  934. 36:29What's some What's an advantage of this
  935. 36:31one?
  936. 36:36Yeah.
  937. 36:37>> We were saying that the growth is kind
  938. 36:39of exponential, though.
  939. 36:41For every stage of the ladder that you
  940. 36:43add, like you double the number of bits
  941. 36:46that you can represent. Like with one
  942. 36:49more switch, that's one more bit, which
  943. 36:51means that you can
  944. 36:52double the information.
  945. 36:55So, I think that, you know, in
  946. 36:57comparison to just the
  947. 36:58resistive ladders I talked about before,
  948. 37:00this is a lot
  949. 37:02clearer. We're going to have a much
  950. 37:03higher performance.
  951. 37:04>> Right. So, that is the advantage. The
  952. 37:06the penalty is that there's some
  953. 37:08issues here with you might have less
  954. 37:11linearity because now you have to have
  955. 37:13resistors of different sizes.
  956. 37:15Um
  957. 37:16one of the advantages here is still
  958. 37:18pretty fast.
  959. 37:20Um we didn't There All the topologies
  960. 37:22are actually going to be uh relatively
  961. 37:24fast, but there's not it's not like the
  962. 37:26you need a lot of acquisition time like
  963. 37:28you needed with the SAR ADC where you
  964. 37:30had to like search for something. That's
  965. 37:32not usually how DACs work.
  966. 37:35Okay.
  967. 37:39Uh
  968. 37:40okay. And then uh the next one is the
  969. 37:42binary weight uh uh resistor D uh DAC.
  970. 37:47So, this is very similar to the one we
  971. 37:48just saw. So, I think the topologies are
  972. 37:51kind of confusing.
  973. 37:52Um so, here, let's see here. So, the
  974. 37:55voltage was here and then you went
  975. 37:56through a resistor network and then you
  976. 37:58had switches. Not drawn exactly the
  977. 38:00same. Here, you have switches, then a
  978. 38:02resistor network, and then you have your
  979. 38:04output stage. So, slightly switched
  980. 38:06things around. Here, the trick though is
  981. 38:09I have resistors of different values.
  982. 38:11Every resistor is a different value.
  983. 38:13Now, it's nice that they're uh you know,
  984. 38:15multiples of two of each other. That
  985. 38:17makes the layout easier and you can
  986. 38:19imagine for for reasons of binary that
  987. 38:21that's good. Um but, that does mean that
  988. 38:25um
  989. 38:26a small error may not be
  990. 38:29uh
  991. 38:30will be passed on to multiple things,
  992. 38:32right? So, let's say the R over 2
  993. 38:34resistor is slightly smaller,
  994. 38:36disproportionate
  995. 38:37uh than the rest of them. That means
  996. 38:39that and we're going to reuse that for
  997. 38:41every one of the smallest bits. So, you
  998. 38:42now you're going to get more error as
  999. 38:44you um in every one of your codes or
  1000. 38:47every fourth code I guess because that
  1001. 38:50thing is going to be maybe slightly
  1002. 38:51different slightly weird.
  1003. 38:53So that that is one of the challenges.
  1004. 38:54It's more less tolerant to manufacturing
  1005. 38:57defects, but it's much smaller which is
  1006. 39:00the benefit.
  1007. 39:01So let's see.
  1008. 39:06And you can imagine this not too
  1009. 39:08surprising again. This is just
  1010. 39:10making different ways to pull current
  1011. 39:12through this node and we just generated
  1012. 39:14different ways of making current come
  1013. 39:16through these resistors. And so here I
  1014. 39:19have my switch. Hey, why are you doing
  1015. 39:20that?
  1016. 39:22And I'm just basically switching on and
  1017. 39:23off these resistors, but because they're
  1018. 39:25all a different proportion of current
  1019. 39:27coming through them.
  1020. 39:29I get the benefit here of being able to
  1021. 39:31create binary values and or use turn
  1022. 39:34them on simultaneously so I can put a
  1023. 39:36binary code in here to turn these things
  1024. 39:38off and on.
  1025. 39:40>> [clears throat]
  1026. 39:41>> Okay.
  1027. 39:44What questions do you have?
  1028. 39:53And here we just
  1029. 39:54it doesn't matter if this is inverted or
  1030. 39:57this is positive like there's lots of
  1031. 39:58ways to make the chip in this particular
  1032. 39:59one I just said the input was a negative
  1033. 40:01reference voltage which it produces a
  1034. 40:03negative or positive output voltage. So
  1035. 40:05take 30 seconds and kind of talk about
  1036. 40:08what's the advantages and disadvantages
  1037. 40:09of this one.
  1038. 40:35>> [snorts]
  1039. 40:50>> Today is the
  1040. 41:06>> [clears throat]
  1041. 41:14>> All right, so we already know this one's
  1042. 41:15going to be fast. They're all fast. More
  1043. 41:18or less. I mean, we'll talk about in
  1044. 41:19real world ones their settling time and
  1045. 41:22your back on your device has speed
  1046. 41:25limitations. So, as we go to the extreme
  1047. 41:27of speed
  1048. 41:28different issues come up. Um but not
  1049. 41:31from the first order. So, this is just
  1050. 41:33as fast as the rest of them cuz you take
  1051. 41:35a switch in one time second or one
  1052. 41:38clock cycle and then you get the value.
  1053. 41:40But, what are some advantages or
  1054. 41:42disadvantages?
  1055. 41:53Yeah.
  1056. 41:54>> One thing that we're talking about is
  1057. 41:55that it might be easier to order a lot
  1058. 41:57of resistors in bulk, which would occur
  1059. 41:59in the UGB that we saw
  1060. 42:01>> Mhm.
  1061. 42:02>> like, you know, for each stage you have
  1062. 42:04like a different resistor value. With
  1063. 42:07each stage you just buy one of the same
  1064. 42:08resistor.
  1065. 42:10That was one of the ideas.
  1066. 42:12>> That's a That's a interesting point of
  1067. 42:14view. Um and we just to be clear, you
  1068. 42:16should never build one of these by hand.
  1069. 42:18That would be an insane process.
  1070. 42:20Um
  1071. 42:22And maybe there's I could maybe that if
  1072. 42:24you want to make a really simple one,
  1073. 42:25there could be a value in making one on
  1074. 42:26a PCB. But, these should all be done in
  1075. 42:28silicon. Um but, your idea of like, I'm
  1076. 42:32going to buy in bulk still applies in
  1077. 42:33the sense that it's much easier to make
  1078. 42:35one resistor value over and over and
  1079. 42:37over again to make n resistor values.
  1080. 42:40Um but, as a side note, when you are
  1081. 42:43buying components one day out there and
  1082. 42:44you're buying for your board,
  1083. 42:46uh
  1084. 42:47your manufacturer's going to specify a
  1085. 42:49tolerance range and you'll find that
  1086. 42:52within one batch the tolerance range is
  1087. 42:54usually smaller than across batches. So,
  1088. 42:58if you're trying to make sure that you
  1089. 42:59have matched resistors from you have n n
  1090. 43:02instances of your product and you want
  1091. 43:03to make sure that they're as close to
  1092. 43:04the same getting the same batch
  1093. 43:06resistors actually usually does help.
  1094. 43:08All right, but that's a side note.
  1095. 43:11All right, any uh so let's see a maybe
  1096. 43:14disadvantage?
  1097. 43:16Um what's the advantage?
  1098. 43:19Yeah.
  1099. 43:20>> The
  1100. 43:21op amp is charging a lot more like the
  1101. 43:23analog resistor.
  1102. 43:28>> Hmm, that's a good question.
  1103. 43:30Uh I would say it's probably more than
  1104. 43:34uh the resistors, yeah.
  1105. 43:36There's uh inside there's depends on the
  1106. 43:39op amp topology, but there's a lot more
  1107. 43:40paths to the ground. They can be made
  1108. 43:42very low power. You trade off speed and
  1109. 43:45the resistance you don't have to go like
  1110. 43:47full volts across these things. You
  1111. 43:49could do a smaller value, but maybe I'd
  1112. 43:50say I don't know for any one resistor
  1113. 43:52I'd say that the op amp consumes more
  1114. 43:54power.
  1115. 43:57But that's also like
  1116. 43:58just a ballpark number, right? I can't
  1117. 44:00There's no hard rule of thumb. You'd
  1118. 44:02have to actually do the layout analysis.
  1119. 44:06All right, I don't think I think we said
  1120. 44:08it in different ways, but um
  1121. 44:10linearity and manufacturability of this
  1122. 44:13is hard, but you need less resistors.
  1123. 44:14This is the one where you need the least
  1124. 44:16amount of resistors of any of them.
  1125. 44:18So, that's the advantage here. This can
  1126. 44:19be small. This is one that's typically
  1127. 44:21used in silicon
  1128. 44:22um like on a a microcontroller. They're
  1129. 44:24trying to optimize for size. You're not
  1130. 44:27buying uh the DAC a microcontroller just
  1131. 44:30for how good and linear the DAC is
  1132. 44:32typically, right? You're going you want
  1133. 44:35the flexibility. You want to have a
  1134. 44:37design that could have a DAC or not have
  1135. 44:38a DAC. Um
  1136. 44:41if you really cared about really precise
  1137. 44:43audio output or
  1138. 44:45analog output, you might buy a dedicated
  1139. 44:47chip just for that and you can buy
  1140. 44:49uh you know, analog codecs that will
  1141. 44:52some of you have talked about them.
  1142. 44:53They're like a protocol called I2S,
  1143. 44:56which is equivalent to I2C, in which you
  1144. 45:00will stream digital values to your DAC,
  1145. 45:03and it will do all the generation of
  1146. 45:05analog for you. And you don't have to
  1147. 45:09mess with a lot of that stuff. So,
  1148. 45:10there's dedicated chips that will do a
  1149. 45:12better job than your
  1150. 45:13device.
  1151. 45:15In fact, there's a whole hobby market
  1152. 45:16about like where are the really good
  1153. 45:17DACs to get for your audio amplifiers
  1154. 45:20for your headphones.
  1155. 45:22Okay.
  1156. 45:26So, there's trade-offs there.
  1157. 45:30And then, of course, we have all sorts
  1158. 45:33of quantization error, just like we had
  1159. 45:34with ADCs and analog in general. These
  1160. 45:38all have obey the same quantization
  1161. 45:41limitations, right? So, you're always
  1162. 45:43going to have a half-bit LSB. You wanted
  1163. 45:46a particular output analog voltage, but
  1164. 45:48you can only get discrete steps.
  1165. 45:51Often times, that would mean
  1166. 45:54um
  1167. 45:55you're going to do a lot of steps, so
  1168. 45:56you don't really care. But if you wanted
  1169. 45:57really pure sine waves, you might have
  1170. 45:59to put an output filter on that. And
  1171. 46:01that output filter will remove those
  1172. 46:03high-frequency steps, but you're then
  1173. 46:07limited to you can't have a frequency
  1174. 46:08that's higher than the output filter.
  1175. 46:10So, if your application is allows for
  1176. 46:14fixed output frequency or limited range
  1177. 46:18of output frequencies, then putting a
  1178. 46:19filter on the output is nice. You can
  1179. 46:20smooth out that stair step. Um but if
  1180. 46:23not, then, you know, you're just going
  1181. 46:25to have to deal with that noise and and
  1182. 46:27think about like how does that affect
  1183. 46:28your design. Um
  1184. 46:32You could imagine that there are
  1185. 46:34RF transmitters that actually go at
  1186. 46:36gigahertz that are trying to do direct
  1187. 46:38digital synthesis. Maybe megahertz is
  1188. 46:40more of an accurate statement, but
  1189. 46:41you're trying to do direct digital
  1190. 46:42synthesis. So, those edges would also be
  1191. 46:46spurious noise that goes out on the RF
  1192. 46:48channel. You don't want that.
  1193. 46:50So, but there's all these other ways to
  1194. 46:52mitigate trying to get rid of those uh
  1195. 46:55Some
  1196. 46:56uh sensors or some control loops are
  1197. 46:59done in analog, so maybe you have some
  1198. 47:00analog components and then your digital
  1199. 47:03uh world is trying to inject into the
  1200. 47:05analog control loop. Well, then you
  1201. 47:06might have to worry about those uh stair
  1202. 47:08steps as well.
  1203. 47:11All right. So, why don't we think
  1204. 47:12through a little bit? I think we did
  1205. 47:14most of these things already. I don't
  1206. 47:16have a worksheet for you. I'm sure
  1207. 47:17you're tired of them by now.
  1208. 47:19Um but we can just mentally think
  1209. 47:21through uh resolution. Uh just think
  1210. 47:24through, talk to yourselves, what do you
  1211. 47:25think uh for the top one, the low-pass
  1212. 47:28filter PWM, voltage divider, uh R-2R
  1213. 47:31ladder, or the binary one? Which What is
  1214. 47:33the um
  1215. 47:34given the same area, which ones have the
  1216. 47:37best resolution? Uh so, take a second
  1217. 47:39and uh we'll we'll come back.
  1218. 48:34What do you think? Which one's the has
  1219. 48:35the highest resolution of the group?
  1220. 48:43Should we vote?
  1221. 48:47How about this? Uh this will be one.
  1222. 48:49This is two. This is three. This is
  1223. 48:52four.
  1224. 48:53So, raise your hand and indicate with
  1225. 48:55your fingers which one you think is
  1226. 48:56which. Which one has the highest
  1227. 48:58resolution given the same area.
  1228. 49:01Okay, I got one.
  1229. 49:04Four.
  1230. 49:05Yeah, I can't see that far. I'm getting
  1231. 49:07old. I got lots of fours. I got a few
  1232. 49:09ones, maybe a three. Okay. Let's see
  1233. 49:11what I Let's see what I thought last
  1234. 49:12year when I made this slide.
  1235. 49:14Um
  1236. 49:16I said that I think for the voltage
  1237. 49:17dividers, this makes sense because uh
  1238. 49:20sorry, for the this the last three, the
  1239. 49:22binary weight one, that one is trading
  1240. 49:25uh
  1241. 49:26re- you're making resistors of different
  1242. 49:28sizes to encode currents.
  1243. 49:30And uh that one has the least number of
  1244. 49:34resistors for the end number of bits.
  1245. 49:36So, like the binary weight is the best
  1246. 49:39in terms of resolution per area. This
  1247. 49:41one I said this one's kind of like out
  1248. 49:43there. It's kind of hard to say uh
  1249. 49:45because also it's very noisy. Uh so, it
  1250. 49:47has like a this trade-off between those
  1251. 49:49other ones. These ones will actually
  1252. 49:50keep that voltage stable, while this one
  1253. 49:52will inherently wiggle. And then maybe
  1254. 49:54this one isn't really that applicable
  1255. 49:56for silicon, although certainly you can
  1256. 49:58make it. So, um
  1257. 50:00I don't know. May I don't know why
  1258. 50:01exactly I said maybe, but I don't think
  1259. 50:03it's a fair comparison cuz they have
  1260. 50:04these other trade-offs.
  1261. 50:06Um
  1262. 50:08And then yeah, because I think that
  1263. 50:09these, given the same voltage range and
  1264. 50:11a reasonable bit size, you can get much
  1265. 50:13finer, like little little step sizes.
  1266. 50:15Well, this will always have this RC
  1267. 50:17charge time. So,
  1268. 50:18uh on average it might be low, but I
  1269. 50:20think in general like you just can't
  1270. 50:22rely on it that much. Does anybody have
  1271. 50:24a different opinion?
  1272. 50:26Does anybody understand why I'm saying
  1273. 50:27like this has so much variance ba-
  1274. 50:29baited into it that it's like you could
  1275. 50:31imagine this one for the same voltage
  1276. 50:33range could have like
  1277. 50:35uh you know, the last four sniffing
  1278. 50:37least significant bits could just be
  1279. 50:39last four bits could just be the rise
  1280. 50:40and fall time of this one. So, it kind
  1281. 50:42of not fair.
  1282. 50:44All right, let's do Well, we already
  1283. 50:46talked about speed.
  1284. 50:47So, I'll just give that one away.
  1285. 50:50But um my argument for speed is that
  1286. 50:53these are all high. They're all less
  1287. 50:55than a clock cycle over there, except
  1288. 50:56for this one. This one's like extremely
  1289. 50:58slow. So, if this one is
  1290. 51:01uh you know, whatever your clock is X,
  1291. 51:03right? Uh you know, 100 MHz, well,
  1292. 51:05that's too high, but let's say MHz for
  1293. 51:07those. Those are all going to be
  1294. 51:09be done in the one clock cycle. Well,
  1295. 51:10this one for that same clock cycle, now
  1296. 51:13you have to run a timer, and then you
  1297. 51:14have to break that into a PWM, and then
  1298. 51:17you have to go and slowly change that
  1299. 51:19duty cycle. So, this is, you know,
  1300. 51:21hundreds, if not thousands of times
  1301. 51:23slower than these guys, but you're
  1302. 51:26probably not choosing this one for
  1303. 51:28speed, you're choosing this one because
  1304. 51:30you're like, oh, I just need some analog
  1305. 51:32output, and I only have a digital pins,
  1306. 51:34right? That's why you're choosing this
  1307. 51:36one. Uh so, it's kind of in a different
  1308. 51:37class.
  1309. 51:39What about linearity?
  1310. 51:41Why don't you take, and this means like
  1311. 51:43that has consistent bit sizes uh across
  1312. 51:46different error types. Um so, why don't
  1313. 51:49you take, you know, 30 seconds and
  1314. 51:51discuss what do you think the linearity
  1315. 51:53uh is, and then we'll do the voting
  1316. 51:54again of which one is the has the best
  1317. 51:57linearity.
  1318. 52:08>> [snorts]
  1319. 52:41>> All right, what do we think? We're going
  1320. 52:42to vote. This will be one, uh two,
  1321. 52:44three, and four over there. Uh who
  1322. 52:47thinks, uh I don't know. What do you
  1323. 52:49think? Which one is the most linear of
  1324. 52:51all these?
  1325. 52:53Two, two.
  1326. 52:55Two, I got a
  1327. 52:56four, maybe. All right, these people,
  1328. 52:58they're not voting. One person over here
  1329. 52:59they have no have no idea. They over
  1330. 53:01here, we have a couple people voting.
  1331. 53:02Okay, two. Why? Why two? Anybody want to
  1332. 53:05I see your fingers were up. Why two?
  1333. 53:19Yeah, I think the the voltage divider
  1334. 53:21one
  1335. 53:22um if any one resistor is bad, it only
  1336. 53:24affects one bit. So, that's right. And
  1337. 53:26they're all exactly the same size. So,
  1338. 53:28the the likelihood of getting them all
  1339. 53:30to be very similar is is good. The other
  1340. 53:33ones uh they're different sizes and if
  1341. 53:35any one of them is wrong it it hit
  1342. 53:38affects uh all those uh bits that are
  1343. 53:41associated with that uh resistance. So,
  1344. 53:43uh yeah, that's that's essentially the
  1345. 53:45reason why. So, let's see what did I
  1346. 53:47put? I said low. Well, linearity of this
  1347. 53:49one is horrible
  1348. 53:51in the sense that it's just time varying
  1349. 53:53on its own.
  1350. 53:54Um and then these are you know, the
  1351. 53:56proportionality here ratios of linear to
  1352. 53:59non-linear.
  1353. 54:00Okay?
  1354. 54:02How about I guess power? I'll just do
  1355. 54:04power. It's kind of hard to say because
  1356. 54:06you
  1357. 54:07power is based on so many other factors.
  1358. 54:09So, I would just say here uh the
  1359. 54:13low-pass filter is just a digital IO
  1360. 54:15pin, right? It can't like its power is
  1361. 54:18uh uh
  1362. 54:19you know, an output gate. Uh so, that's
  1363. 54:21really low. Uh the other other of them
  1364. 54:24have to have an op amp and some number
  1365. 54:25of resistors and we could argue that
  1366. 54:27some of those resistors are like uh
  1367. 54:29maybe they're slightly different because
  1368. 54:31there's less uh loss between some of
  1369. 54:33those resistors especially with like the
  1370. 54:34binary weight. It's more efficient. Uh
  1371. 54:37and it's not some of those um resistors
  1372. 54:40aren't even turned on where all the
  1373. 54:41resistors here are dissipating power in
  1374. 54:43the voltage divider. But then it really
  1375. 54:45comes down to like topology and you have
  1376. 54:47to do a detailed analysis. So, we can at
  1377. 54:48least say they're all like medium or at
  1378. 54:50least all the same in this one and um
  1379. 54:53is uh relatively low uh
  1380. 54:56on the side.
  1381. 54:58Okay.
  1382. 54:59And then um
  1383. 55:01I guess I shouldn't have combined these
  1384. 55:02but this is kind of a uh number of um Um
  1385. 55:05number of resistors per switch. Um and
  1386. 55:08so uh uh this is kind of getting at
  1387. 55:10complexity. So, why don't you take uh 30
  1388. 55:13seconds and say which one is going to
  1389. 55:15have the What did I What How do I say
  1390. 55:17this? Which one has the least number of
  1391. 55:20resistor and switches uh in it?
  1392. 55:23Uh aside from this one. How about you
  1393. 55:25just look at those ones?
  1394. 55:26Um
  1395. 55:27cuz this has no no switches.
  1396. 55:30So, take 30 seconds, try and figure out,
  1397. 55:31then we'll vote of these three
  1398. 55:33uh which one has the small lowest number
  1399. 55:35of resistors and uh switches.
  1400. 56:00>> [snorts]
  1401. 56:24>> All right, so we'll vote. This will
  1402. 56:26still be one just out of convention and
  1403. 56:27two and three and four over here, but
  1404. 56:30we're only going to really consider two
  1405. 56:31and through uh four. So, which one has
  1406. 56:34the least number of uh resistors and
  1407. 56:37switches?
  1408. 56:39Four.
  1409. 56:41Four. Yep, it's four. And you can go
  1410. 56:43through and calculate for n n bits how
  1411. 56:46many resistors and switches are. And
  1412. 56:48really uh this is proportional to area.
  1413. 56:51Switches aren't
  1414. 56:53a large area, I think of, compared to uh
  1415. 56:56the resistors, but it still leads to
  1416. 56:58complexity. And so, here's really the
  1417. 57:00trade-off is trying to reduce uh the
  1418. 57:02resistor count.
  1419. 57:03Um
  1420. 57:04but again, this one doesn't quite follow
  1421. 57:06this trend. It's a different topology.
  1422. 57:09Okay.
  1423. 57:10Any
  1424. 57:11questions on the pros and cons of
  1425. 57:13different DACs?
  1426. 57:16Yeah.
  1427. 57:17>> What's the problem with audio playback?
  1428. 57:19Like if you want to like a super
  1429. 57:20accurate one, you would like not use
  1430. 57:22these.
  1431. 57:22Separate like structures.
  1432. 57:25>> Um you would probably not want to use if
  1433. 57:28you're really an audio file and you have
  1434. 57:30better ears than me.
  1435. 57:32Right? And you just could hear all the
  1436. 57:34notes in these this music, you're
  1437. 57:35probably not going to use the DAC that's
  1438. 57:37on the XMC.
  1439. 57:39Right? You're not going to use the one
  1440. 57:40on your microcontroller. They have made
  1441. 57:42special modules that will be audio DACs
  1442. 57:45for audio and they haven't been
  1443. 57:47optimized for like your DAC goes goes up
  1444. 57:50to 5 MHz. Well, you don't need that for
  1445. 57:52audio. You only need it to go up like 40
  1446. 57:54kHz, right? Um and some uh and then
  1447. 57:57they'll be like 24-bit. Now, I can't
  1448. 58:00hear the difference between 16-bit audio
  1449. 58:02and 24-bit audio and most of us are
  1450. 58:04listening to audio that's been
  1451. 58:05compressed anyways. So,
  1452. 58:07those bits aren't even available for us
  1453. 58:09anymore. Um but there's special
  1454. 58:11hardware. And then they also will add
  1455. 58:13in, you know, uh special smoothing
  1456. 58:15functions like uh our like um
  1457. 58:18LC filters and all these other things to
  1458. 58:20make it just right. So, if you're going
  1459. 58:22to do audio, you want to do it just
  1460. 58:23right, buy the correct module.
  1461. 58:27Any other questions?
  1462. 58:29All right. So, I think the real takeaway
  1463. 58:31is from the ADCs and DACs is not that I
  1464. 58:34expect you to be able to calculate your
  1465. 58:36way through any of those voltage
  1466. 58:38dividers and switches. It's much more if
  1467. 58:41you're in industry and somebody's
  1468. 58:42saying, I need to go and buy I need a
  1469. 58:45fast high-speed ADC, which one should I
  1470. 58:48buy? That at least you can come back and
  1471. 58:50remember, oh, that's probably going to
  1472. 58:51be a flash and I hope they don't ask for
  1473. 58:53too many bits or else we're in trouble.
  1474. 58:55Right? That's like that's the sort of
  1475. 58:56tradeoff I'm looking for.
  1476. 58:58Um or if you're doing um you know, a
  1477. 59:00DAC, why why are the what if I'm looking
  1478. 59:04at a a really low-cost thing, why is it
  1479. 59:06that I might have to worry about
  1480. 59:07linearity? If I'm especially if I'm
  1481. 59:09doing controls and analog controls,
  1482. 59:11mixed digital analog controls,
  1483. 59:13maybe you really don't want to use that
  1484. 59:14binary weight or you're just like it's
  1485. 59:16free and I'll have to find some way to
  1486. 59:18compensate for some of those errors.
  1487. 59:22Okay.
  1488. 59:24Let's see.
  1489. 59:25And then so on I don't know why it's all
  1490. 59:29out of order
  1491. 59:30but on your particular devices you
  1492. 59:34I think most of you had lab this week
  1493. 59:36but um
  1494. 59:37it's a audio
  1495. 59:39like DAC
  1496. 59:41and so you'll have you have two DACs on
  1497. 59:44your device.
  1498. 59:46It's interesting you can go to full
  1499. 59:47resolution at
  1500. 59:492 MHz but then
  1501. 59:51there's reasons here while if you want
  1502. 59:52to go to faster 5 MHz you have to reduce
  1503. 59:54your resolution. So there's this speed
  1504. 59:56trade-off
  1505. 59:58that happened. Now the SAR has that
  1506. 1:00:00built in fundamentally built into it.
  1507. 1:00:02This is much more about the secondary
  1508. 1:00:04effects of like
  1509. 1:00:06how the settling time works and how the
  1510. 1:00:08analog outputs of these things work
  1511. 1:00:10rather than a fundamental of the flash
  1512. 1:00:12or the sorry the DAC type but there is a
  1513. 1:00:15resolution speed trade-off here as well.
  1514. 1:00:17This DAC
  1515. 1:00:19well as most DACs that you would
  1516. 1:00:22ever use does have an output buffer and
  1517. 1:00:24they specifically say it's rated for 5
  1518. 1:00:26kiloohms
  1519. 1:00:2725 picofarads
  1520. 1:00:29and that's just like a pretty reasonable
  1521. 1:00:31thing right? They're saying okay we can
  1522. 1:00:33drive a power source that's more for
  1523. 1:00:35signal level and the capacitance is
  1524. 1:00:37always is important that they mention
  1525. 1:00:40that because
  1526. 1:00:41capacitance lives parasitically
  1527. 1:00:43everywhere and
  1528. 1:00:4550 picofarads is actually kind of a lot
  1529. 1:00:48of
  1530. 1:00:48capacitance so they've kind of optimized
  1531. 1:00:50for most analog signals that you would
  1532. 1:00:52come up against
  1533. 1:00:53but if you make control circuits things
  1534. 1:00:57can become unstable if you have too much
  1535. 1:00:59capacitance or at least at the minimum
  1536. 1:01:01it's going to take too long to drive
  1537. 1:01:03that thing and this will start slowing
  1538. 1:01:05you down. Now this is only 5 kilohertz
  1539. 1:01:08or kiloohms so you can't go and drive
  1540. 1:01:10reasonably drive that 8 ohm speaker Um,
  1541. 1:01:13why you need to have something in
  1542. 1:01:15between So, uh, if you're going to if
  1543. 1:01:17that's part of your lab or your final
  1544. 1:01:19project, you're going to drive a speaker
  1545. 1:01:20and you're going to do it with a DAC,
  1546. 1:01:21that's cool. Um,
  1547. 1:01:24that gives you lots of flexibility in
  1548. 1:01:25how you control sound, but you're going
  1549. 1:01:27to need an output stage that's really
  1550. 1:01:29designed to drive speakers. And because
  1551. 1:01:32speakers are so low voltage and need
  1552. 1:01:34high current, um, or so so low
  1553. 1:01:37resistance and need high current,
  1554. 1:01:38there's usually output devices
  1555. 1:01:40specifically made to drive speakers. So,
  1556. 1:01:42you want something that's a speaker
  1557. 1:01:43driver. Uh, cuz it's such a common thing
  1558. 1:01:45and it's a kind of a unique operating
  1559. 1:01:47point. So, for this, you drive this
  1560. 1:01:49into, uh, you know, an audio speaker
  1561. 1:01:52driver, some module that does that. You
  1562. 1:01:54plug it is powered externally and then
  1563. 1:01:56that plugs it you plug your speaker
  1564. 1:01:58directly into that module and then you
  1565. 1:01:59can have uh, nice sounding audio.
  1566. 1:02:02And I think we talked about this most
  1567. 1:02:03project groups. Just reminder that the,
  1568. 1:02:06uh, expo's going to be loud. So, if you
  1569. 1:02:08have something that you want us to hear,
  1570. 1:02:12and you remember I can't hear anything.
  1571. 1:02:14So, now you're going to have to have
  1572. 1:02:15that extra loud for the, uh, expo if you
  1573. 1:02:17want us to do it. Um, an easy way to do
  1574. 1:02:19that is just put PC speakers. Bring some
  1575. 1:02:21PC speakers, turn them up. We'll be able
  1576. 1:02:23to hear it.
  1577. 1:02:24Um, okay.
  1578. 1:02:28Um, we'll do quickly talk about some
  1579. 1:02:30error types in DACs and ADCs. So, we
  1580. 1:02:32already know about quantization error.
  1581. 1:02:34We showed a slide on it before. We
  1582. 1:02:35talked about quantization error uh, back
  1583. 1:02:38when James was here uh, talking about
  1584. 1:02:40uh, analog signals in general. And so,
  1585. 1:02:43we still have those same error types.
  1586. 1:02:46>> [clears throat]
  1587. 1:02:46>> Um, the offset error here, this is um,
  1588. 1:02:50basically you have this ladder that's
  1589. 1:02:52going up and if everything's just
  1590. 1:02:53shifted along some analog voltage,
  1591. 1:02:56that's actually not too bad. That might
  1592. 1:02:58mean that like the tail resistor
  1593. 1:03:00on your ladder was not quite right.
  1594. 1:03:03Maybe it's malformed. Or maybe there's
  1595. 1:03:05some, you know, analog offset. This
  1596. 1:03:08error is common, but it's also
  1597. 1:03:10recoverable cuz all you have to do is
  1598. 1:03:12calibrate your device. And then you're
  1599. 1:03:14going to have a nice stairstep effect.
  1600. 1:03:15So, this one is uh relatively easy to
  1601. 1:03:18deal with.
  1602. 1:03:21Um and this is also why they have the
  1603. 1:03:24the they often ship It's not even by
  1604. 1:03:26error, but to get the most effect out of
  1605. 1:03:29your SAR set, they often shift uh the
  1606. 1:03:31bottom and the top by 1/2 LSB.
  1607. 1:03:34Um the one that's a little bit harder to
  1608. 1:03:36deal with is full scale
  1609. 1:03:38uh error, and this is kind of like gain.
  1610. 1:03:40So, this is where the stair step is, you
  1611. 1:03:42know, you wanted it to be a digital
  1612. 1:03:44value to be a particular analog value,
  1613. 1:03:46but it's just uh diverging. Maybe it's
  1614. 1:03:48diverging on the bottom on the low
  1615. 1:03:50voltage side or the high voltage side,
  1616. 1:03:51but there's this constant diverging of
  1617. 1:03:53it. And so, full scale error uh is not
  1618. 1:03:56also not that bad. This is calibratable,
  1619. 1:03:58right? You can go and at factory time
  1620. 1:04:01sometimes they'll do it. Sometimes
  1621. 1:04:02they'll have a subset of points that are
  1622. 1:04:05calibrated, and then you can interpolate
  1623. 1:04:07between those points. And how they do
  1624. 1:04:08that is at the factory, they'll have a
  1625. 1:04:10known voltage uh input or they'll
  1626. 1:04:13command a digital output and measure the
  1627. 1:04:14output voltage, and then they'll have a
  1628. 1:04:16lookup table. They'll show you those
  1629. 1:04:17offset values. Um
  1630. 1:04:20and then it's probably not practical for
  1631. 1:04:22them to do all the voltages, but they'll
  1632. 1:04:24do some.
  1633. 1:04:25Um
  1634. 1:04:27and so, like uh it's not obvious, but
  1635. 1:04:30uh the amount of time it takes to test
  1636. 1:04:32your chip
  1637. 1:04:33and actually make sure that it is uh
  1638. 1:04:36fully functional. So, that's like
  1639. 1:04:37checking all the D flip-flops and that
  1640. 1:04:39the
  1641. 1:04:40thing can boot and all those sort of
  1642. 1:04:41things and check all the analog
  1643. 1:04:42peripherals is actually a real
  1644. 1:04:44bottleneck for most um microcontrollers
  1645. 1:04:47and um high-end processors. So, they're
  1646. 1:04:50not going to do the full um
  1647. 1:04:52calibration for you.
  1648. 1:04:54But that one you could calibrate uh if
  1649. 1:04:56you if you had to as part of some
  1650. 1:04:58startup sequence uh some way on a on a
  1651. 1:05:00product. It's not impossible. Or if you
  1652. 1:05:02had a very special like one-off system,
  1653. 1:05:04you could just do the full lookup table.
  1654. 1:05:08The errors that are much worse are the
  1655. 1:05:11kind of the ones we talked about that
  1656. 1:05:12are more susceptible with a weighted
  1657. 1:05:13binary
  1658. 1:05:14uh value uh DACs where the non- the size
  1659. 1:05:18of the bits vary as a function of the
  1660. 1:05:20code. Now, these are much harder to deal
  1661. 1:05:23with um because it would take a whole
  1662. 1:05:25bunch of mapping of every single thing
  1663. 1:05:27to figure this out. Um so, there's these
  1664. 1:05:30uh type of errors and typically the
  1665. 1:05:33manufacturer's going to
  1666. 1:05:34uh
  1667. 1:05:35uh specify that uh what the worst-case
  1668. 1:05:39differential non-linear error error is
  1669. 1:05:40going to be. So, they're going to say
  1670. 1:05:41like how much error do they expect in
  1671. 1:05:44their ladder under normal operating
  1672. 1:05:46conditions.
  1673. 1:05:47And so, that would be added into your
  1674. 1:05:50quantization uncertainty as well. And
  1675. 1:05:52I don't know if James said this, but I
  1676. 1:05:53typically think of a DAC or an ADC as I
  1677. 1:05:55just throw away the last bit anyways,
  1678. 1:05:57maybe the last two bits just because you
  1679. 1:05:59have noise, you have system noise,
  1680. 1:06:02um you know, you put a constant voltage
  1681. 1:06:04in and you look at your ADC reading and
  1682. 1:06:05you can just watch the thing wiggle
  1683. 1:06:07around.
  1684. 1:06:08You can track down all that noise, but
  1685. 1:06:10that's effectively your your system
  1686. 1:06:12noise and you can't get around that. So,
  1687. 1:06:14uh you just expect that uh the signals
  1688. 1:06:16aren't going to be perfect.
  1689. 1:06:18Um these are like other examples of
  1690. 1:06:20differential non-linearity.
  1691. 1:06:22Um some of these are, you know, okay.
  1692. 1:06:24There's little offset errors, maybe you
  1693. 1:06:26skipped uh an analog step, uh just not
  1694. 1:06:29reliable. And then, these are like the
  1695. 1:06:31really bad ones where somehow you
  1696. 1:06:33actually had a uh digital value was
  1697. 1:06:36represented twice or more than once.
  1698. 1:06:37It's not a linear step because of some
  1699. 1:06:39process error. Maybe one of those uh
  1700. 1:06:41resistor values got so far out of whack
  1701. 1:06:44that it caused that sort of
  1702. 1:06:45non-linearity. And
  1703. 1:06:48you know, is that a problem for you? I
  1704. 1:06:49have no idea, right? That's really up to
  1705. 1:06:51your design. But imagine if you had a
  1706. 1:06:53control loop which you were expecting
  1707. 1:06:55that as you increase digital values, the
  1708. 1:06:58analog values also uh increased and you
  1709. 1:07:00had something that was tracking that.
  1710. 1:07:02Well, in this case, you might get stuck
  1711. 1:07:03in this uh local minimum uh not even
  1712. 1:07:06realize why. It's rare, but you you
  1713. 1:07:08should think about it if you're trying
  1714. 1:07:09to do uh controls with analog uh
  1715. 1:07:12signals.
  1716. 1:07:13Um
  1717. 1:07:15And this is just another the integral
  1718. 1:07:17error as to uh make a a measurement over
  1719. 1:07:20all the values compared to um
  1720. 1:07:23the
  1721. 1:07:25ideal versus the what was actually
  1722. 1:07:27there. You can
  1723. 1:07:29figure out the area under that curve and
  1724. 1:07:31then you can integrate over it and
  1725. 1:07:32figure out
  1726. 1:07:33how much error is accumulated. So just
  1727. 1:07:35another measurement. And maybe you know,
  1728. 1:07:38maybe not the manufacturers of a
  1729. 1:07:39microcontroller, but the manufacturers
  1730. 1:07:40of an of a DAC or an ADC would should
  1731. 1:07:43quantify that especially if you're in
  1732. 1:07:45that like really nice audio place space
  1733. 1:07:49or some other spaces where trying to
  1734. 1:07:50sell you a really nice error
  1735. 1:07:53DAC or ADC.
  1736. 1:07:55Um let's see.
  1737. 1:07:57Yeah.
  1738. 1:07:59When this will come out,
  1739. 1:08:01there are if you're going to take the
  1740. 1:08:02FFT of something, right? This is a
  1741. 1:08:04common thing. You have some signal. Now
  1742. 1:08:06you're trying to do signal processing on
  1743. 1:08:07it. You're analyzing some circuit coming
  1744. 1:08:10in you're like, well, what's the most
  1745. 1:08:11dominant frequency? Maybe that dominant
  1746. 1:08:13frequency is human speed or something.
  1747. 1:08:15There could be some radio signal or some
  1748. 1:08:18Doppler shift.
  1749. 1:08:20But you'll find is those errors will
  1750. 1:08:21cause spurious signals. You This is your
  1751. 1:08:24fundamental frequency. This is what's
  1752. 1:08:25coming in. This fundamental frequency
  1753. 1:08:27doesn't have these side lobes, but
  1754. 1:08:29because of your ADC
  1755. 1:08:31or DAC errors, these things start
  1756. 1:08:34creeping into your signal processing
  1757. 1:08:37pipeline where you're saying, oh wait, I
  1758. 1:08:38get a lot of error over here. My signal
  1759. 1:08:40coming in has all these spurious things.
  1760. 1:08:43That doesn't meet the FCC spec. Well, it
  1761. 1:08:45may be that your DAC is just
  1762. 1:08:46interpreting that cuz it has some or
  1763. 1:08:48your ADC cuz you have some
  1764. 1:08:49non-linearities.
  1765. 1:08:51So there's kind of like these follow-on
  1766. 1:08:52effects that I'm just kind of giving you
  1767. 1:08:53a heads up about.
  1768. 1:08:55Um okay. So we're going to
  1769. 1:08:59I don't really get to the eight to the
  1770. 1:09:00DAC so everything I wanted to today, but
  1771. 1:09:03we'll recap quickly.
  1772. 1:09:04Um so we've
  1773. 1:09:06reviewed voltage dividers and voltage
  1774. 1:09:08ladders, three types of DACs.
  1775. 1:09:10You can consider
  1776. 1:09:13low-pass filter to be separated from the
  1777. 1:09:15binary way and the R2R. They are
  1778. 1:09:18different.
  1779. 1:09:19Um
  1780. 1:09:20maybe I wrote that wrong, but and then
  1781. 1:09:22we talked about a bunch of errors in
  1782. 1:09:24ADCs. I think the real rule of thumb is
  1783. 1:09:26you have to figure out when you're
  1784. 1:09:28working your system, how much do you
  1785. 1:09:30trust those lower significant bits? Is
  1786. 1:09:32it one bit you already know you can't
  1787. 1:09:34trust it? Is it Is it two bits that you
  1788. 1:09:36can't trust or three bits? You have to
  1789. 1:09:37kind of figure out in a practical
  1790. 1:09:39system, like what is that noise floor
  1791. 1:09:41and can you trust those lower bits?
  1792. 1:09:43All right. We'll end there and we'll
  1793. 1:09:45pick up next week.

About this transcript

This page contains the full transcript of EECS 373 - Fall 2026 - Lecture 15: "DACs" by Interactive Sensing and Computing Lab , generated from the public captions YouTube serves with the video. The transcript has 11,232 words across 1,793 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.