September 22, 2009
June 18, 2008
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 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 : http://www.myplace.nu/mp3/images/nokia_lcd_small.jpg
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.
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 : http://www.myplace.nu/mp3/images/nokia_lcd_small.jpg 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 myplace.nu 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.
January 16, 2008
This is the list of my favorite compilers and its language for microcontroller programming.
AT89x51 (8051 family)
My favorite microcontroller is Atmel AVR. It is pretty cheap for hobbyist like me and it has massive features.
Fandi’s best choice
Search for reference:
One of my junior at President University, Edi Permadi finally released his works on the net about en/decryption and hashing method for PIC16F84. I personally like cryptography as well as its implementation in hardware (microcontroller or IC design). His works which already published are :
Direct file download :
Direct download :
My comment :
December 28, 2007
During developing hardware for my thesis, I found out that Pony Prog is wasting my time (it does not support profile keeping and I need to reconfigure device every time I use this application). So I use AVRdude to flash and to read my Atmel AVR microcontroller. Since AVRdude is CUI, I need to make a better GUI for it and providing mostly needed feature: profile. This application will display itself in the right-corner tray and easily used. Try it.
This application was completely written in C# (Visual Studio 2005) and you will need .NET framework 2.0 to run the application.
System requirement :
- Windows with .NET framework 2.0 installed
- AVRdude win32 ports (included)
- LibUSB-win32 (included)
- GiveIO.sys (included) for LPT access
In the following link I uploaded also the source code + binary.
Version 0.2.1 [Please upgrade to this version]
Source Code :
Dependency files (Lib-USB, GiveOI.sys and AVRdude):
December 2, 2007
A few weeks a go, I tried to make a program in WinAVR for AVR ATMega8 for driving Nokia 3310 LCD (pcd8554). The driver which I wrote is actually big (what the heck) 28% of 8kb. This is only for the driver without other functions that I will implement soon. Hmm I need something to get rid that fatty code. The thing that I always remember is knowing your compiler and source code written. The PDF I read was taken from http://www.fefe.de/know-your-compiler.pdf. Even this PDF discussing about source code optimization for PC, IMHO both PC or microcontroller is the same thing except its circumstances.
IMHO, compiler will do their best part of creating a program (binary), however the other part is programmer himself. The quality of a code will directly impact to program performance and size.
There are two things which could be optimized:
For example, in my case I need a medium performance but with very best code size. Actually, I could optimize the code by putting parameter into compiler. However, it is not good enough for the program. So, code optimization is the thing that I really should do.