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!
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.
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.
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
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.
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 !
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.
@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
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!!
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
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
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.
@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.
@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 :)
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) ???
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
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".
@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.
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. :)
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.
This comment has received too many negative votesshow
I don't understand why you would even 'program' it in those stupid arduino macro thingies anyway? You're a seasoned engineer, as such it's way easier to just use straight C. Faster, too, because arduino macro's are yet another 'language' you have to learn. Literally every other MCU can be programmed with just standard C constructs, and most compilers uses gcc.
Also, why is everything through hole o_O in this day and age, certainly not acceptable.
@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'.
@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.
@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.
@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?
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".
qwertyboy1234567899 1 day ago in playlist Uploaded videos
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?
Riskteven 2 weeks ago
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 3 weeks ago
@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!
EEVblog 3 weeks ago
Programming my first PWM DAC for college and they are bitches to make work properly..
SuperDisco91 3 weeks ago
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.
shinigamidestroyer 4 weeks ago in playlist Uploaded videos
Very interesting video. I can't say I understood all of it, but more of this type of thing please Dave! :-)
ForViewingOnly 4 weeks ago
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 4 weeks ago
@thefatmoop Yes, a kit is indeed the plan.
EEVblog 3 weeks ago
Dave, do a global search/replace in your code and change SPI_CLK for SPI_SCLK. I saw another error in there.
DominiHarling 1 month ago 4
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.
fingerboy18 1 month ago
Today's EEVblog brought to you by Agilent
Psychlist1972 1 month ago
Comment removed
Psychlist1972 1 month ago
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 :)
Psychlist1972 1 month ago
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.
Vlakpage 1 month ago
lol, put closed caption on, very funny :D
steaksauce86 1 month ago
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.
CampKohler 1 month ago
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
thearhi 1 month ago
Dave please stop touching your screen.
Insignificantful 1 month ago
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.
stdavross666 1 month ago
@EEVblog can you put the rev b scmatic up for downlode
mm5032 1 month ago
@mm5032 spelling dude...
jmdejoanelli 1 month ago
@EEVBlog can you up the rev b scmatic plz
mm5032 1 month ago
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 !
rinzegewoon 1 month ago
Thou shall check compiler warnings !
jpelczar 1 month ago
Will this be for sale on your shop ?
rew632 1 month ago
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 1 month ago
@MadManMarkAu You sooo watched the rest of the video...
jmdejoanelli 1 month ago
@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 :)
MadManMarkAu 1 month ago
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
mattinx 1 month ago
@EEVblog Just so you know: the scope decoded the data correctly: 10110110 is 182. That is B6 in hexadecimal, which is what it displays.
320005397 1 month ago
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...
philbx1 1 month ago
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!!
sgajate 1 month ago
Nevermind! I saw the other comments regarding that issue! over and out!
sgajate 1 month ago
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.
crenn6977 1 month ago
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.
andrefbarata 1 month ago
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
ivaneduardo747 1 month ago
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?
sabamacx 1 month ago
Gawww!
heroineworshipper 1 month ago
@eevblog IIRC, it's pronounced 'doo-ey-meela-noh-vah' - but that's worth exactly what you paid for it :)
Warrakkk 1 month ago
One day I will watch the psu series from start to finish one behind another.
xng14 1 month ago
I don't understand why you insist to use DAC you can adjust the voltage and current With just a potentiometer, old school !!
sorin0306 1 month ago
@sorin0306 A good 10-turn pot is lot more expensive than a DAC.
EEVblog 1 month ago 5
@EEVblog 2pcs 10 turn cylinder potentiometer 3.8$ (including shipping) from suntekstore .
sorin0306 1 month ago
@sorin0306
good 10 turn pot, not crap thing
atamasuzu 1 month ago
@atamasuzu What is the difference???
the "crap thing" do the job or not, this is the problem!!!
sorin0306 1 month ago
@EEVblog Yea, thats very true!
billysgeo 1 month ago
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.
lazerusmfh 1 month ago 2
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.
hennerzeller 1 month ago
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
TheBeefiestable 1 month ago
D'oh!
aladaris 1 month ago
Is that a duck billed platypus?
envisionelec 1 month ago
@envisionelec No, just a regular Platypus :->
EEVblog 1 month ago 4
Comment removed
envisionelec 1 month ago
Comment removed
envisionelec 1 month ago
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.
Afrotechmods 1 month ago
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 1 month ago
@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 1 month ago
@randomgarfield Exactly. I'm wondering why he chose mylar instead of ceramic.
scottrharris 1 month ago
@scottrharris same reason most of us do, because he had them. :)
randomgarfield 1 month ago
@randomgarfield OK. I was assuming that they were the caps he chose, not just what he had laying around.
scottrharris 1 month ago
@scottrharris I like the 0.2" MKT package
EEVblog 1 month ago
Oh no @eevblog is a screen toucher! ;)
randomgarfield 1 month ago
@randomgarfield Lock him up!
EEVblog 1 month ago 2
Great video. Was fun to see someone else debugging. :)
You should do more of these live debugging sessions.
TheCrazyInventor 1 month ago
@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.
crenn6977 1 month ago
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 :)
stefbeer 1 month ago
you need to start using for-loops Dave ;)
gryzman 1 month ago
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.
Z80Fan 1 month ago
Great episode. Nice looking board, Dave.
TerminalJack505 1 month ago
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 :)
ErnstHot 1 month ago
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 1 month ago 18
@amonis666 2nd that!!!!
atomikrobot300099 1 month ago
@amonis666 I noticed this too
777jimi777 1 month ago
Trap for young players. Obviously for others too... haha
madmodders 1 month ago
Comment removed
madmodders 1 month ago
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) ???
SigEpBlue 1 month ago
Great looking board, Dave. I saw that you have SPI-CLK, not SCLK somewhere else in the program. I'm sure you caught that.
fingerboy18 1 month ago 2
The board looks good.
electrodacus 1 month ago
Cool, nice update. I'm also looking forward to the PCB layout vid! great work Dave!
martyfriedman666 1 month ago
great video I can't wait until the product is done so I can get one =- D
LocoLibreisI 1 month ago
Pro calculator.
bfhben 1 month ago
RC Filter on the I2C bus?
THEtechknight 1 month ago
I wish those DACs had pins to put a potentiometer on it to compensate for error?
THEtechknight 1 month ago
The I2C problem is the LCD failing to pull the SDA line down hard enough during the ACK cycle.
tegerdine 1 month ago 2
Comment removed
Listn2CKY 1 month ago
Is EEVBlog written with Comic Sans on the board?
Gameboygenius 1 month ago
yeah... quick my arse... haha...informational... Keep up the good work, enjoy watching your videos. :)
santiks 1 month ago in playlist Power Supply Design
Great stuff, more of a software guy :)
Intosia 1 month ago
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 1 month ago in playlist Power Supply Design
@kildas You could be right on that!
EEVblog 1 month ago
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 1 month ago
@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".
superdau 1 month ago
The question would be: why you had to bitbang SPI instead of using Arduino's API and ATMEGA hw support for that?
fax8 1 month ago
@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.
ssj3gohan456 1 month ago
@fax8 For the 10th time... because I wanted to free up the hardware SPI interface for the external interface (Ethernet. serial etc)
EEVblog 1 month ago 2
Dave, FANTASTIC job thank GOD you quit your day job and became a full-time blogger.
GTXAbunada 1 month ago
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.
linagee 1 month ago
+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 1 month ago
@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.
EEVblog 1 month ago 3
Good job
RUSGrus 1 month ago
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.
linagee 1 month ago
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. :-(
linagee 1 month ago
This comment has received too many negative votes show
I don't understand why you would even 'program' it in those stupid arduino macro thingies anyway? You're a seasoned engineer, as such it's way easier to just use straight C. Faster, too, because arduino macro's are yet another 'language' you have to learn. Literally every other MCU can be programmed with just standard C constructs, and most compilers uses gcc.
Also, why is everything through hole o_O in this day and age, certainly not acceptable.
ssj3gohan456 1 month ago
@ssj3gohan456 I think the through hole is so that hobbyists can build it too.
btw Nice build Dave, props!
pisnahuj10 1 month ago 2
@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 1 month ago
@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.
BulletMagnet83 1 month ago 2
@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 1 month ago 12
@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 1 month ago
@ssj3gohan456 This, totally. *bro-fist* :)
SigEpBlue 1 month ago
@SigEpBlue bro-hug. I should really stop posting useless comments now and start working on my matlab simulation ;)
ssj3gohan456 1 month ago
@ssj3gohan456 It's not about you, or me, it's about producing a kit that is friendly to beginners out there.
EEVblog 1 month ago 3
@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.)
linagee 1 month ago
@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 1 month ago
@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.
laharl2k 1 month ago
@ssj3gohan456 For the 20th time... This will be a DIY kit. People do not like surface mount devices in kits.
EEVblog 1 month ago 18
@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.
sorin0306 1 month ago in playlist Power Supply Design
Awesome to follow along Dave :-)
ElectronicsAustralia 1 month ago in playlist Power Supply Design
(Me at 12:58)
Nooooo, you missed one!
Clatapist 1 month ago
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.
danweecc 1 month ago
I don't get it?! why you no like the 'Arduino system'?
Why dont you like the hardware or software?
lolypopboy777 1 month ago
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 1 month ago 11
@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?
SolderSplashLabs 1 month ago
@mikeselectricstuff Yep, that's likely it. Experimenting with the pull-up values should be able to prove that, by seeing if the level changes.
EEVblog 1 month ago
Arduino "programming language" is damn evil :) Anyway, but non SMD resistors... o_O
soclt 1 month ago
@soclt this is supposed to be a kit for beginners, so smd is not really wanted here.
DjViOd 1 month ago
@DjViOd oh... well but still, beginners should also learn to use SMD. At least 0805 ones.
soclt 1 month ago
AWESOME, can't wait for it to come out!
DjViOd 1 month ago
Why would you think about using a logic analyser to debug something as simple as SPI if you have a deep memory scope?
mikeselectricstuff 1 month ago
@mikeselectricstuff ...thought you were talking about a seperate instrument!
mikeselectricstuff 1 month ago
great!
cjmitz 1 month ago in playlist Power Supply Design