Проблема с дисплеем

xorkrus
Offline
Зарегистрирован: 22.09.2013

Здравия желаю.

Пока меня не выпнули отсюда за глупые вопросы, я задам ещё один.

Есть простая Arduino Pro Mini atmega328 5v 16mhz. И есть самодельная платка atmega8 5v 16mhz.

Есть такой код (из примеров LiquidCrystal):

/*
  LiquidCrystal Library - Hello World
 
 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the 
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.
 
 This sketch prints "Hello World!" to the LCD
 and shows the time.
 
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 
 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

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

// initialize the library with the numbers of the interface pins
//Example
//LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//Needed
//LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
//LiquidCrystal lcd(D5, D4, D9, D8, D7, D6);
LiquidCrystal lcd(5, 4, 9, 8, 7, 6);
void setup() {
  Serial.begin(9600);
  // set up the LCD's number of columns and rows: 
  lcd.begin(24, 2);
  // Print a message to the LCD.
  lcd.print("hello, world! 1234567890");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
  Serial.print(millis()/1000);
}

Подключение дисплея соотвественно на обоих мегах:

RS - D5; EN - D4; RW - GND; Data4 - D9; Data5 - D8; Data6 - D7; Data7 - D6;

На меге8 - дисплей работает. В ком-порт данные отсылаются, на экране циферки меняются.

На меге328 - дисплей показывает кубики в верхней строке, в нижней - чисто. В ком-порт данные отсылаются.

Учитывая свои предыдущие косяки, подключение проверяю разве что не с микроскопом. С питанием, в этот раз, тоже все хорошо.

Подскажите пожалуйста по возможности, в чем я косячу на этот раз.

P.S. остальные цифровые ноги ардуины использовать нельзя :)

P.P.S. для проверки Dx портов на 328 - на каждом из используемых портов мигал светодиодом и опрашивал кнопки - все нормально.

С Уважением.

NeiroN
NeiroN аватар
Offline
Зарегистрирован: 15.06.2013

Чудеса в решете.

Попробуйте на аналоговые выводы подцепить, для чистоты эксперемента. Хотя мне кажется неправильно указана чатота кварца на одном из МК.