LCD shield and/or LCD serial backpack

Here's a basic code to display text, lines and dots. Original c code came from Massimo. I already posted it to the forum, but thing get easily lost here. i know it should be up on the playground. but me too got distracted from it by other projects. The circuit i use never got updated, like i planned, using a proper 3,3v regulator for the display. i'm doing other stuff lately with arduino running on 3.3v so i might get back to it.

here the lazy circuit http://flickr.com/photos/12058013@N07/2203300707/ using 4 diodes to reduce voltage to appr. 3.2v and voltage dividers for communication.
here's a basic version of the code [again here, and not on the playground, so maybe we could clean it up build a library from it together]:

....

Wow, that sounds very nice :sunglasses:
I'm a starter with this "Arduino" things, but it looks really nice all this!!

The code what you've wrote (in 4 parts) is that only for a ATmega168 (for the Arduino) ??
Or can I use it also for example a ATmega48 or something?

Thanks in advance,

Atmoz

hi atmoz,

the code should be easily portable. in fact the original code was written for a pic if i rememeber correctly. the only arduino specific thing should be the pins definition at the beginning.

best, kuk

hi atmoz,

the code should be easily portable. in fact the original code was written for a pic if i rememeber correctly. the only arduino specific thing should be the pins definition at the beginning.

best, kuk

Hello Kuk,

Thanks for the fast reply.
Sounds really nice again!! So only change

int LCD_POWER_PIN = 11;
int LCD_DC_PIN    = 2; //  PB0  4 Data Command
int LCD_CE_PIN    = 3; //  PB2  5 /CS   active low chip select ??
int SPI_MOSI_PIN  = 4; //  PB3  3 Serial   line
int LCD_RST_PIN   = 5; //  PB4  8 /RES RESET
int SPI_CLK_PIN   = 6; //  PB5  2 CLOCK

into the right pins at an ATmega48?
Nothing else? clockspeeds, timings, etc??

[edit]

I don't have a Arduino yet, so I can't test it. Therefore I ask this :slight_smile:

note that the out commented port names are from the original code. well, so i guess it was AVR rather than pic.

Nothing else? clockspeeds, timings, etc??

ok. good you're asking again.
there's a little arduino specific stuff inside which boils down to delayMicroseconds() at some places, i think. your compiler should warn you if there's more. you can just replace them with something else that "delays" the program. but i've not touched the code for over a year. it really was on of the first thing i hacked together when i got my first board. i just posted it to encourage others to work with the display.

timing isn't crucial here because of the spi clock line. i think the display was very tolerant. but really, if your not working with the arduino IDE at all, you might be better of checking out those links provided by follower a few posts up. the only thing "special" about my code is that it works on an arduino like it is. plus, i removed the lowercase letters from the bitmap to make it fit into an atmega8. more a bug than a feature.

kuk

Ok I've been perfecting the PCB and double checking prices.
It looks like I can easily make them for $10 each. :slight_smile:

I'll plan how I'm going to organize distributing them and then I will start making. :slight_smile:

Ok I've been perfecting the PCB and double checking prices.
It looks like I can easily make them for $10 each. :slight_smile:

I'll plan how I'm going to organize distributing them and then I will start making. :slight_smile:

Sounds good :smiley:
Let us know when they are ready. I think I'll order some :slight_smile: (and hopefully the shipment costs aren't that much...)

And thanks for the answer kuk!

Regards,

Atmoz

Assuming Australia Post calls it a letter and not a parcel, shipping will only be about $3.85 AUD. :slight_smile:
To the US it should take about 4 - 6 days.

This is using Australia Post's online calculator so it may not be exact. I need to find out more details.
http://www1.auspost.com.au/pac/int_letter.asp

Cheater, sounds good, looking forward to hearing when you are ready to ship.

According to the oz post web site, items smaller than 260mm x 360mm and under 20mm in thickness count as a letter.

http://www.megaupload.com/?d=AXTX2AHO
There is the brd and sch files for it. Can someone double check it? :wink:

It features a ATmega8 core with Power, SPI, I2C, Serial, Reset and Wait pins on one side.
The other side matches a LCD's pinout including backlight pins.

Two transistors power the contrast and the backlight.
The contrast one has a capacitor to try and smooth out the voltage. I'm thinking 0.1uf but I'm not sure.
I'm also not sure if the resistor on the contrast transistor is required. If it isnt then it means less parts to worry about.

The pull up resistor for the reset pad will be 10k.
I'm not sure about the lcd backlight one. I use 100ohms on my lcds and it works fine but I'll be reading the datasheets to be sure.

Any suggestions for part values would be greatly appreciated.
I'm going for low part count because Futurlec only sells in batches of 5,000 and I dont want too many different values.
My main concern is the contrast capacitor.

looks like you have to be registered to get the file from megaupload!? maybe rather post an image file, so we can see it here?

looks like you have to be registered to get the file from megaupload!? maybe rather post an image file, so we can see it here?

kuk, you just have to wait a minute before it does the download. The invitation to register is for instant downloads.

I got the file and a quick glance on eagle looks good. But I don't have enough PCB design experience to review the design.

ah, thanks. i think i got distracted by the german translation of the page :slight_smile: looked like a redirect.

kuk, es gibt kein problem :slight_smile:

cheater, I have 3 or 4 LCDs in my parts box and wonder if its worth testing the contrast and backlight circuits on them using my arduino. If you want to modify the transistor driver code so it works with the arduino's timers running on a 16mhz clock then I would be happy to test this on my breadboard.

I don't need the code for the LCD data for this test but would be happy to look at that if it would help you.

Thanks mem. I'd love it if you could test PWM with a 0.1uf capacitor on the contrast.
I'd do it but I dont seem to have any transistors around. I could scrounge one....

No code yet. I'll whip it up once I get the PCBs. :slight_smile:
Just test with AnalogWrite for now.

I've created a Sourceforge project for this to keep everything nice and tidy.
I'll be setting it up today.

Just tested (very roughly) without a transistor and it seems that the contrast acts just like a normal LED.
Ripple isnt a problem. A 0.1uf capacitor should just smooth things out a bit though.

Ok last questions:
Is a resistor required on the LCD's backlight? Sparkfun doesnt use one. I'd imagine it would be fine.
And is a resistor required on the transistor's base? I wouldnt think so.

I will be rather happy if I can ditch two resistors. :slight_smile:
I'll then be able to order.

Current parts list (assuming I can ditch two resistors):
2x 0.1uf 0805 capacitor
2x BC817 SMD NPN transistor (0.8A max)
1x 10k 0805 resistor
1x ATmega8 QTFP

My bad. The ATmega8 doesnt have enough PWM and I forgot about slave select. :slight_smile:
I've now got it with a ATmega168 which has more PWM and more space which should be good.

Just a update: I have the OpenLCD website up.
http://openlcd.sourceforge.net/

Eagle files (completely different to whats posted above) are in SF's release system.

Can someone do a quick check on the circuit to make sure it will work before I order a large stack of them?
I figured that its only slightly more to get ~138 of them as it is to get 25 of them so why not.
I dont want that many coasters though. :wink:

Just a question: You do not provide a ground signal to your SPI, SER and I2C connectors. I would have expected these to have a ground since they are not differential. Am I missing something?

Cheater, The 3d view shows the header pins for the LCD and arduino interface on the same side of the board. If I am visualising this correctly, I presume the arduino interface header will be mounted on the opposite side of the board to the LCD header.

Just a question: You do not provide a ground signal to your SPI, SER and I2C connectors. I would have expected these to have a ground since they are not differential. Am I missing something?

Yes your missing the 5V and the GND connector on it. :wink:
The user will have to connect all the grounds together themselves if power and signal are coming from two different sources.

Cheater, The 3d view shows the header pins for the LCD and arduino interface on the same side of the board. If I am visualising this correctly, I presume the arduino interface header will be mounted on the opposite side of the board to the LCD header.

Yep. The 3d view looks pretty but its not perfect.

Btw xSmurf made me add RS232 to the list of interfaces it supports. :slight_smile:
Going to see if I can fit a crystal on it, if not then I'll order.