root@fandigunawan

September 22, 2009

Panduan Menggunakan JTAG Debugger untuk Atmel AVR

Filed under: Microcontroller — Tags: , , , — fandigunawan @ 7:03 am
Ditautkan dari laman asli : http://mikrokontroler.sekoteng.com/tulisan/2009/09/22/panduan-menggunakan-jtag-debugger-untuk-atmel-avr/

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 :

http://fandigunawan.googlepages.com/hd44780_stdio_bind.zip

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 : 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.

 http://fandigunawan.googlepages.com/lcd_pcd8544_v026rev1.zip

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

0.2.6 (dont use this)

 http://fandigunawan.googlepages.com/lcd_pcd8544_v026.zip

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

Many thanks for Jakub Lasinski for code review and suggestions.

0.2.5

http://fandigunawan.googlepages.com/lcd_pcd8544_v025.zip

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

http://fandigunawan.googlepages.com/lcd_pcd8544_v024rev1.zip

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

 http://fandigunawan.googlepages.com/lcd_pcd8544.zip

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.

 http://fandigunawan.googlepages.com/bmp2hex.zip

———————————————————————————————–

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.

http://fandigunawan.googlepages.com/water_level_monitor.zip

[Updated May 3, 2009]

Credit

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.

(more…)

January 16, 2008

My Favorite Compiler and Programming Language for Microcontroller

This is the list of my favorite compilers and its language for microcontroller programming.

AT89x51 (8051 family)

C

Assembly

Microchip PIC

C

Pascal

Assembly

Atmel AVR

C

Pascal

Assembly

Since I don’t really like BASIC, so I did not mention any BASIC compiler for microcontroller.

My favorite microcontroller is Atmel AVR. It is pretty cheap for hobbyist like me and it has massive features.

Freeware   Freeware

Best choice  Fandi’s best choice

Search for reference:

Atmel AVR
AVR C Compiler
Buy Microchip PIC
Microchip PIC C Compiler
Microchip PIC Assembler
Atmel 8051
8051 C Compiler
8051 Assembler

Cryptography in Microcontroller

Filed under: Microcontroller, Security — Tags: , , — fandigunawan @ 8:21 am

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 :

 

 

Implementing Simplified DES using PIC16F84

Direct file download :

http://edipermadi.googlepages.com/sdes-pic16f84.7z

Implementing MD5 using PIC16F84

Direct download:

 http://edipermadi.googlepages.com/md5-pic16f84.7z

Implementing Simplified DES using EEPROM

Direct download

 http://edipermadi.googlepages.com/sdes-encryption-lookup.7z

 http://edipermadi.googlepages.com/sdes-decryption-lookup.7z

Simplified DES Simulator

Direct download :

 http://edipermadi.googlepages.com/sdes-simulator.7z

To open files above you will need WinRAR or  7-ZIP (recommended)

My comment :

It is a very interesting implementation, however NIST has chosen Rijndael to replace DES. I hope in the future he will be able to implement Rijndael in microcontroller or FPGA.

MD5 is no longer secure, it has collision. SHA1 is much better.

Links :

December 28, 2007

Idnaf.AVRdude.FE : Free AVRdude Front End

Filed under: Microcontroller, Software Development — Tags: — fandigunawan @ 8:54 am

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.

Screenshot :

Option box

When right-click in the tray

This application was completely written in C# (Visual Studio 2005) and you will  need .NET framework 2.0 to run the application.

System requirement :

  • GiveIO.sys (included) for LPT access

License : please see licensing page

In the following link I uploaded also the source code + binary.

Version 0.2.1 [Please upgrade to this version]

Source Code :
http://fandigunawan.googlepages.com/Idnaf.AVRdude.FE.021-src.zip
Binary:
http://fandigunawan.googlepages.com/Idnaf.AVRDude.FE.021-bin_complete.zip
Dependency files (Lib-USB, GiveOI.sys and AVRdude):
http://fandigunawan.googlepages.com/Dep.zip

Version 0.2.0

Source Code :
http://fandigunawan.googlepages.com/Idnaf.AVRdude.FE.020-src.zip
Binary:
http://fandigunawan.googlepages.com/Idnaf.AVRdude.FE.020-bin_complete.zip

Version 0.1.0

Source Code :
http://fandigunawan.googlepages.com/Idnaf.AVRdude.FE.010-src.zip
Binary:
http://fandigunawan.googlepages.com/Idnaf.AVRdude.FE.010-bin.zip

Links :

December 2, 2007

Code Optimization for Your Program

Filed under: Microcontroller, Misc, Software Development — Tags: — fandigunawan @ 6:57 am

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:

  • Speed
  • Size

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.

(more…)

June 14, 2007

MUTEX is Finally Finished

Filed under: Microcontroller, Project — fandigunawan @ 8:44 am

MUTEX is my project for Embedded System Design, it stands for Multipurpose Temperature Controlled System. The final report can be found here.

Blog at WordPress.com.