Arduino LCD playground | Philips PCF8833 LCD library
PhilipsLCD is an unofficial Arduino library that supports the screens commonly used in Nokia 6100 phones (and others). There are actually two types of chips for these phones, a Samsung and a Philips. This library only supports the Philips one.
The Philips PCF8833 is the interface chip in the 12-bit color 128x128 pixel screens used on the Sparkfun Color LCD Shield and the Olimex SAM7-EX256 and the Nokia 6100 phone, the Nokia 2600 phone (and others). Instructables: How to use a Nokia Color LCD
Download the library here:
https://playground.arduino.cc/uploads/Code/PhilipsLCD.zip
The library has been created by Markos Kyritsis, it is (of course) copyleft, which means you can take it and do whatever you want with it. But please, please, if you optimise it in any way, then contribute to the community and upload a copy for everyone else =D
Here is what you can do with the library:
To draw a sprite on the screen, you need to insert 12bit hex values into the Image.h file. The default file comes with a little picture of Tux, my favorite penguin!
void setup() {
LCDP.LCDInit();
delay(100);
LCDP.LCDClear(0x00); // black
LCDP.DrawCircle(0xF00, 10, 20, 10); //Draw a red circle at (10,20) of radius 10
LCDP.DrawBitmap(50, 50); Draw Tux at (50,50)
}
The arduino has a very limited amount of memory -only 16kb EEPROM- and so making a photo frame is impossible. Instead, we could use the library in combination with the brilliant SDuFAT library created by: Libelium - www.libelium.com and hosted by: BlushinBoy - www.blushingboy.net. I have merged the two libraries, and can now read basic 12-bit image data. However getting it to work is sadly not as simple as just uploading a .bmp file into the SD card. Instead, there is some processing which involves:
Before you do anything else, you need to connect an SD card to your Arduino. There is an excellent discussion on the Forums on how to do this.
http://forum.arduino.cc/index.php/topic,8863.html
Communication with the SD card is done using the SPI protocol. This automatically means that you can't use those pins to communicate with the LCD screen (or the SPI protocol in that matter). If you are planning on using my library, then that's not a problem.
Creating a connector for the SD card can be really annoying (at least I found it to be). But, for the prototype stage, you can use a floppy IDE cable. As seen in the picture below.
I strongly recommend playing around with the SDuFat library before using my modified version. The primary reason for that, is to make sure your SD card works properly before you proceed. The SDuFAT library is located in the Arduino playground under this link:
https://playground.arduino.cc/Learning/SDMMC
The next step is to connect the LCD screen to the Arduino. The PIN assignment is the same as before:
Now you can download my modified SDuFAT library from here: https://playground.arduino.cc/uploads/Code/SDuFATLCD.zip
Make sure you have neither the original SDuFat, nor the PhilipsLCD libraries in the hardware folder. Otherwise you won't be able to compile your programs (I tend to remove them temporarily to another directory).
Now you need to copy some images to your SD card. Begin by formatting your SD card to a fat 16 filesystem. In Linux, this can be done by typing: mkfs.vfat -F 16 -n SD /dev/sde1 (change sde1 to whatever your device is) into the terminal. You now need to follow the following steps for the Photo Frame application to work:
I think the sketch is self explanatory, all the commands are there, apart from two, namely: dispOff() and dispOn(). You can use these to switch the screen off, and then back on again whilst drawing.
If everything went OK, you should see your first photo being drawn. Once the photo is completely drawn onto the screen, it will stay for ten seconds, and the next photo will start getting drawn.
The drawing process is incredibly slow, but it works. The demo works with only two photos, but by changing the sketch a little bit you can get it to draw a lot more.
Enjoy!