HAPSIM - Helmi's AVR Periphery Simulator V2.12

LCD (HD44780U), Terminal (USART and TWI), LEDs, Push-Buttons and Keypad Simulator Extension
for the AVR Simulator of Atmel's AVR Studio 4


Table of content:


Features:


LCD features:


How to use HAPSIM - Quickstart with Demo-Application 'LCDTest':



Terminal Simulator demo - USART to TWI Converter:

The Terminal Simulation for USART and TWI is a new feature in HAPSIM V2.0.
There is also a small test application for this new contol, namely a USART <-> TWI Converter which is used for this tutorial:


Terminal Simulation demo - redirection to PC's COM ports:

The used demo application utrans is quite simple: It uses both of the USART interfaces of an ATMega128:
Whatever is received on USART0 is forwarded to USART1 and vice versa.
For this demonstration we need two COM ports of our PC where we can redirect the AVR USARTs. At these COM ports we connect nullmodem cables with terminal programs attached.
So in fact we need two pairs of COM ports each pair looped with a serial cable! Due to the fact that it is unlikely you have 4 COM ports available on your computer you can either use a second computer running the terminal programs or you can use a virtual serial port driver like the Virtual Serial Port Kit (unfortunately there's only a 15 days trial version for free) which I used here:


4x4 Keypad demo - TestKeypd application:

TestKeypad is an application for Atmega16 to test a 4 x 4 keypad connected to PortB.
The program toggles the Strobe lines from High to Low. The Input lines are tested for a low signal connection to the strobe line when the button is pressed.
To prevent key bounce keypadtest starts a 25ms timer and retests the button is still pressed.

Port B Pin 0 - Strobe Line 1
Port B Pin 1 - Strobe Line 2
Port B Pin 2 - Strobe Line 3
Port B Pin 3 - Strobe Line 4
Port B Pin 4 - Input Line 1
Port B Pin 5 - Input Line 2
Port B Pin 6 - Input Line 3
Port B Pin 7 - Input Line 4

Running TestKeypad using HAPSIM

The Terminal screen will display a message "Test Keypad Program"
Press the buttons on the keypad or use the Keyboard to activate the hotkey links.
The keys pressed are echoed to the terminal screen.


Known Issues and restrictions:


Thanks and Tribute to:

Andrew Macdonald for programming the 4x4 Keypad control and the corresponding demo-app "TestKeypad", andrew.macdonald@au.fujitsu.com.
Peter Fleury for his LCD library, used by the LCDTest program, http://jump.to/fleury
Iuri Apollonio for the 'CoolMenu' Support, http://www.codeguru.com/Cpp/controls/menu/bitmappedmenus/article.php/c177/
Maurizio Pisano for the MessageBoxTimeout API, http://www.codeproject.com/cpp/MessageBoxTimeout.asp
James Clark for his Expat XML parser library, http://www.libexpat.org and
Tim Smith for the C++ Wrappers for the Expat XML Parser, http://www.codeproject.com/soap/expatimpl.asp
And last but not least, Atmel for their AVR microcontrollers which are the reason for all this ;-)
and of course for their free AVR Studio Software, look at http://www.atmel.no/beta_ware/ for the latest (Beta-)Releases.


Download:

Look at http://www.helmix.at/hapsim


Note:Some of these Demo-Applications are using the #define FASTSIM to speed up the simulation.
If you want to run them on 'real' AVR hardware you have to remove the definition of FASTSIM by removing the line
"set DEBUG=-D FASTSIM" from the build.bat batchfiles!

Programmer's Tutorial:

Some internal information on HAPSIM:

If you want to add new functionallity and therefore collaborate in the further development of HAPSIM then read this HAPSIM Programmer's Tutorial.


History:


Contact:

Please e-mail any suggestions, complaints and other feedback to
helmix@lycos.at
http://www.helmix.at/hapsim

Helmut Wallner, 18.3.2008