Added: 1 month ago
From: EEVblog
Views: 11,940
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (130)

Sign In or Sign Up now to post a comment!
  • Can you do a video on how you got the LCD running? I have the same one but am having trouble even getting it to say "hello world".

  • Hi, I really wonder about power. It is said to be un-clean power in the electric outlets which could damage electronics. (Especially at high K-indices according to Yahoo News) Is there a way to "clean " this from spikes and other things? I have some older music equipment without a "grounded" wall socket plug. So a "cleaner" would be nice too. Have you had any such VLOG?

  • Hi Dave, I'm fascinated to see how this project turns out. I'm sure it'll work well enough and I find my projects usually do too unless I get lazy and fail to complete; a big problem for me. Where I'm weakest however is making the enclosure look good, practical and different enough to stand out from the crowd. When is the next part coming???? when, when when? (Drools)

  • @DuncM0OFL Yes, laziness can be a killer, as you another interesting project to divert your attention. I'm surprised I've got this far with this project!

  • Programming my first PWM DAC for college and they are bitches to make work properly..

  • Love the design! But, why the sudden change to use a 10 bit DAC? Now, you're going to have 2mV steps instead of the original 500uV steps, if my math is correct.

  • Very interesting video. I can't say I understood all of it, but more of this type of thing please Dave! :-)

  • SHUT UP AND TAKE MY MONEY ALREADY! Seriously though, you ARE going to sell this as a kit right?? I want one of these!

  • @thefatmoop Yes, a kit is indeed the plan.

  • Dave, do a global search/replace in your code and change SPI_CLK for SPI_SCLK. I saw another error in there.

  • Looking buff Dave. You must be working hard. All that exercise can certainly explain your enthusiastic attitude! I love it!

    As for the board; it is absolutely gorgeous. I'm thoroughly impressed with your work.

  • Today's EEVblog brought to you by Agilent

  • Comment removed

  • These debugging videos are some of the most useful and enjoyable things you've posted. For those of us with a code background and not hardware, this helps a ton. I can't thank you enough :)

  • I don't get why do you expect to get the typical values so often. You should design for min/max specs and not typical. Also, as others said, it's the cheapest in the shop so it's not really surprising. The specs are quite low, basically the same 8-bit like INL accuracy for the whole range of DACs plus 1% gain error and whatever the offset error is. You can even see the graphs for output vs code, it's all over the place with pretty large steps. If anything, 12-bits gives you more fine tuning.

  • lol, put closed caption on, very funny :D

  • When you change a drawing (fix a typo, move a line, etc.) that is not really a change of the design, instead of advancing the rev letter, add a number, e.g. Rev B becomes Rev B1. The letter represents design changes; the number is a drafting change without changing the hardware, so all Rev B hardware can be marked the same regardless of how many time it takes you to get the drawing right. The number is zeroed for each letter change, e.g. NC, A, A1, A2, B, B1, B2, C, etc.

  • That "tri level issue" you seen at the end looks like i2c clock stretching. The LCD is stretching clock to delay data... Might not be that but sure looks like it

  • Dave please stop touching your screen.

  • Hi Dave, do you have any video's that explain how to actually design a PCB and explain how it is actually done? Do you just input the schematic diagram into the CAD program and designs the board for you or do you have to actually draw the tracks into the CAD program??? Good vids by the way.

  • @EEVblog can you put the rev b scmatic up for downlode

  • @mm5032 spelling dude...

  • @EEVBlog can you up the rev b scmatic plz

  • hey there, Dave I am using a mcp4822 to make a laser scanner but can't get it to work could you please share your code zo i can check wats wrong with mine ? thanks in advance. You are doing a great job blogging and designing !

  • Thou shall check compiler warnings !

  • Will this be for sale on your shop ?

  • 19:00 & 19:50 Without finishing watching the video, I see what you're doing wrong. You're only sending 14 bits of data, not 16. the DAC is discarding the command as it does not have a full 16-bit command.

  • @MadManMarkAu You sooo watched the rest of the video...

  • @jmdejoanelli lol, actually I didn't. I'm a full-time software developer for a barcoding/RFiD company, with many hours of hobiest AVR experience. Things like this often jump out at me, which is one of the reasons my boss loves me :)

  • Will trying the 10-bit version of the DAC actually help? The datasheet shows a Max INL Error of 12 LSb for the 12-bit and 3.5 LSb for the 10-bit, but you're losing 2 bits of resolution in the process (which you're deliberately not using in your code - you set the two least significant bits to 0). So you're looking at 0-4096 with a max INL error of 12 versus 0-1024 with an error of 3.5, but if you divide down so you're comparing the same scale, that's 0-1024 with an error of 3 for the 12-bit

  • @EEVblog Just so you know: the scope decoded the data correctly: 10110110 is 182. That is B6 in hexadecimal, which is what it displays.

  • Fantastic looking board, and back from NZ so quick!

    I think this your best effort yet Dave, and it gives insight into why it's worth buying good test gear. Me, I'm still trying to get by without a scope etc. and the Chinese LED display that's been sitting around in a cupboard for the last 3 years with it's "SPI-like interface" is testament to this :-)

    Note to the 'special' people who have better solutions BTW. Make one of your own and Koff with the smartass comments...

  • Hey Dave! Awesome troubleshooting! One thing though on one line of the code you forgot to change to SPI_SCLK it's still on SPI_CLK. It's the line inmediately after the "#define DACclockToggle". It reads "digitalWrite(SPI_CLK, LOW)", when maybe it shoud read "digitalWrite(SPI_SCLK, LOW)". It's on minute 12:58 on the video. Maybe is not that much of a deal and it'll work fine with that, or you already corrected it, but if not I would be glad to have been helpfull. Keep the awesomeness comming!!

  • Nevermind! I saw the other comments regarding that issue! over and out!

  • Hi Dave, I believe your I2C problem is the pull ups that you're using for the I2C bus. Try switching them (R40 and R41) to 4.7k. I've had a similar issue in the past where if I used 2 devices on the I2C bus with 10k pull-ups, then no problems, but add another device, magically things stopped working correctly, but using 4.7k pull-ups solved that problem. However I remember you don't want lots of different values, so maybe add another set of 10k resistors in parallel to the existing pull-ups.

  • Hi Dave, i guess you can compensate for the error on the dac via software, you could enter a special configuration mode so the user can calibrate the values.

  • 30:19 " I guess I can't be too hard, I was just hoping for better specs, that's what you'd espect from a 12-bit DAC". Well, I guess that's why it was the cheapest part in its category :P

  • Possible to add to the PCB silkscreen the major schematic zones? That is, everything in this area is the DAC, everything here is the uCurrent, etc?

  • Gawww!

  • @eevblog IIRC, it's pronounced 'doo-ey-meela-noh-vah' - but that's worth exactly what you paid for it :)

  • One day I will watch the psu series from start to finish one behind another.

  • I don't understand why you insist to use DAC you can adjust the voltage and current With just a potentiometer, old school !!

  • @sorin0306 A good 10-turn pot is lot more expensive than a DAC.

  • @EEVblog 2pcs 10 turn cylinder potentiometer 3.8$ (including shipping) from suntekstore .

  • @sorin0306

    good 10 turn pot, not crap thing

  • @atamasuzu What is the difference???

    the "crap thing" do the job or not, this is the problem!!!

  • @EEVblog Yea, thats very true!

  • So interesting to see something go from idea to reality. I love that so much. I like to see it as well in my own projects. Something so special about that.

  • FYI, your first digitalWrite still sets SPI_CLK instead of SPI_SCLK. It works by accident, because later on you use DACclockToggle() that correctly sets the SPI_SCLK to low in the end, ready for the next write. So maybe the very first write to the DAC fails, maybe it happens to work because the SPI_SCLK is low anyway after reset.

  • the i2c spec allows for slave devices to pull one of the data or clock low (forget witch) to indicate it needs a delay to wakeup from sleep etc. that sometimes explains half heigt waveforms that look like bus contentions

  • D'oh!

  • Is that a duck billed platypus?

  • @envisionelec No, just a regular Platypus :->

  • Comment removed

  • Comment removed

  • Maybe this will help others - Notice at 9:42 there is not just a clean ground, there are some tiny little spikes laid on top of it. Whenever I see this on a pin of a micro, I have always found this wave to be caused by the pin being set to an input, and the code tries to change the output high/low anyway. The solution is to find the bug in your code that made it an input instead of an output (as Dave did). I have found the same waveform to be common to both PICs and AVRs.

  • How about talking about how you chose the passive components. What sort of caps did you use? They don't look like generic ceramics on the board.

  • @scottrharris they look like run of the mill Jaycar MKT caps, I'd be willing to bet on @eevblog's response being the same. There isn't anything special about the caps he's used.

  • @randomgarfield Exactly. I'm wondering why he chose mylar instead of ceramic.

  • @scottrharris same reason most of us do, because he had them. :)

  • @randomgarfield OK. I was assuming that they were the caps he chose, not just what he had laying around.

  • @scottrharris I like the 0.2" MKT package

  • Oh no @eevblog is a screen toucher! ;)

  • @randomgarfield Lock him up!

  • Great video. Was fun to see someone else debugging. :)

    You should do more of these live debugging sessions.

  • @TheCrazyInventor Well, it's not exactly live since it's on youtube ;D But it's actually good to see how others debug a problem, when they encounter one.

  • Hey Dave! I'm not an electronics engineer and I honestly don't know anything about the deep matter of electronics but I really like to see stuff that happens in or on a circuit. That's why I love to take a look over your shoulder while you explain what i'm seeing. I don't do much with electronics except for measuring some voltages with my multimeter but I love watching people who really know their stuff. Thank you for giving me this opportunity! Keep up your great work! Greetings from Germany :)

  • you need to start using for-loops Dave ;)

  • Dave, as someone pointed out, you forgot a digitalWrite(SPI_CLK, LOW).

    Also, you don't need to do "temp=value" every time, because the >> and the & operations do not change the variable value.

  • Great episode. Nice looking board, Dave.

  • Great video! But when you find a naming problem like that, do yourself the favor of doing a search in your code, so you know you catch them all :)

  • hi at 13:09 mins I saw you didnt correct digitalwrite below unsigned int temp; i guess it should be digitalWrite(SPI_SCLK, LOW);

    greetings from mexico!and excellent job!

  • @amonis666 2nd that!!!!

  • @amonis666 I noticed this too

  • Trap for young players. Obviously for others too... haha

  • Comment removed

  • I just noticed that mid-level I2C signal you're getting, Dave, looks like it's periodic, but it's hard to be 100% on it, based on a YouTube vid of course. Looks like it's always occurring after a block of data is sent. Maybe it's trying to send an 'acknowledge' (ACK) ???

  • Great looking board, Dave. I saw that you have SPI-CLK, not SCLK somewhere else in the program. I'm sure you caught that.

  • The board looks good.

  • Cool, nice update. I'm also looking forward to the PCB layout vid! great work Dave!

  • great video I can't wait until the product is done so I can get one =- D

  • Pro calculator.

  • RC Filter on the I2C bus?

  • I wish those DACs had pins to put a potentiometer on it to compensate for error?

  • The I2C problem is the LCD failing to pull the SDA line down hard enough during the ACK cycle.

  • Comment removed

  • Is EEVBlog written with Comic Sans on the board?

  • yeah... quick my arse... haha...informational... Keep up the good work, enjoy watching your videos. :) 

  • Great stuff, more of a software guy :)

  • 1:44 That op-amp error is more trap for old players than young ones. Young playre will check everything 20 times when old playa will do things routinely :P

  • @kildas You could be right on that!

  • Could be the problem with the I2C in the last part of the video caused by Wire.h automatically enabling the internal pullups of the ATMEGA?

  • @fax8

    It has to enable the pullups for I2C to work (if there isn't an external pullup). The LCD seems to fail to pull down (9th bit = ACK) completely against the pullups, hence the 3rd "logic level".

  • The question would be: why you had to bitbang SPI instead of using Arduino's API and ATMEGA hw support for that?

  • @fax8 I think in an earlier video he said he thought it would interfere with the in-circuit serial programming, but I'm not sure, I'd say look at the schematics.

  • @fax8 For the 10th time... because I wanted to free up the hardware SPI interface for the external interface (Ethernet. serial etc)

  • Dave, FANTASTIC job thank GOD you quit your day job and became a full-time blogger.

  • I love the arduino, but here's another fun gotcha. Although the standard chipset for an arduino is using a 16Mhz clock, the fastest GPIO output is normally around 100kHz. If you're using the digitalWrite like you are doing, you have this limit. If you output using the PORTB directly, you can get a lot closer to 16Mhz resolution. Google for "arduino port registers" if you need this faster speed.

  • +1 for tArduino pains; it's like handing a kid's tricycle to Lance Armstrong.

    I'm supposing you're using the Arduino junk to help the less-experienced understand (as the thru-hole components suggest), but IMHO, it's much much easier to simply write code in C, compile in gcc, and then upload it to the uC however you prefer (another arduino, AVRISP, hacked parallel cable, etc.). Overall though, it's good to know we both 'suck' at software. :)

    p.s. I really like that Agilent 'scope!

  • @SigEpBlue Yes. If I'm going to make this thing Arduino compatible, then I should use the same Arduino IDE interface everyone else will use.

  • Good job

  • If you don't have thousands to spend on a scope for logic analysis, you can also get a Bus Pirate. It can sniff serial, I2C, SPI, and a few others. Its around $30 if I remember correctly. Its essentially a little PIC chip with a USB serial bus chip. You can't get nice waveform displays like you were showing, but you can get basic analysis of digital signals, one step beyond just a multimeter.

  • Dave,

    It bugged me a lot that you missed a second typo instance of using SPI_CLK. Do a search in your code for "MCP32008_OutputPinClear(2);"

    Its the line right before that. I don't think its causing your tolerance problems, I think that's just a crappy chip model or something. :-(

  • @ssj3gohan456 I think the through hole is so that hobbyists can build it too.

    btw Nice build Dave, props!

  • @pisnahuj10 Well, I find that a very strange notion because at least for me, honestly SMD is a lot easier to work with than through hole. First of all it's much more plentiful (around here there's no physical shops whatsoever, and farnell and the likes mostly carry SMD) and also it's super easy to just use dave's recommended hot air gun, dealextreme paste and a $10 solder screen + mikeselectricstuff's smd tips. The result is smaller, prettier and cheaper.

  • @ssj3gohan456 And of course, you don't have to arse around drilling hundreds of holes! I'm not very good at SMD soldering yet, but it seems like when I am, the whole process will be far less labour intensive.

  • @ssj3gohan456 Go back to the previous episodes and you will know why he used through-hole components. Also, its not a question of which language is faster, its about whether its suited to the job. If both the Arduino and plain GCC code could perform the task at hand, then they are pretty much equal, apart from the fact that Arduino is easier, and has built-in libraries. I mean its not like the voltage settings are going to change "faster" (once they are working properly) using the GCC compiler!

  • @GTXAbunada I didn't mean faster as in faster code execution, but easier to code. Arduino macro's are at least for me a lot harder to understand what they exactly do than straight C code, and the same goes for most of my engineering peers. It would take me more time to try and code something in arduino macro's than straight C. That kind of 'faster'.

  • @ssj3gohan456 This, totally. *bro-fist* :)

  • @SigEpBlue bro-hug. I should really stop posting useless comments now and start working on my matlab simulation ;)

  • @ssj3gohan456 It's not about you, or me, it's about producing a kit that is friendly to beginners out there.

  • @GTXAbunada Concerning the part where my idea of the Arduino being slow (and then the thread on that being hijacked), my point was only to say that Arduino GPIO *can* be slow. You can have the best of both worlds. Use the Arduino IDE, and when you need fast GPIO, you can use port registers. That way you're using an easy to use IDE, but you can have bits of your code go faster when they need it. (Or you can completely ignore port registers if its fast enough already.)

  • @ssj3gohan456 Yeah, I mean Arduino is cool for noobs and kids who want to join and use the code from the arduino community but for real engineering C and proper IDEs are better.

  • @ultimatefang007 well great to hear cause i started directly with code::blocks and uisp XD

    I really can't understand why use the arduino firmware and stuff....it's still C, with aliases and premade functions (as far as i've seen, never really used it), maybe i dont get it cause i already was a C++ programmer. Still, i'd prefer learning the raw C way once than learning the arduino way and then having to learn something more again.

  • @ssj3gohan456 For the 20th time... This will be a DIY kit. People do not like surface mount devices in kits.

  • @EEVblog for me is more simply to solder smd, save space, don't need holes etc, don't forget that the major part of the newest IC don't are offered in DIP.

  • Awesome to follow along Dave :-)

  • (Me at 12:58)

    Nooooo, you missed one!

  • It looks like you still have a reference to SPI_CLK in the first few lines of your routine. Not sure if that's intended.

  • I don't get it?! why you no like the 'Arduino system'?

    Why dont you like the hardware or software?

  • Re. that I2C data - isn't that dodgy-looking pulse not the ack bit from the LCD, not pulling completely low against your pullup?

    As it's a chip-on-glass unit, chances are there is significant resistance on SCL/SDA due to the ITO tracks on the glass.

  • @mikeselectricstuff Yeah looks like the LCD is trying to ACK you, as it seems to be the 9th bit. Perhaps the micro isn't setting the line to an input to listen for it?

  • @mikeselectricstuff Yep, that's likely it. Experimenting with the pull-up values should be able to prove that, by seeing if the level changes.

  • Arduino "programming language" is damn evil :) Anyway, but non SMD resistors... o_O

  • @soclt this is supposed to be a kit for beginners, so smd is not really wanted here.

  • @DjViOd oh... well but still, beginners should also learn to use SMD. At least 0805 ones.

  • AWESOME, can't wait for it to come out!

  • Why would you think about using a logic analyser to debug something as simple as SPI if you have a deep memory scope?

  • @mikeselectricstuff ...thought you were talking about a seperate instrument!

  • great!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more