Tag Archive: QP-5512

AVR LCD Library

Well here is my library I threw together for interfacing the Jaycar QP-5512 LCD screen to AVR micro controllers. A couple of functions. InitiliseLCD, displayData and writeInstruction.


To use you need to include <util/delay.h> and define F_CPU. Have a gander at the usage of delay.h.
Considering we are passing in the ports and pins as addresses, it’s a little bit of pointer passing. But don’t get phased at all about that.

A slight example of calling the functions.
displayData(&PORTB, &PB7, &PB6, ‘c’);

Do a loop of that function call to print words! Easy!

The code is simple. Have a look for yourself.

For a wiring diagram, look back at this post.

Questions? Comments? Suggestions? Flick us a comment.

Wireless Remote Module #2: LCD Display

Ahh, it’s been too long since I’ve updated this. As you can guess from the title, module #2 for my wireless media remote is complete. Well, module #3 is ready too, but I’ll put that in another post later on. (Don’t tell anyone, but so is module #4. I’m actually up to building it on prototype boards as opposed to my bread board)

A few weeks ago, I went down to Jaycar and picked up a few things. One of them being a 16×2 LCD character display. Key code QP-5512.
As it turns out, this particular LCD character display from Jaycar, has no datasheet. Which is quite in convenient for anyone, especially someone just learning about micro-controllers. After many hours of research, I found this: Oz electronic forums where several board members figured out its wiring and instruction sets. For the PICAXE.
Now this is wonderful…Except its code is in PICAXE Assembly syntax.

First things first, let’s wire up the circuit. I opted for 460 ohm current limiting resistors because that’s just what I had with me.

D0 -> D3 are the data lines. Because i opted to use the LCD in 4 bit mode, we only need 4 of the data lines for data transmission. EN is the enable line and RS is register select. The 10k trim pot on line 3 is contrast adjustment.

Onto the code. Once again, I would like to point out that this isn’t exactly all my code. The structure and implementation of it in C is, but the enabling and writing to the LCD logic is thanks to SABorn at ozeleforum (See above link).


Compile it, upload it and run it. Works a charm eh?

Note it is displaying the current playing song from my PC. See the serial connection? I’m tying them slowly together… More on this in later posts though.

I have actually found that on the enable pulses, you can decrease the delay to 35 us. This may cause some slight unstable reactions, but I have never had a problem with it. Just don’t go any faster.

Now, I liked this so much, I decided to put my screen on a prototype board.

So that’s pretty much it for now. Chew on that while I get bothered to write up more on the next few modules.

Here is the instruction set for the LCD screen:
DisplayOff = 8
DisplayOn = 12
Home = 2
Clear = 1
Start of line 1 = 128
End of line 1 = 145
Start of line 2 = 192
End of line 2 = 209
Master reset = 0
Scroll screen left to right = 5
Scroll screen right ot left = 7
Screen off = 4
Display top line only = 32
Display both lines = 44
Cursor on = 14
Cursor off = 12
Cursor Blink = 15

Thanks to SABorn @ Oz Electronic Forum.