Arduino bt and parallel lcd

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Arduino bt and parallel lcd

Postby sirard » Mon Jul 21, 2008 8:15 am

Hi, guys.

I have a Arduino Bt and I want to connect to it a parallel lcd.
I don't know how to get it.

Here you are the link of datasheet of lcd

http://www.robot-italy.net/downloads/GDM1602K.pdf

Please help, because I dont' know how to connect it to the arduino bt. This board has a pin -> Pin7 that is a reset pin, so i can't use for data bus.

I want connect the lcd with 4bits mode.

Thank you in advance
sirard
 
Posts: 18
Joined: Sat Jul 19, 2008 12:04 pm

Postby sirard » Tue Jul 22, 2008 2:54 am

Everybody can help me?

I'm gonna be crazy.

:cry:
sirard
 
Posts: 18
Joined: Sat Jul 19, 2008 12:04 pm

Postby mtbf0 » Tue Jul 22, 2008 7:19 am

there is a four pin library available from the arduino playground. if the defualt pin assignments are not compatible with your hardware setup, just edit the following lines in the file LCD4Bit.ccp.
Code: Select all
//RS, RW and Enable can be set to whatever you like
int RS = 12;
int RW = 11;
int Enable = 2;
//DB should be an unseparated group of pins  - because of lazy coding in pushNibble()
int DB[] = {7, 8, 9, 10};  //wire these to DB4~7 on LCD.

if you can't live with the restriction that the data pins be on consecutive pins changing pushNibble as follows should work.
Code: Select all
void LCD4Bit::pushNibble(int value){
  int val_nibble= value & 0x0F;  //clean the value.  (unnecessary)

  for (int i=0; i < 4; i++) {
    digitalWrite(DB[i],val_nibble & 01);
    val_nibble >>= 1;
  }
  pulseEnablePin();
}

haven't tried this myself, but ...
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1642
Joined: Fri Nov 09, 2007 11:59 pm
Location: oakland ca

Postby sirard » Tue Jul 22, 2008 8:57 am

Ok, I try.

But i read by Hitachi doc that from DB0 to DB3, these pins are not used during 4-bit operation.

I don't know now, I try and give u a feedback.

Thanks a lot for answering.
sirard
 
Posts: 18
Joined: Sat Jul 19, 2008 12:04 pm

Postby sirard » Tue Jul 22, 2008 9:28 am

ok

I connect my lcd to the arduino bt in this way:

arduino bt <-> LCD
2 -> pin6
3 -> pin11 db4
4 -> pin12 db5
5 -> pin13 db6
6 -> pin14 db7
7 -
8 -
9 -
10 -
11 -> pin5
12 -> pin4

I also use a poten (1k) to regulare contrast

Now I changed this code:

Code: Select all
//RS, RW and Enable can be set to whatever you like
int RS = 12;
int RW = 11;
int Enable = 2;
//DB should be an unseparated group of pins  - because of lazy coding in pushNibble()
int DB[] = {7, 8, 9, 10};  //wire these to DB4~7 on LCD.


in this:

Code: Select all
[code]//RS, RW and Enable can be set to whatever you like
int RS = 12;
int RW = 11;
int Enable = 2;
//DB should be an unseparated group of pins  - because of lazy coding in pushNibble()
int DB[] = {3, 4, 5, 6};  //wire these to DB4~7 on LCD.[/code]


I upload and the led is ok, it blinks as in the code, but lcd is all with black blocks!

ps. every time I upload I have to reset my arduino bt. Then the commands are sent. Anyway there's always this errors: avrdude: stk500_paged_load(): (a) protocol error, expect=0x14, resp=0xcf
avrdude: stk500_cmd(): programmer is out of sync

what's wrong?

Thanks a lot
sirard
 
Posts: 18
Joined: Sat Jul 19, 2008 12:04 pm

Postby mtbf0 » Tue Jul 22, 2008 9:53 pm

sirard wrote:I upload and the led is ok, it blinks as in the code, but lcd is all with black blocks!


adjust the contrast until the background in the squares is just a little darker than the apce between them. this will allow you to see if your code is working. when the lcd is displaying what you want it to, further adjust the contrast so you can see the characters but not the background of the squares.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1642
Joined: Fri Nov 09, 2007 11:59 pm
Location: oakland ca

Postby sirard » Wed Jul 23, 2008 3:22 am

Hi, I did.

But :( I see no chars.

I think that the lcd and the board are correcty connected.

Maybe the problem is potentiometer. It's 1KA.

What do u suggest?

Thanks
sirard
 
Posts: 18
Joined: Sat Jul 19, 2008 12:04 pm

Postby sirard » Wed Jul 23, 2008 4:22 am

well,

I try with this:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1144924220/8

and it works fine!

and this:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1160586800/0#0

but I'd like to use 4bit libr. but it seems not working.

What a pity.

:( [/url]
sirard
 
Posts: 18
Joined: Sat Jul 19, 2008 12:04 pm

Postby mnemonix » Sun Aug 31, 2008 9:09 pm

I have this problem too. Works with 8 bit not with 4 (though I know it's capable). Any other ideas?

Unrelated, but there is actually a typo on Lady Ada's lcd page:

"Lets connect these to the arduino thusly: D4 -> Arduino pin #7, D5 -> Arduino pin #8, D6 -> Arduino pin #9, D4 -> Arduino pin #10"

The last D4 should clearly be D7
mnemonix
 
Posts: 1
Joined: Sun Aug 31, 2008 9:06 pm


Return to Arduino

Who is online

Users browsing this forum: No registered users and 7 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [108]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[34]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]