Skip to content

Command Line Interface (CLI) For AVR

February 15, 2009

Overview: This is simple CLI code written in C for ATMEGA32 and simulated on Proteus. Serial Port (RS232) is used for input and output. You can connect board to serial port of computer and use hyperterminal as input and output. LCd Display is alternate output device and PCF8583 maintains data time information.

Description: I have used ATMEGA16 here. It is 8-bit RISC processor with maximum frequency up to 16MHz. It has one RS232 port which is used as input/output. Also PCF8583 IIC RTC controller is connected to one of its I2C port. Because of its simple architecture and tool availability it is very popular. If you are working first time on AVR then here are some cool tutorials on AVR micro-controller:

AVR : Tutorial 1: Introduction to AVR

AVR : Tutorial 2 : AVR – Input / Output


Make your own, ultra simple, universal AVR programmer !!


Software: Code is written in C and Compiled with CodeVisionAVR.  This code is completely interrupt based and CPU is Idle once initialisation is done.

Currently It supports limited commands. But because of its simple C Program flow you can easily add new commands. Serial interrupt is generated for each character and command is executed. Hence processor remains in idle state and complete code is written as interrupt subroutine.

Checkout Proteus CLI Simulation (Rename it to CLI.avi).


C Code (Rename it to CLI.c):


Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: