Go Down

Topic: lcd with ATmega 644 (Read 1 time) previous topic - next topic

oldPGMguy

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)
I'm old and started too late with microcontrollers

ReSiStAnCe


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...

oldPGMguy

Code: [Select]
**** 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
I'm old and started too late with microcontrollers

oldPGMguy

#3
Aug 20, 2012, 07:54 pm Last Edit: Aug 20, 2012, 08:11 pm by oldPGMguy Reason: 1
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
I'm old and started too late with microcontrollers

CrossRoads

"had the row and col on the lcd backwards"

Yes, that could cause things to work funny!
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.

oldPGMguy

yep..sometimes its just the simple things that go wrong
I'm old and started too late with microcontrollers

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview