Forum Topic: http://www.eevblog.com/forum/blog-specific/eevblog-313-bus-pirate-lcd-debugging/'>http://www.eevblog.com/forum/blog-specific/eevblog-313-bus-pirate-lcd-debugging/
http://www.amazon.com/gp/product/B004G2F6H0/ref=as_li_ss_tl?ie=UTF8&tag=ee04-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B004G2F6H0
Getting a Newhaven 8x2 LCD display working with the Bus Pirate.
And some unexpected debugging.
Join the EEVblog Electronics Community Forum:
http://www.eevblog.com/forum
Dave's Amazon Store:
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/
http://www.amazon.com/gp/product/B004G2F6H0/ref=as_li_ss_tl?ie=UTF8&tag=ee04-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B004G2F6H0
Getting a Newhaven 8x2 LCD display working with the Bus Pirate.
And some unexpected debugging.
Join the EEVblog Electronics Community Forum:
http://www.eevblog.com/forum
Dave's Amazon Store:
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/
Hi I thought I'd do a uh little video on uh LCD um I've got here it's an 8X two uh standard footprint LCD it's from uh New Haven display and I thought I'd just uh show uh powering the thing up and uh, seeing what it looks like. It's um, a nice compact little 8x2 uh LCD it's actually upside down I believe I believe the text is uh, showing this way it's got a mounting bracket here. it's an industry standard footprint about 40 mm by 35 mm I think it is standard Hitachi uh sort of LCD pin out interface there and this is the non backlight version which is very thin. It's much thinner than the the the backlight one's about say that thick or something.
It really is quite substantially thicker. So this has either got a transflective or more likely a reflective um back in on it and I've so it normally it doesn't come with the pin header on there I've solded a pin header onto it. It's got standard mounting holes and these are available from every one. hung low manufacturer on the planet.
Eight characters by two lines. Really neat little compact display and this is actually a New Haven one. There it is. It's an NHD O28 a Z RN ybw Um, so thought we'd power it up.
Give it a go, let's try it and just to get this thing up and running really, uh, quickly. the minimum amount of fuss I thought I'd use my Uh Bus pirate I haven't used it before I Got a bus pirate version 3.5 I think it's a slightly older Uh model. it's available from dangerous prototypes. It's open source uh Hardware it's really good for, you know, uh, decoding serial interfaces.
you know, SPI I Squ C and all that sort of stuff. but it's got like uh, build-in modes to drive LCDs and drive various you know, dozens and dozens of types of chips. Really handy little device. It runs on a pick 24 um what is it a 24 Fj64 Ga2 there? it's got a ft Um 232 uh interface serial interface there so it's got.
you know, the generic uh uh ft driver and it's got a um just a header on the output and of course this doesn't have enough pins to drive a standard LCD So uh, you can get this uh companion board here which is a Um which is the bus pirate LCD adapter once again, um I think maybe a new version is available. it's Open Source Hardware CCB uh sa and um, it just uh has the standard interface for the Hd44 um 780 LCD interface but unfortunately it doesn't um have a The Jewel In Line header pin header which is what we need here for this. LCD So I'm going to use a converter cable for that I believe somebody's actually gone and made a uh new version of this cuz it is Open Source Hardware It would have been nice if it had like the duel in line one and maybe uh, like a couple of other flat Flex uh ones as well. different pites.
but anyway, we can uh, make de with this. It's got a 74 HC 595 on there uh serial to parallel uh converter. really basic chip. It's got the contrast adjust.
It's got everything we need. Um, a couple of things for the backlight. not going to use the backlight, but this should be able to get our LCD up and running with minimum fuss. Let's give it a go. Haven't used this before, should be interesting. So I've just made up a converter cable here single in line I've solded uh, two headers back to back like that and uh, that just allows me to plug that directly into there and uh, this has got individual uh leads of course and um, I plug them in there cuz it's a standard pin out. This pin out here from 1 through to 16 follows the pin out on here precisely. so uh, um, that's you know it's really hard to goof up the pin out on that.
So um, let's do it. Let's plug it into the serial Port It uses a terminal program so we'll use Teraterm and try and talk to this and get a Hello World running. Okay, I've got Terat here plugged in and it's set to 115,200 board on uh on the serial Port which happens to be Com 2 here and it's working just fine. You do question mark I'm talking to the device and there's all of the Uh commands and various Um options.
So now we can, um, actually start talking to the thing. We can go M for mode and it's got the various modes available as you can see: one y u I S, CSI you know, 2 wi, 3 wire and LCD. So we want number eight of course and we we've got the LCD prompt here now. Excellent! So now we can use the Uh capital these commands.
you've got to read the manual, of course they're not obvious. Um, we use the W command uh for the power on and if we have a look over here at the same time, we should see. So let's hit that and so let's have a look. Let's go here we go.
and power should switch on. it does. There's the power. So we're turning on power to the LCD and uh uh Well, we probably have to adjust the uh contrast uh, pot and stuff like that so let's try the contrast.
it's not I'm turning it all the way one end and all the way to the other end. This is on the LCD board and I'm getting nothing so that is I Think we have an issue there. Straight up something's going on cuz normally um, you would see all black characters come up when you apply power even though you haven't um initialized the LCD and done stuff like that So I would have expected to see all black characters on there. Um, something's wrong wrong bloody Murphy's Law Nothing ever works.
First go. So let's um I get let's see Uh Golden Rule of troubleshooting th shall check voltages. So I'm going to check pins one and two here. which are these two here to see if we're getting voltage on our LCD here? Uh no, we're getting 0.5 we're getting 0.5 Vols Um W fail.
That should be uh 5 Vols on pins 1 and two. let's that's ground and 5 Vols there on our um probably can't zoom in and get that at the same time. I Won't bother, but let's have a look here. Ah, there we go.
Nut labeled on the back. Lovely. Love it. and uh, that's ground and 5 Vols So what? we are getting 5 volts.
Um, because yeah, the power's switched on. We've got our V reg light. We've got a power light uh, lead there on which indicates that power cuz this micro can switch power through to the output connector and it is. but we're not getting on here. What is going on? Oh oh, hang on I Think we have a trap for young players here. I'm suspecting this ribbon cable because it's supposed to be connected directly through. There's nothing but tracks on here. so I think I've had this a dozen times before I think our cable might be back to front might be swapped I Thought this was the cable that came with it.
Um, but it's um I don't think it is um Let Me: let me check that and yeah I checked it and it does. actually. um, it's it's been swapped. So I've got another cable here if we have a look at these two.
Oh, hang on, let's let's have a look at the difference on these two cables here. This is the one that didn't work. As you can see, it's pin one's here. pin one's there.
Okay, and they've both got the notch over there like that. So, but if you look at this end The Notches are different. This one has the notch on the outer side. that one's got the notch on the inner side.
Fail. So let's plug that in and see. Hopefully we haven't uh blown anything up. Probably not.
Um. So now let's uh, measure. well, might have something on the LCD No, nothing yet. But let's measure pins one and two and bingo.
we now have 5. Vols Okay, so I unless this LCD is faulty, we should. If we adjust this trim pot here, see if I can get both on the screen at once, we should get all black characters. Hey, there we go there.
it is bingo. So we've only got it on one line of course. so we set our contrast just below where it sort of Fades out like that. Ah, my notebook just shut down and switched off the power.
But anyway, that should work. a treat now. All right. one more time for the dummies, let's give that a go again.
let's get back in here. where all hunky dory there. We need to get into the mode again and uh, let's get into LCD mode. We're in LCD mode W We'll hit that and we should see our LED here.
Come on, Taada, right? our power And we can just see the characters on the uh LCD there. Let me just trim that down just a tad. There we? there we go. That'll do anyway.
let's give that a go right now. Um, what we want to do now is go into the macro menu. So we want to do bracket zero like this and that puts us into uh, the macro. uh, various macro options and uh, that's the thing this is, uh, pre-programmed into the Uh bus pirate for um, you know, testing LCDs and for other uh items.
you know, for the SPI and I squ C and all that sort of stuff. But we're in the LCD menu and we can just go LCD reset. So I believe we have to do one bracket and yep, we've reset and uh, let's do init LCD So we need to do sorry two okay bracket which I like means command Now display lines. one line or multiple. Well, we got two lines so we want to do two multiple in it. There it is. Um, it should be ready. Ah, there we go.
Bingo we've got our cursor. There you go. it's working. Um, so I I'm pretty d confident now that if we just, um, send this um characters and strings, they will be displayed on the LCD.
So uh, we can do that directly according to the example Eev blog as a string like that. Otherwise, we can send a direct Asy character just by uh, typing in its value. Um, so Eev blog and it should pop up Tada Look at that too easy. How easy was that? Once we sorted out the stupid uh issue with the cable, there it.
uh, Works a treat and uh, it should in theory work for uh, every, um, you know, Hitachi compatible? Uh LCD On the market, there are various slight subtle differences between them sometimes and I have encountered where you know I'll have 10 brands work with code and you think it's rock solid and then there's another one which is supposed to be compatible, but it just doesn't work due to some you know. minor little difference, but pretty much you know 90 or 99% of them on the market are going to be compatible with this code. so that's brilliant. And um, if we want to write something to the next line, uh, presumably we're able to do that.
Now we can't just um, you know, do hello World for example and have it wrap around because these, um, the chipset for these LCDs is designed for 40 character display regardless of even if it's a tiny little uh, eight, uh character one like this. The chipset, the memory map, and the chipset is the same across all the different LCDs and it has a maximum of 40 um uh lines. So what we need to do is uh, we need to I Think we can call up the macro menu again and here it is: cursor position. So this is what we want.
We want four and then we want the cursor position. So we can't just do cursor position and expect it to wrap around to the next character. It's not going to do it. it's going to display 40 and well, 0 to 39 and the 40th one will be this first one.
So if we go 40 like this, we should see the cursor jump to Bingo We do. It's all working as expected. Brilliant! This bus pirate I'm liking this. It's a real easy way to experiment with LCDs And then we can of course go.
uh EV blog and let's do Sean exclamation mark. Oh position in degrees? No whoa. What's that? exclamation mark was probably bad wh That's horrible. Okay, no, something's gone horribly wrong here.
Let me check. No Servo active. Oh God. I've done something horrible here.
No. I shouldn't have. uh, shouldn't have because I forgot to put the quote marks in I'm a I'm a DMO Pwm disabled I've gotten into some Pwm mode. There we go.
Go figure. We're back to the LCD command. All right. San Exclamation mark Quote Bang There It Is Winner I Like it all right and we can just type in characters directly. So let's type in one and that will send one as the Asy character one and let's see what we get. Hey there we go. We just got a custom character Buton looks of it. so let's clear that what's the command for Clear Again, was it three three There we go bang and it's reset and HED our cursor.
so we can just type in one like that and it and it writes as you can see. it writes the one there and it puts in the custom character. um down there because this is not part of the regular. No, Well, it's yeah, it's just putting in.
you know, dummy stuff. But if we go, you know, 50 that you know, asky for 50. There it is bang. So we can write directly.
Um, you know, asky characters in like that Or we can just do the string of course. So hello and then we'll go 4 40 We've got to do a hollow World Otherwise, it's not a proper test. Uh, 40 yes and then quote marks. Hello world, do we want the exclamation mark? Or Not Let's put in the exclamation mark Hello World There it is beautiful I like it.
and uh, this. LCD seems to be quite good I Like it uh, it's not the best, uh light here, but that's you know it's a bit glary bit reflective, bit dark when I turn it down like that. but the contrast on this New Haven display is uh is pretty good I rather like it. this is the non backlight version and uh anyway I think it's going to work a well.
this forat is going to work a trade I won't use the New Haven one cuz they're fairly expensive compared to what you can uh, get them um in other brands but uh I had this one so I thought I'd try it out and they're a nice little compact format LCD I Really like them. uh, 40 mm by 35 or so and uh, highly recommend I think they're 8 mm um thick in like from the back of that bracket there to the front, so quite low profile and uh, you can get them for only a couple of bucks each in significant quantities anyway. so really neat little display anyway. I hope you like that.
That's um, some little LCD testing with the bus pirate and if you want to discuss it, jump on over to the E blog forum and uh, please give it a thumbs up if you like it cuz that helps a lot. Catch you next time! Um.
2012?
woah
Be nice to have a generic board for testing all LCD's. Oh wait, we have arduino, lol
Don't do it first if you write on a blackboard?
What hardware would you use for this kind of work in 2019?
Are Bus Pirates any use today in 2018 with Ardeuinos?
It is always surprisingly sad to me, that getting toward the first half of 21st century, it is still such pain in the ass to get things like ancient LCD to work.
The amount of "tech" connected to LCD to make it work is like x400% in size not counting laptop.
The USB power-off, when the laptop went to energy saving was especially funny and shows how deep in the woods our current technology is.
The tech was meant to serve humanity. From what i can see in many years now, nor we can't understand "why" electricity works, nor bring tech closer to normal people.
Thanks for sharing 😀👍
awesome video! Thank you!
Mono?! Thats a no no!!!
Can't say I've had any issue with them, or that the BP would save time, since you have to write the micro program anyway. There was a unit at Jaycar which might be still available with the usual pinout, except it's supply pins reversed! 😀
Or just get an arduino and use the LCD library.
+EEVblog Hi. I struggled some weeks to get a LCD like yours to work with a dsPIC. Timings. All is about timings and a perfect init subroutine.
I was yelling at the screen !! Always check the cable first !! LOL !!
Arrr!
A trap for "young" players, eh?
This was GLORIOUS!!! Funny, but educational as well! Did what it was intended to do, now I'm going to stay up late experimenting with my bus pirate and my LCD! Thanks for leaving the cable mistake in the video! Shows that you're only human, and encourages those of us that are a bit nervous about making our own mistakes!
i don't have a clue what this guy is saying but i admit it's interesting to watch.
silly me, i didn't know there was a need to reset the lcd after switch on
You've gotta love Dr Murphy IV!
I've got a stack of these Lcd display, including one installed on a one hung low function gnerator, which doesn't work. So hooked the display up to the BP Lcd adapter, and it won't make any of my displays work. Just checked the cable. Yup. My cable is also reversed. And it's the only 10 pin cable I've got, so it's the one which came with the adapter, which came from either Adafruit or Seed. Don't remember which. So, check your cable boys, and keep them dry.
Can anyone explain to me why I would like to debug a fully standardized display?
Come on, they are quite cheap already. Skip a pack of cigs and get one for $4.