EEVblog #240 - Power Supply Design Part 8 - Page 1
Forum section: electronics / general

author: ndictu
author_rank: Regular Contributor
timestamp: January 29, 2012, 02:21:08 pm
content: Interesting episode, two things:The DAC datasheet says it has resolution of 12bits, with max/min error of +-12bits. So that basically means it can output whatever value it wants, and stay in spec. What am I missing here?Second thing - the code is probably in very early stage right now etc, but really? Copy pasting the output of data bits to the DAC instead of a for loop?

author: ecat
author_rank: Frequent Contributor
timestamp: January 29, 2012, 02:45:58 pm
content: Another great episode, many thanks Dave.It may not be important but the video shows you missing one more SPI_CLK typo, see @11:12 and later near the video end. The first line of a function is always the trickiest, and the last line, that's the trickiest too. Come to think of it... Anyway...digitalWrite(SPI_CLK, LOW)I guess this should be SPI_SCLK, as it is your DAC is missing 1/2 of the first clock cycle ?

author: chrome
author_rank: Regular Contributor
timestamp: January 29, 2012, 02:46:46 pm
content: I think the 12LSb means if you output "100" it can be from 88->112Also I agree on the for loop, that's just bad practice.

author: tinhead
author_rank: Super Contributor
timestamp: January 29, 2012, 03:01:33 pm
content: Quote from: ndictu on January 29, 2012, 02:21:08 pmfor bit banging loops are timing killer, such spaghetti code is easier to debug.

author: ejeffrey
author_rank: Super Contributor
timestamp: January 29, 2012, 03:02:45 pm
content: The integral non-linearity is 12 LSBs. This means not the 12 least significant bits, but a voltage equal to 12 times the least significant bit. This is still pretty terrible compared to more intrinsically linear DAC archetectures, but the typical value is only 2 LSB, and even 12 LSBs is only +/- 0.2% of full scale. INL would be a bigger concern for AC applications where it leads to harmonic generation and inter-modulation distortion -- for a DC application like this it is "only" a concern for the overall accuracy, and if you were really concerned you could calibrate it out.

author: thilo
author_rank: Regular Contributor
timestamp: January 29, 2012, 03:19:31 pm
content: Quote from: tinhead on January 29, 2012, 03:01:33 pmThat would contradict the definition of spaghetti code.

author: tinhead
author_rank: Super Contributor
timestamp: January 29, 2012, 03:26:53 pm
content: Quote from: thilo on January 29, 2012, 03:19:31 pmno, you just misunderstood me. With "such" i refer to Daves code and not to loop.

author: ndictu
author_rank: Regular Contributor
timestamp: January 29, 2012, 04:15:04 pm
content: Quote from: ejeffrey on January 29, 2012, 03:02:45 pmOh, that makes much more sense. ThanksQuote from: tinhead on January 29, 2012, 03:01:33 pmI don't think so. The loop is just an increment and a simple comparison with a jump. That should be two instructions on pretty much every architecture, and that will be small compared to the contents of the loop. Also, I would say this makes debugging actively harder, because it's easy to make a change and miss some block while replicating it, or something like that.

author: baljemmett
author_rank: Unknown
timestamp: January 29, 2012, 04:31:30 pm
content: Quote from: ndictu on January 29, 2012, 04:15:04 pmAny halfway-decent compiler should be thinking about unrolling that sort of loop anyway as an optimisation, if it decides it has the code space to do so and the compilation settings allow such optimisations... (NB: I haven't yet seen the latest video but from the comments I guess this is a reasonably small loop to shift bits out on a serial bus!)

author: ndictu
author_rank: Regular Contributor
timestamp: January 29, 2012, 04:44:17 pm
content: Quote from: baljemmett on January 29, 2012, 04:31:30 pmOf course, but this depends on many many variables. But even if it doesn't unroll it shouldn't hurt.And yes, it's 8x data shift+mask, write to output and toggle clock. Wouldn't surprise me if it unrolled.

author: Bored@Work
author_rank: Super Contributor
timestamp: January 29, 2012, 04:47:36 pm
content: Quote from: baljemmett on January 29, 2012, 04:31:30 pmTypically one optimizes for space on such small micro controllers. However, since there is an AVR GCC behind it, you have more than enough flags to fiddle with to change optimization.

author: ecat
author_rank: Frequent Contributor
timestamp: January 29, 2012, 05:20:05 pm
content: For loops are an essential tool in a programmers kitbag but they are not a panacea. In something that could be a time critical I/O routine they should be viewed in a critical light, or at the very least understood in relation to the compiler and underlying architecture.Simple example:Code:for( i = 0; i < 8; ++i )output( i );The compiler will generate something similar to the following pseudo code...Code:i = 0;for_begin:if( !( i < 8) )goto for_exit;output( i );++igoto for_begin;for_end:Let's assume output() is defined as a macro which executes in a single instruction cycle typical of a micro controllers I/O instructions.if( !( i < 8 ) )a1) If i is declared as a register variable or the compiler decides to make i a register variable then this comparison will probably execute in a single instruction cycle.a2) If i is declared as volatile or the compiler decides not to make i a register variable then this comparison will probably execute in 2 instruction cycles plus one data fetch cycle.Our single cycle output instruction is now taking two, three or more cycles to complete. Further, if the programmer is not careful the actual time is dependent upon the whims of the compiler writer and a combination of, often obscure, optimisation settings.output( i );One instruction cycle.++ic1) If i is declared as a register variable or the compiler decides to make i a register variable then this increment will probably execute in a single instruction cycle.c2) If i is declared as volatile or the compiler decides not to make i a register variable then this increment will probably execute in 1 instruction cycle plus one data fetch cycle plus one data write cycle.Our single cycle output instruction is now taking another additional instruction cycle plus possibly 2 memory access delays.goto for_begin;d1) If you have a working branch predictor then this may take one or two cycles. If you have a pre-fetch buffer or cache then the jump may or may not require a new set of fetch cycles.d2) Without hardware assist as in d1) and depending on the underlying architecture a jump may require, say, 10 instruction cycles to execute.Our single cycle output instruction is now taking another additional two to ten instruction cycles plus possibly n memory access delays.The important things to understand are:A simple for loop may be 5 or 10 times slower than the equivalent linear code. Indeed a standard compiler optimisation is to un-roll the loop to produce linear code... which in itself may make things better or worse.Changing the variable qualifier, register/volatile, or having the compiler change it for you on the fly can have a significant impact on time critical code.It is unwise to make a blanket call without considering the underlying cpu architecture + cache + predicters.Compilers + optimisation can and will screw you over in some of the most inventive and unforeseen ways imaginable.If you are at all in doubt: KISS. You can usually find at least some time to optimise and beautify code once it's working, bosses love working code.

author: ndictu
author_rank: Regular Contributor
timestamp: January 29, 2012, 06:28:08 pm
content: Quote from: ecat on January 29, 2012, 05:20:05 pmIn case the inner code is just a single cycle. Which it often is not. The loop support code is basically constant in size and execution time. So with any non-trivial loop contents it becomes irrelevant. In case of a single instruction loop I would expect the compiler to unroll it anyway, and I probably wouldn't care. Because...Quote from: ecat on January 29, 2012, 05:20:05 pmThat's exactly right. I would write the loop. It's simple, readable and maintainable. In case it is too slow and doesn't work, then I would unroll it by hand. "Premature optimization is the root of all evil", as the mantra goes.Also, if you really want to have it unrolled... at least define a macro/inline function for it, more readable and can be easily changed around.

author: Bored@Work
author_rank: Super Contributor
timestamp: January 29, 2012, 06:32:28 pm
content: Quote from: ecat on January 29, 2012, 05:20:05 pmNo, it might or might not. Modern compilers are rather unpredictable in what they produce when they are really pushing optimization hard, and the good ones do push optimization hard.Decades ago it was different. Back then C compilers promised much but couldn't deliver much optimization. These days however, I often shit my pants when studying optimized C compiler output. On a good day a good C compiler approaches hand written assembler quality in some parts. On a bad day they still mess things up.As a consequence I have long given up on trying to second-guess what a compiler does. Especially I refrain from trying to "help" the compiler when coding. Help only gets in the way of the compiler's optimizer. The only exception is when a particular piece of code turns out to be too slow or too large. When I have hard measurements showing this, not just a gut feeling. Then, and only if it matters, I try to trick the compiler into doing better. It happens fewer and fewer over the years.BTW, One error you have in your analysis is thinking output() is a single instruction cycle. In the current case (Arduino code) it is a call to a rather messed up function in the Arduino library. That alone can lead a compiler's optimizer to completely different conclusions.BTW2: If you want to really unroll something, tell the compiler to do it. Usually the compiler makes less errors than the user, e.g. not missing two loop cycles :-)

author: baljemmett
author_rank: Unknown
timestamp: January 29, 2012, 06:51:13 pm
content: Quote from: BoredAtWork on January 29, 2012, 06:32:28 pmYes indeed; describe what you're trying to do in your code, and let the compiler worry about the best way to turn it into an instruction stream. It'll usually get it right, and when you can prove it doesn't there'll be a way to give it a prod in the right direction. See also Knuth's famed line, "premature optimisation is the root of all evil".(Which reminds me, I have a section of code that I thought was quite straightforward but the Hi-Tech compiler suggests might make a nice addition to their validation suite. That was quite a surprise; must send it off and see what they make of it.)

author: Unknown
author_rank: Unknown
timestamp: January 29, 2012, 07:18:24 pm
content: Quote from: ecat on January 29, 2012, 05:20:05 pmReal assembly from avr-gcc is more something like this:Code:i = 8;for_begin:do_something();if (--i) goto for_begin;The if and goto represent two assembly instructions; two or three cycles.Quote from: ecat on January 29, 2012, 05:20:05 pmHow many 8-bit micros have a brench predictor or pre-fetch buffer? The SRAM is simply running at the same speed as the ALU, so no need for caching or complicated pipelines. This means that jumps are quite cheap. On CPU's with long pipelines and complex caching strategies, it may get even more complicated, because unrolling a loop may prevent your code from fitting in the instruction cache, which can carry a huge performance hit.Quote from: ecat on January 29, 2012, 05:20:05 pmIn the worst case with a single cycle output instruction it would be three to four times slower in my example. In many cases (like in the Arduino library) it's likely to take longer (you may have to toggle a clock line for example), so the relative overhead is reduced even further.Quote from: ecat on January 29, 2012, 05:20:05 pmExactly. This is why it's usually unwise to second-guess the compiler unless you've done the research (eg. looked at the disassembly listing) or are an expert at that particular MCU architecture.

author: desowin
author_rank: Contributor
timestamp: January 29, 2012, 07:35:48 pm
content: As others already mentioned using loop there could be nice, I'll throw in my two cents about the unnecessary assignment. I believe the temp = value; before sending each data bit is redundant. The value of temp is not going to change in the meantime (and even if value changes in some interrupt, it's bad idea to use part of old and part of new value).

author: remoteledger
author_rank: Newbie
timestamp: January 29, 2012, 07:56:25 pm
content: Just sharing my experience with SPI. This is common to misconfigure data capture mode. Microcontroller allows you to set data capture on raising clock or on falling clock. So if controller thinks that receiver will accept data on falling clock and actual receiving device accept it on raising clock, then you'll get nasty data corruption it the best or no communication at worse.

author: ndictu
author_rank: Regular Contributor
timestamp: January 29, 2012, 08:30:53 pm
content: Quote from: BoredAtWork on January 29, 2012, 06:32:28 pmNicely said. Unless you really need the compiler to output some specific code, just do what is easiest, most readable etc. When you need some optimization, you can suggest it using compiler flags or keywords like inline (not sure about AVRs, but from I've read about modern x86/x86_64 compilers, they just ignore the inline altogether and decide themselves if it's a good optimization or not).And of course, if you really, really need to micromanage the code, throw in a block of assembly. But that should be the last resort.

author: ndictu
author_rank: Regular Contributor
timestamp: January 29, 2012, 08:42:16 pm
content: Quote from: desowin on January 29, 2012, 07:35:48 pmExcept the first temp = value; line, all others are redundant. (temp>>x) will just return the value and leave temp unchanged. As for the first one, I think it wasn't visible in the video where that came from, but I suppose it's a parameter to that function. In that case the temp variable is completely redundant.Dave: maybe you could publish the code somewhere (either just on the website; or preferably, in the long run, on some VCS hosting like github, bitbucket, google code etc). Software is something that can be easily collaborated over net, and people could start making improvements, bug fixes and adding features already.The good thing about for example github is that you get a visible list of all forks made by participants, and they can also send you pull requests. You can review each one and decide whether to incorporate it into your "official" repository (eg. bugfix), or not (eg. some personal preference about display style, features, ...).Of course, like everyone had their own vision of the schematic/pcb, this will probably end with a lot of people arguing over it. So maybe just put it on the site for now.

author: TerminalJack505
author_rank: Super Contributor
timestamp: January 29, 2012, 08:59:47 pm
content: I don't think it's worth the time or trouble to get worked-up about Dave's code at this point. If I were to guess I would say he simply hacked something together just to test the board.The code you saw in the video will likely change significantly by the time all is said and done.

author: IanB
author_rank: Super Contributor
timestamp: January 29, 2012, 10:00:16 pm
content: The last thing to do is open up a discussion over code. People will get into deep discussions and nit pick over the tiniest things, as has happened in this thread. If you think that happens over hardware designs, just wait and see how much worse it is over software. Every man and his dog is a software expert...

author: EEVblog
author_rank: Unknown
timestamp: January 29, 2012, 10:18:41 pm
content: Quote from: ndictu on January 29, 2012, 08:42:16 pmNo. This is a dictatorship, I'll code the way I like, no one else gets any say in it until it's releasedDave.

author: firewalker
author_rank: Super Contributor
timestamp: January 29, 2012, 10:31:13 pm
content: Dave, when you started the video the light was quite bright (I like it). At some time it dimmed. Do you use a spotlight and turned it off for the laptop's screen capturing?Alexander.

author: EEVblog
author_rank: Unknown
timestamp: January 29, 2012, 10:33:54 pm
content: Quote from: IanB on January 29, 2012, 10:00:16 pmYup, order of magnitude worse than hardware...I wonder if anyone if foolish enough to do a software coding video blog?Dave.

author: Zad
author_rank: Super Contributor
timestamp: January 29, 2012, 10:36:03 pm
content: I utterly HATE software religion wars. One simple SPI routine has turned into a war of optimisation, readability, what optimisation "really" means, what compiler is "best" and cock waving comparisons. This is why I prefer to stick with hardware.Move on guys. If it works, it works. If you want to rewrite it to please your particular software God, then feel free but don't drag everyone else into it. Linux only got anywhere because one person was in charge.

author: EEVblog
author_rank: Unknown
timestamp: January 29, 2012, 10:37:25 pm
content: Quote from: firewalker on January 29, 2012, 10:31:13 pmThe light in the new lab is crap and highly variable depending upon the angle. Usually I let the auto exposure setting on the camera pick and then change to manual mode to fix that setting, but sometime I tweak it by hand if it looks too dull on the playback screen.An yes, I have some small spotlight on arms too that I move around.Dave.

author: Bored@Work
author_rank: Super Contributor
timestamp: January 29, 2012, 10:45:16 pm
content: Quote from: Zad on January 29, 2012, 10:36:03 pmYou haven't read the postings you are commenting on, have you?

author: ndictu
author_rank: Regular Contributor
timestamp: January 29, 2012, 11:14:12 pm
content: Quote from: EEVblog on January 29, 2012, 10:18:41 pmYeah as I said in the last paragraph, it'll get much worse than the HW talks. You can of course ignore the suggestions, but as TerminalJack505 said, there probably isn't much to talk about for now.Quote from: BoredAtWork on January 29, 2012, 10:45:16 pmProbably not. I think we generally agreed about the best (well, at least better) way to do it. Not that it matters for a prototype, as long as it works.

author: naimis
author_rank: Contributor
timestamp: January 29, 2012, 11:38:19 pm
content: Quote from: EEVblog on January 29, 2012, 10:33:54 pmAs a "software guy", I'd have to really put some thought into finding a subject I'd consider less interesting for a video blog

author: Unknown
author_rank: Unknown
timestamp: January 30, 2012, 12:06:44 am
content: Quote from: EEVblog on January 29, 2012, 10:33:54 pmProbably, though I haven't bothered to look. Screencasts about software development seemed fairly popular a few years ago. Software doesn't lend itself as much to the video blog format, though. Seeing someone typing gets boring really fast, and the added value of seeing someone type it compared to just the code plus a description is quite limited. There are plenty of regular blogs though.Quote from: Zad on January 29, 2012, 10:36:03 pmI'd have to agree with BaW and wonder whether you've actually read this thread.Quote from: Zad on January 29, 2012, 10:36:03 pmYes, lets get back to the regular scheduled arguments about which micro is the best, which one Dave should use for his own projects and which brand of test equipment is the best. Not to forget comparing DMM sizes.

author: IanB
author_rank: Super Contributor
timestamp: January 30, 2012, 01:05:03 am
content: Quote from: alm on January 30, 2012, 12:06:44 amWhat else is the, "Ooh, you did it wrong, you should have used a loop!" argument all about?Dave's a big boy now, he's been around the block a few times, it's not like he's never heard of for loops. If he wants to do it that way it's his business.One reason software blogs in the net are so unproductive is because people perpetually get bogged down over the same questions that have been done to death a thousand times before. Such pointless time wasting is a sign of bad engineering. If it is readable, easy to edit, does the right thing in all cases, runs fast enough and fits in the available memory then it's good code. Look how easy it was for Dave to shift the two null bits from the end to the beginning. In hardware, shaving the component count might save you some costs in production; removing a couple of lines in software, not so much.

author: Unknown
author_rank: Unknown
timestamp: January 30, 2012, 01:30:00 am
content: Quote from: IanB on January 30, 2012, 01:05:03 amYou consider this a religious war?Quote from: IanB on January 30, 2012, 01:05:03 amCitation needed. I come across plenty of software blogs when searching for stuff, and they rarely seem unproductive to me. Joel Spolsky's blog is the most recent one that comes to mind. Sure, there's plenty of repetition, but it's not like there aren't a thousand blogs discussing how to connect a LED to an Arduino.

author: IanB
author_rank: Super Contributor
timestamp: January 30, 2012, 02:01:29 am
content: Quote from: alm on January 30, 2012, 01:30:00 amI really meant the comments/discussion part. There are certainly people out there with interesting things to blog about on software development (even if Joel Spolsky ran out of fresh material a long time ago).

author: EEVblog
author_rank: Unknown
timestamp: January 30, 2012, 02:23:15 am
content: Quote from: IanB on January 30, 2012, 01:05:03 amBingo.When writing something like this bit-bang routine, thelastthing I give a damn about is wanting to optimise things for code space in a for loop.With in-line rolled-out code like I did, when it doesn't work, I can simply hack individual bits very easily for troubleshooting purposes without dicking around with stupid loops.There is method to my madness.Dave.

author: PeteInTexas
author_rank: Frequent Contributor
timestamp: January 30, 2012, 04:04:17 am
content: How did I know the SMOP monster was going to rear its ugly head when those chips starting populating the board

author: PeteInTexas
author_rank: Frequent Contributor
timestamp: January 30, 2012, 04:08:57 am
content: Quote from: IanB on January 30, 2012, 02:01:29 amExcept for the straight forward "how-tos" and tutorial, software blogs tend to be a rant of one level or another. It gets old fast.

author: Lightages
author_rank: Unknown
timestamp: January 30, 2012, 06:57:59 am
content: Dave:In the last coupe of videos, not only did the brightness change, but so did the colour balance. To my eye it is very jolting but you already know I am a video producer and camera man. Perhaps you might want to set the colour balance to a fixed value instead of auto, if you haven't already.Secondly, the power supply looks to be a nice small package with many benefits. I just might buy one!

author: Rerouter
author_rank: Super Contributor
timestamp: January 30, 2012, 07:23:14 am
content: to try and break away from the software discussion,i assume you havent had time to start with the adc yet, as you said it was the companion one, i now fear that even 10 bit accuracy may have been thrown out of the window :/also, is there any tricks to trimming in a voltage reference?and to finish on a good note, good video as always dave, shows the use of a DSO with a one shot trigger

author: darrenb
author_rank: Contributor
timestamp: January 30, 2012, 10:33:32 am
content: I can't understand why Dave moved the zero bits from the end of the bit banging sequence to the front?From the look of the data sheet it appeared the bits at the end (least significant bits, the right hand end) were the ones that didn't matter? So they appeared to be correctly being sent at the end initially.

author: hans
author_rank: Super Contributor
timestamp: January 30, 2012, 11:06:32 am
content: Let's talk over more pressing matters, software is like.. it works as is, and quick enough? Good, moving on.I wonder if the analog parts of MicroChip aren't inherently 'bad'. As you mentoined, ADC's and DAC's in micro's are not as good as an external one. I don't know on what design they are making the external converters, but if it's the same as the micro's, you're still back to where we were.They also make like 22-bit ADC's with a claim of 18+ ENOB. I have no idea whether they will meet this specification. I have some of these lying around (MCP3551), but I really wonder whether these are spot on as well. Maybe they have a terrible offset of +100 counts if both inputs tied to GND hard.. not sure.I'd resort to another manufacturer, probably, for analog parts from seeing this. Well, they meet their specifications, but +/- 12 LSB is quite horrible (0.3% right there). Am I right in saying that the worst case situation, the output voltages could be off by 2-3% (voltage reference +/- 0.25%, FSR output +/-1%, linearity +/-0.3%, unwanted offsets)? Kinda a pity of all the precision resistors and current sense amplifiers, etc. I would probably pick a more precise DAC from AD or TI.Ah well, the given resolution was way better than required anywayFurthermore, if you really want a 'DC accurate' measurement, I think calibration is inevitable. A better resolution is ofcourse nicer because you can more precisely vary steps (only for that reason I'd smack in a overkill ADC or DAC for my hobby power supply which is probably a one or twice off).

author: EEVblog
author_rank: Unknown
timestamp: January 30, 2012, 11:21:41 am
content: Quote from: darrenb on January 30, 2012, 10:33:32 amFrom the formula in the datasheet, the output voltage would have been too high. I wanted 1mV/mA output.Dave.

author: darrenb
author_rank: Contributor
timestamp: January 30, 2012, 11:49:15 am
content: Quote from: EEVblog on January 30, 2012, 11:21:41 amHi Dave,But you're throwing away bits aren't you. Lets say for 10 bits of data being sent to the ADC the data sheet says to send it 16 bits, the first four bits being the configuration bits, the next 10 being the data bits and the last two being thrown away.Using 'C' for config bits, 'D' for data you want to send and 'X' for stuff it will throw away I think it said to send as;CCCCDDDD DDDDDDXX.But after the programming change it's now being sent as;CCCCXXDD DDDDDDXX where you're throwing away the two bits at the front and the ADC is throwing away the two bits at the end.I haven't done the math to figure out what the consequences of this would be but it doesn't seem right. Maybe this will fix the error you were seeing? Or maybe I'm missing something (happens all the time).

author: EEVblog
author_rank: Unknown
timestamp: January 30, 2012, 12:19:38 pm
content: The error I am seeing has nothing to do with this.I want and need 1mV/bit output, because that is what matches my current sense amp output. And to get that with the 2.048V reference and 12 bits I need to use the lower 10 bits with the x2 amp.Dave.

author: darrenb
author_rank: Contributor
timestamp: January 30, 2012, 12:55:40 pm
content: Quote from: EEVblog on January 30, 2012, 12:19:38 pmGudday again Dave,Yes you're right - forget the error it's probably not related and it's most likely not even an error in the first place.But.. Are you sure you're not just sending 8 bits to the ADC. The ADC wants two bytes or 16 bits. The first four bits are config bits so you're left with twelve. You're sending two zeros (discard bits) at the front and then 10 bits of data but the last two are being dropped by the ADC. 12 - 2 (at the front) - 2 (at the end) = 8 bits of significant data being sent.Based on the blog at 20:03 maybe the discard bits should be back at the end after the data bits instead of in front?

author: IanB
author_rank: Super Contributor
timestamp: January 30, 2012, 03:37:53 pm
content: I think I would do the experiment implied by darrenb's question: successively increment the lsb of the data word you are sending and see what the delta of the output voltage is each time you increase it by 1. Are you getting the output precision you expect to be getting?With a 2048 mV reference voltage and 10 bit resolution (= 1 part in 1024) I think you would expect the DAC output to increase by 2 mV with each step of the input word. If something is wrong the output would change in larger steps with every 2 or 4 increments rather than one small step per increment.

author: jaapiyo
author_rank: Newbie
timestamp: January 30, 2012, 03:54:15 pm
content: I don't know if anyone pointed this already, but I think it would be nice if Dave made diffident kits for different mains power specifications. (Like EU, US etc.)

author: slateraptor
author_rank: Frequent Contributor
timestamp: January 30, 2012, 04:12:44 pm
content: Quote from: darrenb on January 30, 2012, 12:55:40 pmDave is using a 12-bit DAC shifted out MSB first for the test; of the 12 bits, only the lower 10 bits are used. I don't know where you're getting the "- 2 (at the end)" part from.If you pay close attention to the bit-bang code after the corrections were made, you'll see:SPI_DATA <= 4 config bitsSPI_DATA <= 0SPI_DATA <= 0SPI_DATA <= (temp >> 9) & 1SPI_DATA <= (temp >>& 1...SPI_DATA <= (temp >> 1) & 1SPI_DATA <= temp & 1Quote from: IanB on January 30, 2012, 03:37:53 pmThe issue is simply that the significance of datasheet specs, in particular non-linear error, was overlooked; the chip is within spec.

author: baljemmett
author_rank: Unknown
timestamp: January 30, 2012, 04:13:31 pm
content: Quote from: jaapiyo on January 30, 2012, 03:54:15 pmI think it's designed to run off a plugpack or similar, rather than including the mains side of things -- so there shouldn't be anything that needs to change between mains systems.

author: IanB
author_rank: Super Contributor
timestamp: January 30, 2012, 05:28:39 pm
content: Quote from: slateraptor on January 30, 2012, 04:12:44 pmThat doesn't make sense from a design perspective. In an output word the least significant bits affect the resolution while the most significant bits affect the magnitude. If you masked the most significant two bits to zero in a 12 bit word you would completely change the output value, whereas if you masked the least two bits to zero you would keep the same value but lose a bit (two bits) of precision. If you wanted the different chips in the family to be plug-compatible you would want to be masking off the lower two bits of the 12 bit word to leave a lower precision 10 bit word.Although I have not had a chance to read the datasheet, I would be surprised if the chip designers dropped such a clanger.

author: slateraptor
author_rank: Frequent Contributor
timestamp: January 30, 2012, 06:12:33 pm
content: Quote from: IanB on January 30, 2012, 05:28:39 pmYeah, I see my error. Corrected code for 12-bit D/A using only 10 bits should have been:Code:SPI_DATA <= 4 config bitsSPI_DATA <= (temp >> 9) & 1SPI_DATA <= (temp >> 8) & 1...SPI_DATA <= (temp >> 1) & 1SPI_DATA <= temp & 1SPI_DATA <= 0SPI_DATA <= 0EDIT: Now that I really think about it, the previous code snippet I posted would work depending on how Dave worked out the arithmetic ofvaluebefore storing intotempfor the shift operation (which isn't shown). I'm confusing the crap out of myself.EDIT EDIT: Ok. Head straight. Direct-no-modification interchangeability between 12-bit and 10-bit D/A won't work without some code modification.If 2-bit zero mask is in MSB, then interchanging from 12-bit to 10-bit requires code modification because the 2-bit don't-cares is the last two bits sent on a 10-bit. For 12-bit, there's no scaling required for value, but for 10-bit, the zero mask will cause only 8-bit ranging if the value isn't scaled by a x4 multiplier.If 2-bit zero mask is in LSB, then interchanging also requires code modification. 12-bit D/A would have to /4 scale for the desired mapping; popping a 10-bit without getting rid of the /4 scalar would limit output to 255.Was the D/A even supposed to be interchangeable? Why bother if it can be shown that one performs better than the other?

author: IanJ
author_rank: Unknown
timestamp: January 30, 2012, 07:26:02 pm
content: Quote from: IanB on January 30, 2012, 03:37:53 pmI'd be inclined to do this also....but not just to rule out things like further code problems, but rather to test things like noise on the board amongst other things. Sure the datasheets seem to back up what he's getting but didn't Dave get some inconsitency with the repeatability of the output on his DMM?.........I haven't re-run the video to check again.PS. Dave, have you been told yet how many folks are jealous you get to play with this stuff all day!!!Ian.

author: Rerouter
author_rank: Super Contributor
timestamp: January 30, 2012, 07:34:59 pm
content: jaapiyo the supply is made to run off a plug-pack, all that needs to be changed is that and it would safely meet most foreign standards, being how you would be playing with plain DC on your end,

author: slateraptor
author_rank: Frequent Contributor
timestamp: January 30, 2012, 07:40:06 pm
content: Quote from: IanJ on January 30, 2012, 07:26:02 pmHow would measuring and recording the delta of 1024 steps rule out further code problems or test for noise? 12-bit INL alone is specified at +/-12LSB = +/-12mV at x2 gain. Even with all that data, you'd be hard pressed to determine if the error is internal to the D/A or external noise with just a delta snapshot.

author: ndictu
author_rank: Regular Contributor
timestamp: January 30, 2012, 08:14:29 pm
content: Well what do you know, today one webcomic I'm subscribed to posted this, kind of relevant:Source:Abstruse Goose 432 - O.P.C.- visit the authors website to support him and see the alt-text.

author: nixxon
author_rank: Frequent Contributor
timestamp: January 30, 2012, 11:09:41 pm
content: Quote from: ecat on January 29, 2012, 02:45:58 pmI noticed that as well. It must be completely insignificant, because I can see no comment to your post regarding the uncorrected SPI_CLK string in the code:I.e. at 13 minutes into the video there is a code line (3 lines below the code line that is altered) that is not changed:digitalWrite(SPI_CLK, LOW);It would have been nice with line numers in the code editor window, by the waynixxon

author: EEVblog
author_rank: Unknown
timestamp: January 30, 2012, 11:28:42 pm
content: Quote from: nixxon on January 30, 2012, 11:09:41 pmI'm well aware of thanks, thanks.It doesn't matter because it's only a first time initialise thing, the line is already low when it comes into the subroutine on the second pass.Dave.

author: Rutger
author_rank: Regular Contributor
timestamp: January 31, 2012, 03:31:33 am
content: Quote from: EEVblog on January 30, 2012, 11:21:41 amI agree that the zero bits need to be at the end as per the datasheet. This why when Dave start of at the low end of the mA range nothing seems to be happening, this is not noise but is cause by the truncation of the those low bit. Put the zero bit at the end and give it a try. This is also why the DAC seems to produce an output that is to low.Rutger

author: slateraptor
author_rank: Frequent Contributor
timestamp: January 31, 2012, 03:55:31 am
content: Quote from: Rutger on January 31, 2012, 03:31:33 amThat was the first thing that came to my mind earlier today. I eventually dropped the idea aftera bit of thoughtand convinced myself that the error is internal to the D/A.

author: Zad
author_rank: Super Contributor
timestamp: January 31, 2012, 05:57:52 am
content: Something that has occurred to me, and I need to follow up later with a good look at the schematic. Could it be that the offset is being partially imposed with the following op-amp's input offset bias?Don't jump down my throat if this is clearly a load of crap, I have only just woken up and it is 5 to 6 in the morning here

author: IanJ
author_rank: Unknown
timestamp: January 31, 2012, 07:44:54 am
content: Quote from: nixxon on January 30, 2012, 11:09:41 pmYep, the IDE sucks........so I use UltraEdit (IDE in external editor mode).In UE you can configure custom buttons on the toolbar (with a bitmap of your own choice). The button simply runs a wee bit of VBS code which sends keystrokes to the IDE to perform the compile/upload (next best thing to command line arguments which the IDE doesn't support).Net result, once you've opened your sketch in the IDE you just leave it there and never touch it again....everything is done from within UE.Code:Set objShell = WScript.CreateObject("WScript.Shell")objShell.AppActivate "Arduino 1.0"objShell.SendKeys "^u"Ian.

author: EEVblog
author_rank: Unknown
timestamp: January 31, 2012, 08:51:58 am
content: Quote from: Zad on January 31, 2012, 05:57:52 amNot when it'slessthan expected result.Dave.

author: shebu18
author_rank: Frequent Contributor
timestamp: January 31, 2012, 10:16:39 am
content: Dave, what IDE are you using? i recommend 0022 or 0020. They seem more stable and work better.

author: firewalker
author_rank: Super Contributor
timestamp: January 31, 2012, 11:27:27 am
content: 0022, 0020 is not just a different IDE. The API has changed.Alexander.

author: Shale
author_rank: Contributor
timestamp: January 31, 2012, 07:09:15 pm
content: Dave. Can you explain to me why you went through the trouble of laying out the design and having a board made etc, and then trying to program the board? I am very new to electronics, and I would have put it all on bread board and the cranked out the code to make sure I had everything right while still on the bread board. Is one way preferred over the other?

author: IanB
author_rank: Super Contributor
timestamp: January 31, 2012, 07:14:04 pm
content: I guess Dave felt he could separate the hardware aspects from the firmware/software aspects in the design by keeping things modular. Once you are confident about the hardware part you can fix that into a board layout since the conceptual functions of the micro are already accounted for in the big picture. Developing the program on the micro won't change the overall system configuration.

author: PeteInTexas
author_rank: Frequent Contributor
timestamp: January 31, 2012, 07:42:43 pm
content: Quote from: IanB on January 31, 2012, 07:14:04 pmYeah, but these pins with "alternative functions" is a " real trap for young players". Your reading the pin out diagram and thinking that is enough but once you start writing the software it turns out you can't use them that way (or simply not recommended to use them that way) in conjunction with some other choice you made for some other pins; eg that reset pin. Personally, I would have started with the software since that is the hardest part. I know, everyone seems to think its the other way around dismissing it as just a "small matter of programming".

author: Shale
author_rank: Contributor
timestamp: January 31, 2012, 07:43:09 pm
content: I guess what I was trying to say is that, How does he know all the hardware is right? the issue he is having with the DAC as an example?

author: IanB
author_rank: Super Contributor
timestamp: January 31, 2012, 08:00:46 pm
content: Quote from: Shale on January 31, 2012, 07:43:09 pmThat's probably just a matter of being confident in how things will work out, and finding a circuit board more convenient to work with than a tangle on a breadboard...(There can always be another board revision to iron out wrinkles.)

author: Shale
author_rank: Contributor
timestamp: January 31, 2012, 08:09:55 pm
content: Quote from: IanB on January 31, 2012, 08:00:46 pmI guess I am from a way of thinking that once you pay to get a board, or whatever, then you should already have the wrinkles ironed out. I may be looking at it in the whole wrong way since I am new though. and of course I thinking that from video 241 that the board cost $90. Maybe I am cheep, but seems like a lot of money to me to not be 100% sure. Is this normal in the industry?

author: IanB
author_rank: Super Contributor
timestamp: January 31, 2012, 09:07:44 pm
content: It's called "professional confidence". Once people reach a certain level of experience they can take steps like that and have sufficient confidence the design is going to work. Every now and then there will be a stumble, but on balance overall progress is faster when taking big steps than when taking smaller steps. Experienced practitioners tend to do the same in other fields too. You might also call it "impatience", but "professional confidence" sounds betterAlso remember that in industry $90 is small change, whereas for the hobbyist it is much more significant. I guess Dave is somewhere in between right now...

author: Short Circuit
author_rank: Frequent Contributor
timestamp: January 31, 2012, 09:28:31 pm
content: Quote from: Shale on January 31, 2012, 07:43:09 pmHe doesn't...EEVblog #17 – I hope your next project DOESN’T work!QuoteOf course this is normal practice in industry; $90 is less than an hour worth of work.Also prototyping and breadboarding does not eliminate errors. Build 2 or 3 real prototypes, and you can easily seperate stupid accidental mistakes from the real design errors.

author: ejeffrey
author_rank: Super Contributor
timestamp: January 31, 2012, 09:28:58 pm
content: Another thing to consider is that breadboards suckThey are hard to use, harder to debug, and unreliable (wires that look like they are in sometimes don't make good contact. They are hard to use for SMD, and get ugly quickly for a moderately complicated design. The worst part is that once you get your circuit working, it is very hard to see what you have, and very easy to make mistakes when converting it to a PCB.If you can afford it, it is much nicer to make a PCB that you know is 95% correct, make some layout choices to facilitate debugging and repair, and then fix it up with bodge wires until it works. Once you get all the bugs worked out, it is much easier to make the handful of changes to your PCB and send it out for a second spin. Considering there is a good chance you will make errors in your first PCB even if it is based on a working breadboard, it isn't necessarily much more expensive on average.In the professional world, if it saves an engineer a couple of hours of swearing at a breadboard, $90 is cheap. For a hobbyist that may or may not be the case. You can also etch your own boards to save money. This also takes some time, but has the advantage over a professional PCB of instant gratification.

author: EEVblog
author_rank: Unknown
timestamp: January 31, 2012, 09:42:09 pm
content: Quote from: Shale on January 31, 2012, 07:09:15 pmBecause to me it's important to have something real in my hands to play with, I prefer that to mucking around with a breadboard, as other have explained.A real board let's you play with the case and physical aspects early in the design process, and gives you a better sense of project being on track and keeps your enthusiasm up for the project.Most of my designs are SMD, so going to a PCB early is practically essential. That thinking just naturally follows over to through-hole projects.Dave.

author: asgard
author_rank: Regular Contributor
timestamp: January 31, 2012, 09:47:29 pm
content: Well, this is where I get to put my two cents worth (Yup, that's U.S. money, so that, and a banana will get you lunch for a monkeyOn the matter of the rolling/unrolling of loops: After more than a decade in the RTOS business (MIPS/68xxx/PPC) it always amazes me that in a memory-constrained architecture it is the time component that is consumed first. On the x86 and 68K the branch predictors are total shite. No matter that the pipeline "knows" in advance where the branch is going to be, and the prefetcher knows to start working even before the branch is taken, the lookaside cache gets flushed for _any_ passage through a conditional branch instruction, even if the branch is not taken. Believe me when I tell you that re-filling a flushed cache just sucks micro-ops, especially when the compiler optimizes nicely and ensures reference locality. You might also note which real-estate on the CPU die represents the cache manager, as you can put an LC film over the die and see which parts are heating up the most. Sometimes I have found out the bottlenecks in the application code that way. It also might reduce the design-life of the part.On the matter of the MCP DAC. I had a good and hard look through the datasheet and really don't have any idea of the internal architecture of the DAC. Is it successive approximation? Is it some kind of screwy Sigma-Delta method? How about double-buffered? If the output is going to a R-2R resistive ladder just how good is the trimming process? Hellifino. I too can remember the day when _really_ accurate 8-bit DACS (Burr-Brown comes to mind) required great chunky bricks of epoxy with hand-trimmed resistors with an actual eyeball making laser decisions for every single part. My brain curdles at the though of that job.

author: ejeffrey
author_rank: Super Contributor
timestamp: January 31, 2012, 11:22:49 pm
content: Quote from: asgard on January 31, 2012, 09:47:29 pmThe data sheet says it is a 'resistive string architecture' -- to me that means a chain of 4096 resistors in a voltage divider, mosfet switches for each tap, and a buffer amplifier. It seems a bit surprising to have that long of a string, but it would explain the large INL, and they do claim that it provides low DNL, which makes sense.

author: benemorius
author_rank: Regular Contributor
timestamp: February 01, 2012, 12:56:51 am
content: @DaveCan't you keep the 1mV/step you're after while disabling the x2 gain and the error associated with it by multiplying your value by 2 before sending it to the DAC? You don't actually need the DAC to scale all the way to 4.096V right? In the video, it looked like your error was at least somewhat smaller before you switched on the x2 gain. (closer to 2.5mV rather than 5mV)Also, by forcing the 2 MSBs to zero it seems to me that you're clipping your max DAC output to 1024mV (or 512mV with x1 gain). Obviously you'll catch that sooner or later, but it may as well be sooner.

author: janekm
author_rank: Unknown
timestamp: February 01, 2012, 01:23:59 am
content: I believe the formula referencing D/4096 in page 23 is a bit of a datasheet bug... It contradicts Table 4-1 on page 19 which states clearly that 1LSB = Vref /256 * G in the case of the 8-bit part (so for Dave's design that would be 16mV).So clearly the INL is still tightest for the 12-bit part as one would expect.Also, agree with @benemorius... The error will be less if only using the gain when it is needed for the full 4.096V range, as with the gain turned off 1LSB on the 12-bit part is .5mV so only +-6mV INL ( or even better by reducing the gain error, which is max 1% of FSR, or 40mV!).

author: Rerouter
author_rank: Super Contributor
timestamp: February 01, 2012, 10:07:36 am
content: from the size of the heatsink it looks like the case could potentally host an entire second layer of pcb and possibly even a third, if one wanted to mod that far, possible?

author: EEVblog
author_rank: Unknown
timestamp: February 01, 2012, 10:27:08 am
content: Quote from: Rerouter on February 01, 2012, 10:07:36 amIndeed. There is a second board to come...Dave.

author: Rerouter
author_rank: Super Contributor
timestamp: February 01, 2012, 10:47:32 am
content: and the case, you have been dragging us along on that

author: Bored@Work
author_rank: Super Contributor
timestamp: February 01, 2012, 11:38:24 am
content: Quote from: Rerouter on February 01, 2012, 10:47:32 amShould we start a betting pool?My money is on a stackable instrument enclosure from polycasehttp://www.polycase.com/zn2http://www.polycase.com/uploads/135971291909912.flv

author: slateraptor
author_rank: Frequent Contributor
timestamp: February 01, 2012, 11:48:59 am
content: Quote from: BoredAtWork on February 01, 2012, 11:38:24 amThey're not made Down Under...you sure you want to make that bet?BTW, thanks for the link. Never heard of these guys before.

author: EEVblog
author_rank: Unknown
timestamp: February 01, 2012, 11:53:56 am
content: Quote from: slateraptor on February 01, 2012, 11:48:59 amUnfortunately the only cases that are made in Australia are the Jiffy Boxes, as used in the uCurrent.The case is nothing special, nor secret, but now that everyone is keen to know, I'll tease a bit longer...Dave.

author: baljemmett
author_rank: Unknown
timestamp: February 01, 2012, 12:13:15 pm
content: Quote from: EEVblog on February 01, 2012, 11:53:56 amYou're a big meanie, DaveIt's the secret 'higher purpose' you've mentioned that intrigues me; I have my suspicions, but better to remain silent and be thought a fool and all that!

author: EEVblog
author_rank: Unknown
timestamp: February 01, 2012, 12:24:58 pm
content: Quote from: baljemmett on February 01, 2012, 12:13:15 pmIt's not really a "higher purpose" as such, like an application use like a battery charger some people have suggested. Its just more of a feature that I envisioned from the start that drove many of the decisions.Dave.

author: Bored@Work
author_rank: Super Contributor
timestamp: February 01, 2012, 12:46:41 pm
content: Quote from: slateraptor on February 01, 2012, 11:48:59 amWhat else should he use, carved wood?QuoteThey have some nice stuff. Unfortunately they have horrible shipping costs to Europe, so I tend to avoid them, unless my employer pays. I can think of better deals than $3 for an enclosure plus $50 to $80 for shipping.

author: markus_b
author_rank: Regular Contributor
timestamp: February 01, 2012, 02:02:40 pm
content: Quote from: BoredAtWork on February 01, 2012, 12:46:41 pmI have the same problem (Switzerland). In addition you start to pay taxes and custom fees when the price, including shipping exceeds $75 or so. A small $35 order then costs $120 because of $50 shipping and $35 tax+custom. The Chinese have learnt to deal with this as you can get cheap shipping to the world. This allows Dealextreme et al to thrive.

author: markus_b
author_rank: Regular Contributor
timestamp: February 01, 2012, 02:09:25 pm
content: One idea for the link to a PC, maybe on a daughter-board: Just use a low cost Bluetooth adapter. This provides a serial link with galvanic separation (no cable). On the PC it looks like a serial port, much the same as a USB/serial converter.With most PCs these days having Bluetooth built-in and such modules available for under $10 this looks very attractive. Example:Bluetooth module at Dealextreme, $6.60

author: FreeThinker
author_rank: Frequent Contributor
timestamp: February 01, 2012, 03:13:44 pm
content: Just a quick question from a noob to avr's is the sda line pulled high internally as I can't see one on the board?

author: Bored@Work
author_rank: Super Contributor
timestamp: February 01, 2012, 04:27:53 pm
content: Quote from: FreeThinker on February 01, 2012, 03:13:44 pmThe external pullups are in section C4 on the rev B schematics. AVRs do have internal, switchable pull-up's, however these are too weak for I2C.

author: FreeThinker
author_rank: Frequent Contributor
timestamp: February 01, 2012, 04:49:24 pm
content: Thanks for that B@W. Missed that section entirely...one of the problems with 'modular' schematics is traceing signals that go to umpteen places with no indication on the drawing (especially if you are not familiar with the system/operation) but I should have spotted that one. Getting old I guess

author: benemorius
author_rank: Regular Contributor
timestamp: February 01, 2012, 05:08:02 pm
content: Quote from: FreeThinker on February 01, 2012, 04:49:24 pmBut one of the huge advantages of pdf schematics is that you can use the search feature to follow net names around.

author: FreeThinker
author_rank: Frequent Contributor
timestamp: February 01, 2012, 07:23:33 pm
content: Quote from: benemorius on February 01, 2012, 05:08:02 pmNever thought of that. Tend to print things out (old school).....I really am showing my age

author: asgard
author_rank: Regular Contributor
timestamp: February 01, 2012, 08:35:48 pm
content: Quote from: BoredAtWork on February 01, 2012, 12:46:41 pm

author: Blue
author_rank: Regular Contributor
timestamp: February 01, 2012, 08:57:20 pm
content: Dave's teaser: Use two boards and you've got a +- powersupply....Nice for opamps etc...

author: EEVblog
author_rank: Unknown
timestamp: February 01, 2012, 09:56:24 pm
content: Quote from: asgard on February 01, 2012, 08:35:48 pmSorry, no idea.Yes, the heatsink is custom made for Altronics apparently.It was just the right size for my box.The holes are not the right height for a TO-220 package though which is annoying.Dave.

author: electrode
author_rank: Regular Contributor
timestamp: February 01, 2012, 10:22:16 pm
content: Quote from: BoredAtWork on February 01, 2012, 04:27:53 pmHmm? You can definitely use the internal ones for I2C. The Arduino Wire library enables them (20k??), which has been used numerous times without external pullups. There are situations where external ones are better though.

author: Unknown
author_rank: Unknown
timestamp: February 01, 2012, 10:45:27 pm
content: Maximum value for pull up resistors is determined by the capacitance of the track/cable and connected devices. I believe the max rise time for standard mode is 1 us. From the ATmega328p datasheet, the value of the internal pull-ups would be about 33 kohm for Vcc=2.7V, this would limit the capacitance to about 30 pF. The ATmega328p alone contributes about 10pF, this would leave another 10 pF for one slave and about 10 cm of PCB trace. It's probably not enough for multiple slaves or if connectors are involved.

author: Bored@Work
author_rank: Super Contributor
timestamp: February 01, 2012, 10:49:10 pm
content: Quote from: electrode on February 01, 2012, 10:22:16 pmThe Arduino people do a lot of rubbish things. And just because it sometimes works for them, it isn't a good idea. The build-in pull-ups are rather imprecise, varying up to 50k or maybe higher in older AVRs. Depending on the capacitive load and clock frequency you have on the I2C bus this becomes a gamble. The greater the capacitive load, the higher the clock frequency, the smaller the pull-up resistors should be. Therefore engineers put real pull-up resistors on the bus, while Arduino gamblers just throw the dice.

author: electrode
author_rank: Regular Contributor
timestamp: February 01, 2012, 10:58:15 pm
content: Fair enough. Just saying it can be done, and it usually successful. Other than quick and dirty tests on breadboards, I usually stick a couple of 4k7 or 6k8s, as my time in potential troubleshooting is worth more than 2 cents.

author: ModernRonin
author_rank: Contributor
timestamp: February 02, 2012, 09:47:29 pm
content: Since the DAC seems to be inaccurate, I wanted to ask what everyone thought about using some kind of closed loop control scheme for it. I realize this is probably the wrong answer; the right way to do things is to get a DAC that doesn't suck.But if there are no DACs that don't suck, or the non-sucky ones are so expensive as to be prohibitive and/or not available in through-hole... what needs to be done to close the control loop on the DAC?I mean sure, you can feed the DAC voltage back to the ADC and measure it. Now you're depending on the accuracy of the ADC. My guess is that high precision ADCs are a lot more expensive than high precision DACs.So, is there any way to do some kind of analog wizardry with the voltage reference we already have? Off the top of my head, my idea goes something like this... we already have a uCurrent on the board, so let's use it. Take the voltage reference and the output voltage of the DAC and connect them with a 1k resistor. Then use the uC to measure the amount of current flowing through the resistor. Said current being proportional to the voltage differential between the two sources. Then feed that number back into the AVR and do some math, and adjust the data being written to the DAC accordingly.Am I being completely insane here?

author: ejeffrey
author_rank: Super Contributor
timestamp: February 02, 2012, 10:00:11 pm
content: Any way you slice it, you have to trust your DAC or your ADC. How are you going to read the ucurrent? With an ADC.The best thing to do is to use an intrinsically linear DAC architecture. For instance, compared to a string DAC, an R2R DAC has much better INL although the DNL may be worse. PWM and sigma-delta DACs are nearly perfectly linear by nature, so they are a good choice when that is important. They work on the principle that a 1-bit DAC can't be non-linear as there are only two states. Two points define a line. Thus the techniques use interpolation in time to make intermediate values. This works because we can generate very stable clocks.

author: Rufus
author_rank: Super Contributor
timestamp: February 02, 2012, 11:52:05 pm
content: Quote from: ModernRonin on February 02, 2012, 09:47:29 pmNot completelyThe way to improve performance of DACs and ADCs with loose specification it so calibrate them (which would also calibrate out other error sources like the reference voltage and resistor matching).It is only software and an bit of NV memory and requires 5 minutes and a decent multimeter to perform. I think I remember Dave saying or writing he couldn't be bothered with scaling and calibration. If the PSU ends up being popular someone will write the software to do it properly.

author: Unknown
author_rank: Unknown
timestamp: February 03, 2012, 01:57:40 am
content: Doing that 5 minute calibration for a production run could be a pain, however, although it wouldn't be such an issue with a kit. For a batch of 50, like with the uCurrents, it would require about four hours. I guess Dave could think of a more enjoyable way to spend those four hours, for example by ranting about Microchip DACs. It also requires the error to be stable.

author: Rerouter
author_rank: Super Contributor
timestamp: February 03, 2012, 11:09:28 am
content: software calibration procedure wouldn't be that bad if the user had to do it, turn on kit, hold in 2 buttons as it starts up,then measure and trim in with the rotary encoder, and have it update on each time you fill in the value to narrow the error, until each value matched up exactly?then one could probably get away with a correction formula, maybe a bit complex to make something to accurately calculate over the whole range, (please shoot me down if i am wrong, just thinking) or are math functions really that performance prohibitive, as i can neither see any way to calibrate the reference, DAC or ADC short of software,

author: dcel
author_rank: Regular Contributor
timestamp: February 03, 2012, 02:07:20 pm
content: Hi all...I believe I found a possible answer to the last addendum of the video regarding the I2C bus problem with the LCD. I think it is the -ACK from the LCD trying to pull that line low. I found this info in my datasheet for the MCP23016 that I have. Apperantly, there are a few protocols for I2C and some slaves -ACK and some dont, esp., if being read from exclusively. If someone more knowledgeable than I about I2C would chime in that would be great.Chris

author: FreeThinker
author_rank: Frequent Contributor
timestamp: February 03, 2012, 05:16:20 pm
content: Quote from: dcel on February 03, 2012, 02:07:20 pmYes This has been pointed out by a couple of people. Seems logcal to me that the device SHOULD ack data sent but not all devices do (apparently) not very helpfull in a fault situation. Don't think it is a big deal but easily fixed (I think)

author: Rutger
author_rank: Regular Contributor
timestamp: February 05, 2012, 01:25:45 am
content: Dave, I was looking at the different options for the DAC, because I was looking at the dual version of your power supply (eg with a negative output as well) and came across the following 4 channel 12 bit DAC:MCP4728-E/UN at $ 1.44 / 100 with build in voltage reference (optional).I know you didn't want surface mount parts but with the Maxim 4080 and the voltage ref chip you have chosen that option is already gone.The advantage of having the extra 2 channels is that you can add/drive another power supply from the same DAC. And you can save on the cost of the parts, maybe you eliminate the external voltage ref chip.Rutger

author: Rerouter
author_rank: Super Contributor
timestamp: February 05, 2012, 01:40:22 am
content: the thing is, until dave reveals the second board, it seems pretty clear his design had in mind only a single supply, and until he reveals his secret purpose, a dual dac is all thats needed, albeit a better quality one at a similar price is something he is likely looking out for, (about $6 for a dual dac without such an insane offset)

author: firewalker
author_rank: Super Contributor
timestamp: February 05, 2012, 02:28:07 pm
content: Are you sure there will be second board (did Dave mentioned something?)? Maybe the space is needed for a flat lead acid battery.Alexander.

author: Nick Gammon
author_rank: Contributor
timestamp: February 05, 2012, 10:49:36 pm
content: Quote from: EEVblog on January 29, 2012, 10:18:41 pmForgive me if this has been covered elsewhere, but why are you bit-banging SPI in the first place? The Atmega328 has hardware SPI, and hardware I2C. Sending data to the device should be as simple as:Code:digitalWrite (SS, LOW); // or high, whatever is requiredy = SPI.transfer (x); // send a byte, get one backdigitalWrite (SS, HIGH); // finished with slave

author: electrode
author_rank: Regular Contributor
timestamp: February 05, 2012, 10:54:11 pm
content: From Dave at the video comments on the main page:Quote from: Dave(Would this have been a problem if all on the hardware bus anyway?)

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 12:02:04 am
content: Er, but ...SPI isdesignedto be paralleled up. Not using it in the core device, but leaving it free for something people might or might not add, seems to me to be doing it backwards.You already have the separate chip selects, which you need to activate each chip. Now all you have to do is share the SPI pins (MOSI, MISO, SCK). The only (device) output line (MISO) goes high-impedance whenever the target device is not selected. It's designed like that.That is not at all taking away the ability to use other chips like Ethernet, SD cards or whatever. They would each just need their own chip select, and I see you have four free on the MCP23008 chip anyway.The hardware SPI has buffers, interrupt capability etc.In fact, freeing up your SPI-DIN, SPI-CLK etc. pins would mean you can probably bypass having to use the port-expander just to toggle the chip select lines. So, the whole thing becomes much simpler.Quote from: electrode on February 05, 2012, 10:54:11 pmNo, that's my point.

author: EEVblog
author_rank: Unknown
timestamp: February 06, 2012, 12:21:29 am
content: Nick, you've missed the whole point.The point is that keeping the bus entirely free allows people to do anything they want with it, not just SPI.Beginners can play with the pins and port, or the SPI or whatever and not have to worry about screwing up the existing ADC/DAC interface.And it allows the separate DAC/ADC interface to operate on it's own timer interrupt or something similar as well without having to worry about conflicts.Dave.

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 12:42:16 am
content: OK, Dave.Adding an Ethernet interface to a sophisticated power supply doesn't sound to me like a beginner project, but you're the boss!I look forwards to seeing it.

author: electrode
author_rank: Regular Contributor
timestamp: February 06, 2012, 12:45:09 am
content: Speaking of looking forward, is there an ETA on part 9?

author: EEVblog
author_rank: Unknown
timestamp: February 06, 2012, 01:07:45 am
content: Quote from: Nick Gammon on February 06, 2012, 12:42:16 amThe whole point of going the Arduino route is that it does become trivial for anyone to add such a feature.I'm not that fussed myself, but people may very well want to add such a thing.Or experiment with the ports in unknown ways for their own purposes etc.The more you decouple the core function like ADC/DAC from the expandability ports, the easier it all is.Why do you think many modern micros have more than one SPI and I2C port?If this AVR had two hardware SPI ports I still would have used two separate hardware SPI ports for this very reason.Dave.

author: EEVblog
author_rank: Unknown
timestamp: February 06, 2012, 01:09:40 am
content: Quote from: electrode on February 06, 2012, 12:45:09 amI don't have ETA's.I don't even know what Part 9 will be until I decide to do it.I have the PCB layout time lapse to do, maybe something on the 10bit DAC and ADC parts if there is something worth sharing there, maybe the 2nd board or system engineering part, I don't know....Dave.

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 01:29:22 am
content: Quote from: EEVblog on February 06, 2012, 01:07:45 amIt doesn't need two hardware SPI ports because you can share them between multiple devices. Ditto for the I2C port.Having said that, though, the hardwaredoessupport "USART in SPI Mode" (page 204 of the datasheet). So you effectively have two SPI ports (although the USART one is master only, not that this would matter in your case).I'm not sure what multiple SPI ports really gives you. Already SPI is pretty fast (eg. about 3 uS per byte, which is around 48 clock cycles). Pretty much as fast as an interrupt can be serviced. So realistically you could only use one SPI port at high speed anyway (by the time you store the data, loop, test if it's time to get another byte and so on).QuoteOnce you bit-bang, interrupts become more of an issue becauseyouare handling the timing, not the hardware.Anyway, thanks for sharing all your design ideas, it's interesting to see how it all comes together.

author: IanB
author_rank: Super Contributor
timestamp: February 06, 2012, 01:33:54 am
content: There's an interesting design conundrum here. One tries to separate the core functions from the bits people might want to hack, so that misguided hacks don't break the core functions. However, the whole thing inside the MCU is operating on software, and if someone hacks the software badly they could break everything. The ultimate solution here would be two MCUs--one dedicated to the core device function running a fixed program, and one for user programming separated from the core functions with protected interfaces...

author: EEVblog
author_rank: Unknown
timestamp: February 06, 2012, 01:39:50 am
content: Quote from: Nick Gammon on February 06, 2012, 01:29:22 amIn this case I've made it very clear what advantage it gives you and anyone playing around with it.A beginner can now screw around with the SPI/serial I/O interface all they want without worrying about screwing up any of the core functionality of the project.IMO that is a big advantage and is a main reason why I did it that way.When designing stuff like this you have to think about those sorts of little things that might make someones life easier down the track, or give them the flexibility to do something you as the designer haven't thought of.Dave.

author: EEVblog
author_rank: Unknown
timestamp: February 06, 2012, 01:44:15 am
content: Quote from: IanB on February 06, 2012, 01:33:54 amAnd that's the trick.Nick is saying don't bother, forget it, just use the most elegant technical solution because you canMy approach is to do some small things in this regard that may possibly help some people people down the track (maybe even myself).And you propose designing the Space Shuttle by committeeDave.

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 02:21:30 am
content: Quote from: EEVblog on February 06, 2012, 01:44:15 amYou've certainly helped me, Dave.Heck, I even made up your dummy load a couple of days ago. Picture here:http://gammon.com.au/forum/?id=11525What I like about your approach is that you often describe the elegant technical solutions. For example, in the first video for the power supply you showed how you could have used two voltage regulators (one for current and one for voltage) but with careful, elegant, design, you cut it down to one. I like that.You research stuff, and you choose the right part for the job.

author: EEVblog
author_rank: Unknown
timestamp: February 06, 2012, 03:30:54 am
content: Quote from: Nick Gammon on February 06, 2012, 02:21:30 amNot always.Sometimes I just do things because I want toDave.

author: Rutger
author_rank: Regular Contributor
timestamp: February 06, 2012, 06:38:30 am
content: Dave, on the video you told us that putting the rotary encoders on the I2C I/O would not be a good idea. But speed isn't really an issue with encoders is it? Could you explain?Rutger

author: electrode
author_rank: Regular Contributor
timestamp: February 06, 2012, 06:43:38 am
content: One reason (and I think this is what Dave said in the video), is that you want to read a rotary encoder from pin change interrupts, which is most easily done using the appropriate pins directly on the uC.

author: EEVblog
author_rank: Unknown
timestamp: February 06, 2012, 07:05:36 am
content: Quote from: Rutger on February 06, 2012, 06:38:30 amYes, the reason was primarily easy and fast interrupt capability.I'm not using interrupts at the moment BTW, and update rate does in fact matter, a lot as it turns out. My first attempt at main loop code had me doing everything once per loop (update LCD, read I2C switches, read rotary encoders etc), but I was easily missing rotary encoder steps when turning the knob very fast. I had to increase the rotary encoder checking 1000:1 to the other code to get a sufficient encoded update rate.Dave.

author: Rutger
author_rank: Regular Contributor
timestamp: February 06, 2012, 07:26:46 am
content: Running out of processing speed? You might want to consider putting a faster chip in the board, like the ATMEGA328 that can run easily 2 times faster at 16MHz.And you can even clock it at 20Mhz!Another thing I noticed looking at the DAC specs is that the internal error is less if you use the higher supply voltage. Have you tried feeding it 5V instead of 3.3V?I might bread board the Rotary encoders using the I2C chip with the interrupt and see if I can get it to work that way. I hate to waste 4 ports on 2 encoders.Rutger

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 08:17:51 am
content: I did a post about rotary encoders and interrupts:http://www.gammon.com.au/forum/?id=11130You can make one rotary encoder use a single "external" interrupt, and since you have two encoders, that takes care of the two external interrupt pins (ie. D2 and D3). (A bit of circuit rejigging might be required).If that isn't feasible or desirable, pin-change interrupts, although more fiddly to work with, might do the trick.I found when I was playing with rotary encoders that, whilst they can be made to work reliably, swapping two lines of code can impact reliability significantly. It's all about race conditions.QuoteThe chip he is using will run at 16 MHz (at 3.78V). I don't think that is the problem. Although to save a dollar, I'm not sure why I wouldn't just go with the chip with more RAM and program memory. At 3.3V he can run at 12 MHz if speed is an issue, but really with interrupts that shouldn't be a problem.

author: nessatse
author_rank: Regular Contributor
timestamp: February 06, 2012, 08:26:59 am
content: Quote from: Rutger on February 06, 2012, 07:26:46 amI don't think that is quite necessary. The main rason for any slowness are the bloated Arduino libraries. Just replacing crap Arduino calls likedigitalWriteanddigitalReadwith direct port reads and writes will make a huge difference already. Just look at the Arduino library source code if you need convincing.

author: Rerouter
author_rank: Super Contributor
timestamp: February 06, 2012, 08:31:34 am
content: nickgammon, personnaly i do not understand how your rotary encoder method would work, would it not involve atleast 2 pulses to tell direction, in place of 1 for daves method,

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 08:39:18 am
content: Quote from: nessatse on February 06, 2012, 08:26:59 amThey are not crap, they do what they are designed to do, which is to simplify programming. Direct port reads and writes will be faster, particularly if you know in advance what port you want to access. In that case, variable reads can be replaced by constants, which of course will be faster. But if you want to set (say) 10 consecutive pins to output then it becomes trickier. Or if you you need to set some pin, which pin you don't know until runtime, then you need to do a table lookup, which then slows things down to the speed of the libraries. They didn't make them slow to amuse themselves.In any case, reading rotary encoders is best done by an interrupt service routine, in which case the question of whether or not digitalRead is slow becomes a bit academic.

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 08:51:29 am
content: Quote from: Rerouter on February 06, 2012, 08:31:34 amThese are the conditions:Code:Forward direction: LH then HH, or HL then LLReverse direction: HL then HH, or LH then LLGiven a state change on one of them (eg. the first one) and looking at this code:Code:// Interrupt Service Routine for a change to encoder pin Avoid isr (){if (digitalRead (PINA))up = digitalRead (PINB);elseup = !digitalRead (PINB);fired = true;} // end of isrIf the first pin (PINA) is (now) high then we are going up if PINB is HIGH (LH -> HH).If the first pin (PINA) is (now) low then we are going up if PINB is LOW (HL -> LL).Otherwise we are going down.One interrupt and we know what we are doing.

author: nessatse
author_rank: Regular Contributor
timestamp: February 06, 2012, 09:37:07 am
content: Quote from: Nick Gammon on February 06, 2012, 08:39:18 amI can't think of many embedded applications where youdon'tknow in advance where your peripherals are connected. If you compare the Arduino code:Code:void digitalWrite(uint8_t pin, uint8_t val){uint8_t timer = digitalPinToTimer(pin);uint8_t bit = digitalPinToBitMask(pin);uint8_t port = digitalPinToPort(pin);volatile uint8_t *out;if (port == NOT_A_PIN) return;// If the pin that support PWM output, we need to turn it off// before doing a digital write.if (timer != NOT_ON_TIMER) turnOffPWM(timer);out = portOutputRegister(port);uint8_t oldSREG = SREG;cli();if (val == LOW) {*out &= ~bit;} else {*out |= bit;}SREG = oldSREG;}with the staightforward example:Code:PORTB |= _BV(SOME_PIN);(which incidentally usualy gets optimised to a single instruction)there can be no argument as to which one has no place in production code.QuoteTrickier than what??QuoteNot really. Bloated and slow code is bad, whether in an ISR or not

author: electrode
author_rank: Regular Contributor
timestamp: February 06, 2012, 09:43:38 am
content: What if I want my code to be directly portable to the Arduino Mega, the Maple (ARM), or the upcoming ARM Arduinos?digitalRead(), et al. functions are for both readability and portability. Efficiency is always compromised as you go higher in level with programming languages. If there weren't convenient advantages, we'd all be coding in assembler instead of Java, C++, Objective C, etc.

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 09:56:44 am
content: Quote from: nessatse on February 06, 2012, 09:37:07 amThat's your opinion, right?There's a school of though that unreadable code is bad.Compare:Code:PORTB |= _BV(SOME_PIN);to:Code:digitalWrite (10, HIGH);In your case you have to make sure that you have PORTB right, and SOME_PIN right. Back to the datasheet, to see if pin 10 is on PORTA, PORTB or PORTC. And work out which bit SOME_PIN is.And if I read your code I have to check you got it right.But if I read:Code:digitalWrite (10, HIGH);... I know someone is setting pin 10 on. No argument.And as electrode says, the higher level code is portable.Code:Bloated and slow code is bad ...Does it matter if I am turning on a light in fish tank? Do the fish notice if the light comes on a few microseconds later? Come on.The same applies to the power supply. Does it *really* matter if, when you turn the knob, the voltage goes up a microsecond later using one method then when you turned the knob with another method? No, because your ability to react to cause-and-effect at a human level isn't that fast.And as for the bloat, I agree in principle, but this sort of code is not going to use all of the 16Kb/32Kb of the flash memory whichever way you do it.After watching Dave spending - how long? - debugging the SPI problems ... was it really worth it to save a few bytes, when he will have 12 Kb over anyway?

author: Rerouter
author_rank: Super Contributor
timestamp: February 06, 2012, 10:06:27 am
content: the better question is how are we going to make use of those free KB,

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 10:08:03 am
content: Some kind of Easter Egg, I think.When you dial up 5.55 volts, it pumps out100555 amps and fries your chip to a cinder!Muahahahah!

author: Bored@Work
author_rank: Super Contributor
timestamp: February 06, 2012, 10:18:00 am
content: Quote from: Nick Gammon on February 06, 2012, 09:56:44 amBut Dave did use the oh so great Arduino calls, so your argument doesn't cut it.Frankly said, you do the typical Arduino wanking. No, portability is not relevant here, because you ain't gona need it. Dave's MCU will not magically fall of the PCB and a replacement appear via quantum tunneling. And in fact, if you need portability, then you could do it with a few defines.In real embedded systems programming of tiny devices, as opposite to Arduino wanking, everything done dynamically at runtime, that could be done statically at compile time, is bad. Because it significantly increases the risk when something in the system runs wild.And while we are at it, your encoder reading via interrupts is also a no-no in real embedded programming, especially if they are hand-operated. Mechanical encoders bounce. This results in additional, superfluous interrupts. For every bounce interrupt the CPU has to shitcan what it is currently doing, save registers and execute the interrupt handler. That overhead is unpredictable, especially when the mechanics in the encoder gets weak over time, while on the other hand regularly sampling the encoder is predictable. I have previously posted in some of the power supply threads how to do encoder reading the right way. I have deleted that posting because of the Arduino wankers who anyhow won't get it. For the rest who want to learn, I encourage them to go out and check how to properly sample and decode an encoder in a predictable way.

author: electrode
author_rank: Regular Contributor
timestamp: February 06, 2012, 10:24:10 am
content: Quote from: BoredAtWork on February 06, 2012, 10:18:00 amIs that necessary? Most countries have a court system, where I'm sure that if Arduino really did come to life and murder your family, it would've been locked away by now.

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 10:30:04 am
content: Quote from: BoredAtWork on February 06, 2012, 10:18:00 amNo, he didn't. He didn't use the SPI.transfer as I suggested.As for the rest of your post: "if you can't attack the argument, attack the man".

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 10:31:35 am
content: Quote from: BoredAtWork on February 06, 2012, 10:18:00 amYou deleted it because it doesn't work.My post stands.

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 10:34:27 am
content: Quote from: BoredAtWork on February 06, 2012, 10:18:00 amI'm a little surprised the moderators allow this sort of talk. Enjoy your little world.

author: Rerouter
author_rank: Super Contributor
timestamp: February 06, 2012, 10:36:15 am
content: Please guys can we get this back on topic, not infighting about arduino, :/Dave, what are the dimensions of the board?

author: nessatse
author_rank: Regular Contributor
timestamp: February 06, 2012, 10:37:05 am
content: Quote from: Nick Gammon on February 06, 2012, 09:56:44 amYes, it is my opinion, but one which is generally shared by most software developers, except perhaps Arduino fanboys.QuoteAnd pin 10 is?? Some arbitrary numbering invented by the Arduino folks?. If anyone considers my example 'unreadable', then one has to wonder why they are doing embedded programming. In any case, it is easily replaced with a macro, or even an inlined function. Very readable, but orders of magnitude more efficient.QuoteProbably not, if you are only doing simple 'flashing LED' type applications.I am often somewhat surprised when I see a lot of effort going into hardware design, choosing the right components, optimising component cost vs performance, etc., and then to be happy finishing it off with sloppy code'because it's good enough'. (BTW, I am making a general comment here not referring to Dave's PSU)

author: Nick Gammon
author_rank: Contributor
timestamp: February 06, 2012, 10:50:37 am
content: Quote from: nessatse on February 06, 2012, 10:37:05 amIf insulting people is how this forum works, I will happily leave it right now.My first processor had 256 bytes of memory, so I know something about writing tight code. But you don't really care about that do you?If you really, truly, believe that you can prove how smart you are by calling people "wankers" and "fanboys" well, welcome to a small, closed world of people who don't mind being insulted./unsubscribe

author: EEVblog
author_rank: Unknown
timestamp: February 06, 2012, 10:52:44 am
content: Quote from: Rerouter on February 06, 2012, 10:36:15 amAbout 120mm x 102mm or thereabouts.Dave.

author: IanB
author_rank: Super Contributor
timestamp: February 06, 2012, 04:24:46 pm
content: Quote from: Nick Gammon on February 06, 2012, 10:50:37 amPlease ignore the idiots. I for one like your contributions. The idiotic posters around here are the reason so many forums have an iron fist moderation policy. Dave is more liberal than that, but it does mean we have to put up with a certain background noise level.

author: nessatse
author_rank: Regular Contributor
timestamp: February 06, 2012, 06:03:46 pm
content: Quote from: IanB on February 06, 2012, 04:24:46 pmI won't speak for BAW, he is very capable of defending himself, but I think if anybody is going to be so offended by the mere mention of the wordfanboy, then he'd probably be better off not using the Internet at allAs for the 'idiots' reference you made, perhaps you should rather present counter arguments to the relevant points of discussion, I don't believe either BAW's or my own comments can be considered idiotic.In my case I am really just trying to say that we should hold software design to the same standards as hardware. We go through a lot of effort minimising component counts, getting good PCB layouts etc, it seems a shame to finish it off with software that does not hold up to the same engineering standards.I have no problems with the Arduino per se, in fact I have one permanently on my desk that I use for quickly testing proof of concepts, etc. But would I use the Arduino libraries in production code? Very unlikely, for reasons I have already mentioned.

author: IanB
author_rank: Super Contributor
timestamp: February 06, 2012, 06:14:18 pm
content: Quote from: nessatse on February 06, 2012, 06:03:46 pmThere's nothing at all wrong with debate about the merits of different designs. It is to be expected that people disagree. They always will.My 'idiots' reference is purely about the tone of comments made by various posters. The number of times I read a post and gois enormous.Personally I just think to myself "what an idiot" and ignore the post. Your job as a poster is to invite me to read and enjoy what you write. If you as a poster choose to fill your comments with sarcasm and snide comments and insults then you don't make the sale and you have failed. Simple as that.And of course you do need a bit of a thick skin to survive on the net. It's no place for wimps.

author: olsenn
author_rank: Frequent Contributor
timestamp: February 06, 2012, 06:23:36 pm
content: What's with all the power supply crap on this forum... does it really require 8+ video blogs and dozens of forum topics? If you need a high quality PSU then you're best off just buying one professionally designed/built, and if you're just trying to get a start into product design don't you think maybe something a tad simpler, smaller, and not involving mains power would be a better first project?

author: Zad
author_rank: Super Contributor
timestamp: February 06, 2012, 06:28:53 pm
content: Well done Olsen on totally missing the point of the videos.Can you point to where you think the mains voltage is? No, thought not. It uses a generic brick mains adaptor. No mains potential is involved in he project at any point.If you don't like it, don't watch them. You haven't paid for them, so where is the problem?

author: Rutger
author_rank: Regular Contributor
timestamp: February 06, 2012, 06:29:43 pm
content: I think you missing the point.It isn't always about the destination, but enjoying the journey getting there.Rutger

author: olsenn
author_rank: Frequent Contributor
timestamp: February 06, 2012, 06:36:53 pm
content: Didn't mean to offend anyone haha, I just (as you say) am missing the point. I think "the journey getting there" is always, or always should be, the most fun part of ANY electronics project (or any project really), I just don't see why so many people seem to choose this one, while no other projects (as far as I know --correct me if I'm wrong) are mentioned to any great detail here.Knock yourselves out with all the PSU stuff though guys; I didn't mean to step on your project

author: Bored@Work
author_rank: Super Contributor
timestamp: February 06, 2012, 06:40:36 pm
content: Quote from: Nick Gammon on February 06, 2012, 10:31:35 amMy stuff works in the field. Your stuff just works in your imagination.

author: IanB
author_rank: Super Contributor
timestamp: February 06, 2012, 06:46:40 pm
content: Quote from: olsenn on February 06, 2012, 06:36:53 pmIt's really Dave's project; we are only watching it.But in reality look at how much ground Dave has been covering in both analog and digital design. The PSU aspect is really just a vehicle to carry all sorts of other interesting things that have wider application.

author: Rutger
author_rank: Regular Contributor
timestamp: February 06, 2012, 07:18:32 pm
content: I agree with Ian, I have learned a ton of stuff from the videos that can be applied to any project.Dave has really explained the whole design/prototyping and building of a electronics project with micro controller and software from beginning to end (which is still to come).Sure there a tons of PSUs out there, but I don't know of one with a open source Arduino compatible Mirco! I think because of this there is a lot of interrest in this project, it is not just another PSU, but one with 'intelligence'.

author: electrode
author_rank: Regular Contributor
timestamp: February 06, 2012, 10:21:44 pm
content: Quote from: olsenn on February 06, 2012, 06:36:53 pmBecause it's exciting to see an electrical engineering design taken from start to finish. Other than small modules and bits and pieces, this and the uCurrent are the only two projects Dave has taken us through in such detail. It's definitely interesting, even for those of us that don't need the design in its current form (eg. I'd have 2 x 0-15V @ 1A supplies for series/parallel and omit the uCurrent and a bunch of the I/O and not bit-bang anything).

author: electrode
author_rank: Regular Contributor
timestamp: March 04, 2012, 12:05:42 pm
content: Quote from: EEVblog on February 01, 2012, 11:53:56 amHas the case been revealed yet? Or can we still place our guesses?Amp Hour Episode #73 somewhere around the 20 minute mark had a reference to a Hammond case. A screenshot of Dave's PCB from YouTube gives something that is 3.3 ATmega328s wide (~112mm) and slightly less deep (~100 odd mm).So the case is one of the ones from here:http://www.hammondmfg.com/scpg.htmPossibly this one (if my dodgy measurements were 10% undersized):http://www.hammondmfg.com/pdf/1598B.pdf