Pages: [1]   Go Down
Author Topic: lcd with ATmega 644  (Read 1008 times)
0 Members and 1 Guest are viewing this topic.
maryland-USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 67
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

need some info to connect 20x4 lcd to atmega 644....works on a arduino , but not on the 644....help please...a schematic would be helpful...or what pins to use for liquidcrystal
:liquidcrystal(rs,en,db4,db5,db6,db7)
Logged

I'm old and started too late with microcontrollers

0
Offline Offline
Newbie
*
Karma: 0
Posts: 43
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

need some info to connect 20x4 lcd to atmega 644....works on a arduino , but not on the 644....help please...a schematic would be helpful...or what pins to use for liquidcrystal
:liquidcrystal(rs,en,db4,db5,db6,db7)

For liquidcristal(rs,en,db4,db5,db6,db7) you can use (almost) any pins you want, that's exactly what you are declaring with this function...

Please post some more info.
How did you hook it up on the arduino? (YOUR schematic)
How did you hook it up on the 644?
Is it a Sanguino  ? http://sanguino.cc/hardware
Did you ever manage to run any sketch on the 644?
Your code?

Little info generates few answers...
Logged

maryland-USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 67
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
**** 4 x 20 LCD connnections ****
16-gnd
15-Vcc +5
14- DB7 to D6 on 644
13- DB6 to D5 on 644   
12- DB5 to D4 on 644
11- DB4 to D3 on 644
10-NC
 9-NC
 8-NC
 7-NC
 6- EN to D2 on 644
 5- RW to Gnd
 4- RS-to D1 on 644
 3-Contrast 220 ohm to ground
 2- Vcc +5
 1- Gnd
                  RS,EN,DB4,DB5,DB6,DB7
 LiquidCrystal lcd(1, 2, 3, 4, 5, 6);
 
 */

// include the library code:
#include <LiquidCrystal.h>
#include <SPI.h>

LiquidCrystal lcd(1, 2, 3, 4, 5, 6);
//----------------------------------------------------
 void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);  // 4 row 20 column LCD
  delay(10);
 }
 //-----------------------------------------------------
void loop()
{
  lcd.setCursor(0,0);
  lcd.print((char)255);
  lcd.print("POWER SUPPLY SETUP");
  lcd.print((char)255);
  lcd.setCursor(0,1);
  lcd.print("<Current OP-0.300ma>"); 
  lcd.setCursor(0,2);
  lcd.print("V1  V2  V3  V4  V5");
  lcd.setCursor(0,3);
  lcd.print("3.3 5.0 9.0 +-5 +-12");
 }

This is the test code i used
I am using a 644 with Sanguino bootloader
it loads perfect with Arduino IDE
LCD is from adafruit...works on my ATmega 328 chip
LiquidCrystal Library works on my 328 chip..maybe i'm using the wrong pins on the 644 chip
pins on 644 are 1,2,3,4,5,6
Logged

I'm old and started too late with microcontrollers

maryland-USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 67
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i make a small mistake , i named d1,d2,d3,d4,d5,d6, when 1 should be d0 to d5....but i got 4 lines of garbage on the lcd...i changed to d25,d24,d20,d21,d22,d23 and got nothing.


found the problem, had the row and col on the lcd backwards...works now....now to build a finish board, for my 644 and 1284
« Last Edit: August 20, 2012, 01:11:20 pm by oldPGMguy » Logged

I'm old and started too late with microcontrollers

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26554
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"had the row and col on the lcd backwards"

Yes, that could cause things to work funny!
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

maryland-USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 67
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yep..sometimes its just the simple things that go wrong
Logged

I'm old and started too late with microcontrollers

Pages: [1]   Go Up
Jump to: