Open GoogleCodeExporter opened 9 years ago
I don't have lcd hardware to recreate your test condition here.
However nothing that I envision could cause that problem was in the one-line
change
to Wire library between 0015 and 0017. That said there were significant
changes to
HardwareSerial and because of those changes, there may be a subtle difference
in how
a bug in Wire.init() existing in both versions is manifested. Can you apply the
attached patch to twi.c under hardware/libraries/Wire/utility/, delete twi.o,
then
recompile your test sketch and let me know if it makes any difference. The
patch
allocates buffers used by the twi interrupt handler before the interrupt is
enabled
instead of afterward, potentially preventing memory being stomped on.
Original comment by ckjohn...@gwi.net
on 5 Nov 2009 at 9:12
Attachments:
Huh. I'm unable to reproduce my original problem now, either with the project
code
I've been working on, or with the sample code I gave in my problem report. I
tried
deleting the twi.c.o file in ~/sketchbook/<name>/applet/Wire/utility before
running
with either version of the twi.c file, and it hasn't had any effect. I also
tried
removing the entire ~/sketchbook/<name>/applet folder and that didn't change
anything
either.
I'm using Debian Linux for my development system, so I suppose it's possible
that
some part of the AVR libc or GNU utilities changed out underneath me, but that
seems
a bit unlikely to be the culprit.
Original comment by mul...@gmail.com
on 6 Nov 2009 at 3:59
Hold that thought. As I mentioned in my report, I'd added one extra parameter
to the
LiquidCrystal object initialization because the old arduino-0015 software didn't
support the shorter initialization method.
When I use this:
LiquidCrystal lcd(12, 3, 11, 7, 6, 5, 4);
...the Arduino runs fine with 0017. But when I change it to this:
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
...the Arduino crashes and restarts, resulting in a slow blink. There's some
sort of
problem with removing the read/write pin.
Original comment by mul...@gmail.com
on 6 Nov 2009 at 4:11
mulad6, indeed adding the extra param in the lcd constructor solved the problem.
thanks.
Original comment by eli.ko...@gmail.com
on 16 Jan 2010 at 7:35
I am not sure if it due to the same issue. I have tried adding the extra
parameter and still no luck.
I am using arduino 0021 and every time I try and do anything with the wire
library my arduino crashes and reboots.
The link to the LiquidCrystal library is the only thing i can find but the
above fix fails.
I am also using Ethernet, 1wire, SPI, DallasTemperature but i have tried in
different combinations and It only seems to occur with LiquidCrystal
Original comment by shivalw...@gmail.com
on 13 Oct 2010 at 6:35
Hi
I have encountered roughly the same problem, but none of the above solution
worked for me.
My problem is that I get odd characters on my lcd. In Setup I write "Welcome"
and it comes out fine. After that I get 4 odd characters for a little while
then other odd 4 characters a.s.o.
My code looks like this:
// include the library code:
#include <Wire.h>
#include <LiquidCrystal.h>
#define RTC_I2C_ADDRESS 0x68
#define RTC_READ Wire.read
#define RTC_WRITE Wire.write
//Global var
byte Second, Minute, Hour, DayOfWeek, DayOfMonth, Month, Year;
byte zero;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 6, 11, 5, 4, 3, 2);
void setup(){
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.write("Welcome");
// initialize the serial communications:
Serial.begin(9600);
//Serial.println("a");
Wire.begin(0x68);
zero=0x00;
//SetRTC();
}
byte DecToBcd(byte val)
{
return ((val/10*16)+(val%10));
}
byte BcdToDec(byte val)
{
return ((val/16*10)+(val%16));
}
void SetRTC()
{
Wire.beginTransmission(RTC_I2C_ADDRESS);
RTC_WRITE(zero);
RTC_WRITE(DecToBcd(0) & 0x7F); //second
RTC_WRITE(DecToBcd(11)); //Minute
RTC_WRITE(DecToBcd(12)); //Hour
RTC_WRITE(DecToBcd(2));
RTC_WRITE(DecToBcd(18));
RTC_WRITE(DecToBcd(9));
RTC_WRITE(DecToBcd(12));
Wire.endTransmission();
}
void GetRTC()
{
Wire.beginTransmission(RTC_I2C_ADDRESS);
RTC_WRITE(zero);
Wire.endTransmission();
Wire.requestFrom(RTC_I2C_ADDRESS, 7);
Second = BcdToDec(RTC_READ() & 0x7F);
//Second = RTC_READ() & 0x7F;
//Second = RTC_READ();
Minute = BcdToDec(RTC_READ());
Hour = BcdToDec(RTC_READ() & 0x3F);
DayOfWeek = BcdToDec(RTC_READ());
DayOfMonth = BcdToDec(RTC_READ());
Month = BcdToDec(RTC_READ());
Year = BcdToDec(RTC_READ());
Serial.println(Second,DEC);
lcd.home();
lcd.write(Second);
}
void loop()
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
//Read RTC
digitalWrite(13,HIGH);
GetRTC();
delay(1000);
digitalWrite(13,LOW);
delay(1000);
}
I am using a Leonardo with a parallel LCD attached and an I2C-RTC.
Original comment by tonny.ve...@gmail.com
on 18 Sep 2012 at 10:19
I see this problem reproducibly using an Arduino Uno and a hacktronics 20x4
backlit LCD:
http://www.amazon.com/dp/B003B22UR0/ref=pe_175190_21431760_M3T1_ST1_dp_3
ASIN: B003B22UR0
I'm using LiquidCrystal and Serial.
If I remove the call to "Serial.begin(19200)" then I can use my LCD, but
otherwise the LCD only produces gibberish. I have tried a number of different
baud rates (from 300-57600), and they change the gibberish but don't fix things.
I've attached a minimal .ino file which reproduces the issue. Same code pasted
here below:
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 1, 4, 3,6,5,7);
int backlight = A1; // HIGH for backlight on
void setup() {
// http://code.google.com/p/arduino/issues/detail?id=125#makechanges
// Serial.begin(300); // uncomment this line to break the LCD output
pinMode(backlight, OUTPUT);
digitalWrite(backlight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
lcd.begin(20,4); // columns, rows. use 16,2 for a 16x2 LCD, etc.
lcd.clear(); // start with a blank screen
}
void alert(int x, int y, char *fmt, ...) {
char tmp[200];
va_list args;
va_start (args, fmt);
vsnprintf(tmp, 20, fmt, args);
va_end (args);
lcd.setCursor(x,y); // column, row
lcd.print(tmp);
// flash the LCD to indicate that it has updated
digitalWrite(backlight, LOW);
delay(100);
digitalWrite(backlight, HIGH);
}
void loop() {
for (int i=0; i < 100; i++) {
if (i % 4 == 0) lcd.clear();
alert(i % 20, i % 4, "i: %d", i);
delay(2000);
}
}
Original comment by mark.jef...@gmail.com
on 23 Mar 2013 at 3:17
Attachments:
Using pin 0 or 1 in the LCD constructor AND using serial, will cause some
issues.
As the serial communication uses the rx tx pins. ( 0 & 1 )
Change the lcd to not use pin 0 or 1
Original comment by lennaert...@gmail.com
on 3 Aug 2014 at 7:26
I observe strange behavior of LCD when Wire communication is started. At the
beggining binary characters are displayed and after few hours program hungs up.
Program is too complex to send it here. I use arduino-1.0.6 with included
LiquidCrystal and Wire.
Original comment by piotrekn...@gmail.com
on 27 Sep 2014 at 10:42
Original issue reported on code.google.com by
mul...@gmail.com
on 3 Oct 2009 at 5:23