Nokia 5110 Attiny, 3v

Can the Nokia 5110 screen be driven by an attiny84 with the arduino tiny library?

Also, can it be driven by 3v instead of 3.3v? My goal is to get it working off of a 3v cr2032 battery.

If not, or if that is a bad idea, what alternatives do I have that are compact and don't waste battery?

Thanks.

probably if theres enough ram, and whats 0.3 volts between friends?

Just to update:
It does not appear that the library itself even fits on the 84. I also get this error:

In file included from pcdtest.cpp:19:
C:\Users\Nick\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:74: error: conflicting return type specified for 'virtual size_t Adafruit_GFX::write(uint8_t)'
C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/Print.h:71: error:   overriding 'virtual void Print::write(uint8_t)'

Yeah, thats because someone when they updated the tiny core to Arduino 1.0, missed a bit.

In Print.h in the tiny core, change the following:

    virtual size_t write(uint8_t) = 0;
    virtual void write(const char *str);
    virtual void write(const uint8_t *buffer, size_t size);

To be:

    virtual size_t write(uint8_t) = 0;
    virtual size_t write(const char *str);
    virtual size_t write(const uint8_t *buffer, size_t size);

And in Print.cpp, change the following:

/* default implementation: may be overridden */
void Print::write(const char *str)
{
  while (*str)
    write(*str++);
}

/* default implementation: may be overridden */
void Print::write(const uint8_t *buffer, size_t size)
{
  while (size--)
    write(*buffer++);
}

To:

/* default implementation: may be overridden */
size_t Print::write(const char *str)
{
  size_t n = 0;
  while (*str){
    n += write(*str++);
  }
  return n; 
}

/* default implementation: may be overridden */
size_t Print::write(const uint8_t *buffer, size_t size)
{
  size_t n = 0;
  while (size--) {
    n += write(*buffer++);
  }
  return n;
}

hmmm, now I get this:

In file included from C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/WProgram.h:17,
                 from C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/Arduino.h:4,
                 from C:\Users\Nick\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:20,
                 from pcdtest.cpp:19:
C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/TinyDebugSerial.h:728: error: conflicting return type specified for 'virtual void TinyDebugSerial::write(uint8_t)'
C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/Print.h:71: error:   overriding 'virtual size_t Print::write(uint8_t)'
In file included from C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/WProgram.h:18,
                 from C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/Arduino.h:4,
                 from C:\Users\Nick\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:20,
                 from pcdtest.cpp:19:
C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/HardwareSerial.h:58: error: conflicting return type specified for 'virtual void HardwareSerial::write(uint8_t)'
C:\Users\Nick\Documents\Arduino\hardware\tiny\cores\tiny/Print.h:71: error:   overriding 'virtual size_t Print::write(uint8_t)'

Eurgh, yeah, woops. I forgot that there are other bits in the core which are based around that version of Print being incorrect.

What you may have to do is to undo the changes to Print.h and Print.cpp, and instead change the Adafruit_GFX.h and Adafruit_GFX.cpp. Could you post the Adafruit library, and I can tell you what needs to be changed.

The other thing is though that the library seems to big for the 84. It compiles at almost 9kb. So it would need to be pruned in order to work. To display any text or anything it also requires this library:

If you put the Print library back to how it was (I think i put the original in my first post), and change the following

In Adafruit_GFX.cpp

#if defined(__AVR_ATtiny84__)
void Adafruit_GFX::write(uint8_t c) { //This line has been added
#elif ARDUINO >= 100
size_t Adafruit_GFX::write(uint8_t c) {
#else
void Adafruit_GFX::write(uint8_t c) {
#endif
  if (c == '\n') {
    cursor_y += textsize*8;
    cursor_x = 0;
  } else if (c == '\r') {
    // skip em
  } else {
    drawChar(cursor_x, cursor_y, c, textcolor, textbgcolor, textsize);
    cursor_x += textsize*6;
    if (wrap && (cursor_x > (_width - textsize*6))) {
      cursor_y += textsize*8;
      cursor_x = 0;
    }
  }
#if defined(__AVR_ATtiny84__)
#elif ARDUINO >= 100
  return 1;
#endif
}

In Adafruit_GFX.h

#if defined(__AVR_ATtiny84__)
  virtual void write(uint8_t); //this line is new
#elif ARDUINO >= 100
  virtual size_t write(uint8_t);
#else
  virtual void write(uint8_t);
#endif

I changed back the tiny cores, and added those changes to the GFX files and I still get the same errors but also with this at the end

In file included from pcdtest.cpp:19:
C:\Users\Nick\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:27: error: virtual outside class declaration

I must be missing something. I have just tried compiling the example (stripped of all the line, box, circle, triangle stuff) and without modifying anything it compiles fine. Could you post your sketch?

try it in arduino 0.22

What is this?
http://blog.livedoor.jp/miyanobspage/archives/2426895.html