Hi,
Okay, I've spent a good 10 hours trying to get this to work (to no avail). I have researched / Googled for many many hours - I have read 100's of forum posts and suggestions. None seem to work for me. So, now I am asking for help on this forum.
I purchased a Pop-168 ATMega168 Matchbox as a Pop-builder kit a few years ago - I moved house and it got tucked away in a cupboard until a few days ago when I re-found it! I have been using an LCD screen with a Basic Stamp 2 and it works fine.
I installed arduino-0022 and noticed that a new LiquidCrystal library has been included (I think the last time I used this it was version 007!) I thought it would be good to hook the two together. I tested the Pop-168 with some basic tests to make sure it was working okay. It flashes LEDs, plays sounds and reacts to button presses. Excellent! I successfully uploaded code and it executes okay, so I know the device itself is oky.
I took a look at: Arduino Tutorial - connecting a parallel LCD and it seemed simple enough - I just had to translate the Pins used to the ones on the Pop-168 (see schematic_01.jpg attached below).
Originally I just attempted to output text to the LCD. This only resulted in the Black boxes being displayed. I read about attaching a 10k POT, I tried that and whilst the contrast went up and down it didn't make any difference. I then read that I could just connect LCD Pin 3 to GND to get max contrast, so I opted for that to reduce dependencies.
As a test I then extended the sample code to flash an LED and play a sound so that I could confirm that the code was working okay. Here is the code I am currently using:
#include <LiquidCrystal.h>
#define LED1_PIN 2
#define SND1_PIN 3
#define RW_PIN 9
#define EN_PIN 8
#define D4_PIN 4
#define D5_PIN 5
#define D6_PIN 6
#define D7_PIN 7
LiquidCrystal myLcd(RW_PIN, EN_PIN, D4_PIN, D5_PIN, D6_PIN, D7_PIN);
void setup() {
pinMode(LED1_PIN, OUTPUT);
noTone(SND1_PIN);
myLcd.begin(16,2);
myLcd.println("Hello World!");
tone(SND1_PIN, 400, 200);
}
void loop() {
digitalWrite(LED1_PIN, HIGH);
delay(1000);
myLcd.clear();
myLcd.setCursor(0,0);
myLcd.println("tony");
digitalWrite(LED1_PIN, LOW);
tone(SND1_PIN, 623, 400);
delay(1000);
noTone(SND1_PIN);
}
As you can see I have used a breadboard and attempted to make the connections as clean / tidy as possible. I set the LCD Pins 7-10 to GND just to be sure.
LCD PIN POP-168
1 GND 12
2 +5v 10
3 V0 12 (gnd)
4 RS 9
5 R/W 12 (gnd)
6 EN 8
7 D0 12 (gnd)
8 D1 12 (gnd)
9 D2 12 (gnd)
10 D3 12 (gnd)
11 D4 4
12 D5 5
13 D6 6
14 D7 7
15 + (backlight not used)
16 - (backlight not used)
As you can see in the pictures, all I am displayed is a row of Black blocks instead of the "Hello World" and "tony" text.
I tried the Serial example also, when I type some text and send it to the Pop-168 it just displays that same set of Black blocks.
I have a DC Input to the Pop-168, I also tried using a separate power supply directly to the LCD (just incase) - this made no difference.
I tried another LCD screen (same as previous one), that outputs exactly the same. I can confirm that the LCD screens are working okay and that the Pop-168 is working okay.
To me, it looks like the LCD screen is not being initialized correctly via the Library code - is this a correct assumption?
any help / guidance greatly appreciated!
thanks
tony