June 18, 2008

HD44780’s stdio bind for WinAVR

Last time I found out that stdio.h functions is very useful but then it is lack in interfacing. Therefore while I’m doing my project with HD44780 (LCD with 16×2 characters) it is necessary to bind the LCD functions to stdio.h such as printf() function.

The result of an example : printf(“Line1\nLine2”);

Download the code here :


LCD Nokia 3310 (PCD8544) Driver in WinAVR(avr-gcc)

LCD Nokia 3310 is widely known to be monochrome graphic LCD targeted for embedded devices. It is a 84×48 pixels LCD that can be interfaced trough SPI protocol. This is the detail of the LCD’s pins configuration.

Taken from :

The driver is targeted for avr-gcc or WinAVR.

In case you need to recompile to suit your need, please download the following tools :

This design is targeted to be clocked at 4 Mhz, you may change it by modifying makefile or change the configuration of clock in AVR Studio. You can use avrprog or Pony Prog to program your fuse bits (CKSEL) or you may recompile the code to suit your clock speed.

New version :

0.2.6 rev 1 (new)

A silly mistake I made in header file. Please update your version 0.2.6 to 0.2.6 rev 1.

* + Header file (pcd8544.h) PIN definition fixed

0.2.6 (dont use this)

* + Optimization using Memset and Memcpy
* + Bug fix and sample program reviewed
* + Commented <stdio.h>

Many thanks for Jakub Lasinski for code review and suggestions.


Changelog from version 0.2.4

* Version 0.2.5 ( December 25, 2008 ) x-mas version
* + Boundary check is added ( reported by starlino on Dec 20, 2008 )
* + Return value is added, it will definitely useful for error checking

0.2.4 rev 1

Changelog from version 0.2.4 :

* Version 0.2.4 revision 1 ( December 25, 2008 )
* + Some of boundary checking added (reported by starlino) and this is actually as a part of version
* 0.2.5 but I think i need to add it to this version also.

Old version

Note : If you find out my code working in your design please let me know about it.


Generating hex from BMP using BMP2HEX by Jakub Lasinski :

You will need .NET framework 2.0 to use this application.


As a request from AGA33, I have posted the picture of the project, schematic as well as the project source code of my thesis (yes, my thesis using old version driver).

The project was clocked using internal oscillator at 4 Mhz, see AVR datasheet regarding to internal clock setting.

The corresponded source code of my thesis.

[Updated May 3, 2009]


Many thanks to : for awesome PCD8544 picture. Thanks for visitor who told me about this picture credit. Actually I don’t remember actually where I picked the picture since it has been more than a year ago and I used Google image search engine. Actually I don’t remember removing the label from the image but it is fine for me. If you have any problem with my post or project please kindly tell me, I can’t do anything right without your feedback. Thanks.


Create a free website or blog at