[an error occurred while processing this directive]
может это
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено m16 12 октября 2005 г. 14:36
В ответ на: Можно ли в AVRStudio симулировать обмен по терминалу? отправлено <font color=gray>Amal</font> 12 октября 2005 г. 14:06


HYPERLINK "http://www.helmix.at/hapsim.htm"

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


HAPSIM - Helmi's AVR Periphery Simulator V2.05
LCD (HD44780U), Terminal (USART and TWI), LEDs and Push-Buttons Simulator Extension
for the AVR Simulator of Atmel's AVR Studio 4

INCLUDEPICTURE "http://www.helmix.at/hapsim/hapsim1.gif" \* MERGEFORMATINET Table of content:
HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimfeatures#hapsimfeatures" HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimlcdfeat#hapsimlcdfeat"
LCD features


HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimlcdtut#hapsimlcdtut"
How to use HAPSIM - Quickstart


HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimrealhw#hapsimrealhw"
Using LCDTest on Hardware


HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimtermtut#hapsimtermtut"
Terminal Simulator - Quickstart


HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimissues#hapsimissues"
Known Issues and restrictions


HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimthanks#hapsimthanks"
Thanks and HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimdownload#hapsimdownload" HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimhistory#hapsimhistory" HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimcontact#hapsimcontact"
Contact


Features:
supports Atmel AVR Studio 4, Version 4.09, 4.10.356, 4.11.401 and 4.11.403-405.
simultaniously simulates one or more of each of the following components:
HD44780U compatible LC-Display with up to 40 x 2 characters.
Pushbuttons connected to Input Port Pins.
LEDs connected to Output Port Pins.
Terminal connected to USART, UART or TWI(I2C) ports.
easy configuration of the components.
configuration files are stored in future-save XML format.
target device selection with all devices supported by the AVR Simulator.

LCD features:
acts like a real HD44780U.
1 or 2 Display lines.
8 to 40 characters per line.
4bit AND 8bit I/O mode support.
supports the complete original character set (5 x 8 dot)
including all the characters above 0x80 ;-)
support for 8 user defined characters.
supports blinking cursor, display shifting, cursor movement.
selectable background color and display size (zoom factor).

How to use HAPSIM - Quickstart:
Download and unzip HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimdownload#hapsimdownload"
HAPSIM
and HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimdownload#hapsimdownload"
LCDTest
.
Build the LCDTest project by executing 'buildcoff.bat' (maybe edit the 'winavr' path first).
Start AVR Studio 4
In the Project Wizard select the 'lcdtest.cof' file and press 'next>>'
Select Debug Platform: 'AVR Simulator' and Device: 'ATmega128'.
Click 'Finish'.
Start 'hapsim.exe'. It automatically detects the running AVR Studio and connects to it.
Verify the connection to AVR Studio by clicking the Options menu:
The 'AVRStudioHook' Option must be checked.
An LCD1 Window with a 16 x 2 LCD appears by default.
Now open the 'LCDTest.xml' file in HAPSIM.
An LCD, a Button window and a LEDs window appear.
Each of them can be configurated by selecting it and then clicking the appropriate Settings button or select '...Settings' from the 'Options' menu.
But that's not necessary now because they are already pre-configured for the LCDTest program.
Hit the Run (F5) button in AVR Studio, sit back and watch as the LCD shows the welcome text.
It's quite slow, I know, but that's the simulation speed of the AVR Simulator with a little slowdown by HAPSIM, of course...
INCLUDEPICTURE "http://www.helmix.at/hapsim/hapsim2.gif" \* MERGEFORMATINET When the text display has finished, the first green LED in the LEDs window, named lights up.
For explanation: the 4 green LEDs show the current mode of the Test program, I'll explain later.
The red LEDs below show the state of the 4 buttons of the buttons window.
First, let's test the cursor modes of the LCD:
Press the first of the 4 buttons, the 'Cursor' button and hold it down. As you see the 'Button1' LED lights up!
Release the button. The underlined cursor appears at the current cursor position of the LCD which should be at the of "Test" if you have not pushed any other buttons yet.
Press and release the 'Cursor' button once more and you get the blinking cursor with underline.
Next time you get the blinking cursor without underline. Once more and the cursor disappears.
Select a (visible) cursor of your choice for the following steps.
Test mode 0: Press and release - slowly - the button. On every edge of the button signal one (increasing) character code is written to the display while the cursor moves to the right.
Note that you have to do it slowly, because the buttons are only polled by the AVR and the character display generates a little delay. When you click too quick, the AVR will loose some 'button events'.
When the cursor reaches the right edge, the display shifts to the left in order to keep the cursor visible at all time.
With the button the (still increasing) character codes are written from right to left and the display shifts to the right when the cursor reaches the left edge.
Now switch to test mode 1 by pressing the button. (what a surprise ;-)
The 2nd green LED lights up.
Test mode 1: In this mode the cursor can be moved with the and button without writing characters and without shifting the display. So you can also move the cursor out of the visible display area.
Press the button once more and you get to test mode 2: Now the display is shifted left and right without moving the cursor.
Finally switch to test mode 3: This is a test for the user defined characters, the "CGRAM Test" which is displayed in the 2nd line. The first display line shows the character codes 0 to 15 which contains the 8 user defined characters twice; character 0-7 are the same as 8-15.
At the first appearance you should see there random bit patterns (= the current content of the CGRAM) except for the Copyright (c) Symbol which was defined during display of the intro text.
With the and button you can now write (increasing) bit patterns to increasing (right) or decreasing (left) CGRAM addresses and watch them on the display.
That's all! Pressing the button once more leads to the mode0 again...

Using LCDTest on Hardware:
Note:
If you want to run this LCDTest program on a AVR you have to remove the definition of FASTSIM in the first line of 'lcd.c'.
This #define shortens out the delay() function and therefore speeds up the simulation!


Terminal Simulator - Quickstart:
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:
Download and unzip HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimdownload#hapsimdownload"
Usart2Twi
(and of course HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimdownload#hapsimdownload"
HAPSIM
if you haven't done yet).
Build usart2twi project by executing 'buildcoff.bat' which generates a file for the ATMega8 this time for variety (and also to show the new Device selection feature of HAPSIM ;-)
Note:
usart2twi is prepared to be built for ATMega128 too, by just changing the MCU parameter in buildcoff.bat, if you prefer...

Important note for AVR Studio Version 4.10 and below:

The 'PartDescriptionFile' for ATMega8 supplied with Versions below 4.11 of AVR Studio are incomplete and prevent the TWI simulation to work properly!
Please download the HYPERLINK "http://www.helmix.at/hapsim.htm" \l "hapsimdownload#hapsimdownload"
corrected files
for V4.09 or V4.10 and replace the original 'ATMega8.xml' file in the '.\PartDescriptionFiles\' folder of your AVR Studio directory! (btw: the ATMega128 files are OK!)

Start AVR Studio 4
In the Project Wizard select the 'usart2twi.cof' file and press 'next>>'
Select Debug Platform: 'AVR Simulator' and Device: 'ATmega8'.
Click 'Finish'.
Start 'hapsim.exe'. It automatically detects the running AVR Studio and connects to it.
Verify the connection to AVR Studio by clicking the Options menu:
The 'AVRStudioHook' Option must be checked.
Now open the 'Usart2Twi.xml' file in HAPSIM. You get two Terminal windows. The upper one named USART is attached to the USART interface without local echo because USART echo is done by the test application.
The other Terminal named 'I2C-Terminal' is attached - what a surprise - to the TWI interface this time with local echo.
Hit the Run (F5) button in AVR Studio, sit back and watch as the USART terminal shows the welcome text.
INCLUDEPICTURE "http://www.helmix.at/hapsim/hapsim3.gif" \* MERGEFORMATINET When the text display has finished, you can start typing in any of the two windows and watch as the text is echoed and appears in the other window... :-0
In the USART window you have to type quite slowly otherwise you get a 'TWI Tx Buffer Overflow!' message in the USART window because the test application only uses a 1-byte buffer and the USART has no handshaking and therefore no blocking mechanism.
In the I2C-Terminal window you can type as fast as you like. There is no overflow because the TWI is blocked (by virtually holding the SCL line low) until the character is sent to the USART.
Have fun!

Known Issues and restrictions:
no timing conditions are checked or considered.
e.g. the LCD even works if you don't wait for the busy bit to clear.
DDR (data direction) programming of the AVR ports are neither checked nor considered.
avoid double connections, e.g. connecting the same port pin to the enable pin of the LCD and to a LED will cause problems.
don't change the port settings (of any controls) during a running Debug session.
Hit the Break Button in the AVR Studio first! Anyway you don't have to stop the debugger completely.
no memory mapped IO support for the LCD.
TWI terminal only supports master-transmit and slave-receive modes and doesn't check the slave-address.
incomplete PartDescriptionFiles for ATMega8 (maybe others too) supplied with AVR Studio Versions below 4.11, resulting in TWI terminal problems.

Thanks and Tribute to:
Peter Fleury for his LCD library, used by the LCDTest program, HYPERLINK "http://jump.to/fleury"
http://jump.to/fleury

Iuri Apollonio for the 'CoolMenu' Support, HYPERLINK "http://www.codeguru.com/Cpp/controls/menu/bitmappedmenus/article.php/c177/"
http://www.codeguru.com/Cpp/controls/menu/bitmappedmenus/article.php/c177/

Maurizio Pisano for the MessageBoxTimeout API, HYPERLINK "http://www.codeproject.com/cpp/MessageBoxTimeout.asp"
http://www.codeproject.com/cpp/MessageBoxTimeout.asp

James Clark for his Expat XML parser library, HYPERLINK "http://www.libexpat.org/"
http://www.libexpat.org
and
Tim Smith for the C++ Wrappers for the Expat XML Parser, HYPERLINK "http://www.codeproject.com/soap/expatimpl.asp"
http://www.codeproject.com/soap/expatimpl.asp


Download:
HYPERLINK "http://www.helmix.at/hapsim/hapsim205.zip" INCLUDEPICTURE "http://www.helmix.at/hapsim/iconhapsim.gif" \* MERGEFORMATINET HYPERLINK "http://www.helmix.at/hapsim/hapsim205.zip"
HAPSIM V2.05, 15.3.2005
hapsim205.zip
120.850 Demo-Applications


HYPERLINK "http://www.helmix.at/hapsim/lcdtest.zip" INCLUDEPICTURE "http://www.helmix.at/hapsim/lcdtest.gif" \* MERGEFORMATINET HYPERLINK "http://www.helmix.at/hapsim/lcdtest.zip"
LCD Test program, 25.1.2005
lcdtest.zip
13.201 HYPERLINK "http://www.helmix.at/hapsim/usart2twi.zip" INCLUDEPICTURE "http://www.helmix.at/hapsim/conv.gif" \* MERGEFORMATINET HYPERLINK "http://www.helmix.at/hapsim/usart2twi.zip"
USART<->TWI Converter, 26.1.2005
usart2twi.zip
6.878 HYPERLINK "http://www.helmix.at/hapsim/tributtons.zip" INCLUDEPICTURE "http://www.helmix.at/hapsim/triicon.jpg" \* MERGEFORMATINET HYPERLINK "http://www.helmix.at/hapsim/tributtons.zip"
Trinary Buttons Demo, 7.2.2005
tributtons.zip
5.644 Part-Description-Files for TWI Simulation in AVR Studio Versions below HYPERLINK "http://www.helmix.at/hapsim/atmega8_409.zip" INCLUDEPICTURE "http://www.helmix.at/hapsim/bug.gif" \* MERGEFORMATINET HYPERLINK "http://www.helmix.at/hapsim/atmega8_409.zip"
ATMega8.xml for AVR Studio 4.09
ATmega8_409.zip
37.742 HYPERLINK "http://www.helmix.at/hapsim/atmega8_410.zip" INCLUDEPICTURE "http://www.helmix.at/hapsim/bug.gif" \* MERGEFORMATINET HYPERLINK "http://www.helmix.at/hapsim/atmega8_410.zip"
ATMega8.xml for AVR Studio 4.10
ATmega8_410.zip
37.771 History:
V2.05 - 15.3.2005
Update for AVR Studio 4.11 Servicepack 1, build 404 and 405.
Performance improvement!

V2.04 - 3.3.2005
Update for AVR Studio 4.11 Servicepack 1, build 403.

V2.03 - 10.2.2005
'Stay On Top' - Option added.

V2.02 - 7.2.2005
Trinary encoding support for Button Control
This feature allows to connect two buttons at one I/O line.
For details see AVR Freaks Design Note #044 by Luke Sangalli

HYPERLINK "http://www.avrfreaks.net/index.php?module=FreaksTools&func=viewItem&item_id=407" \t "_blank"
Using Trinary Encoding to Reduce Pin Wastage

Configuration file loading via parameter at program start.

V2.01 - 1.2.2005
UART support for devices like ATMega163 (UART instead of USART).
GDI resource leakage fixed.
PartDescriptionFiles: handling of as hex identifier added.

V2.00 - 26.1.2005
Terminal simulation for USART and TWI(I2C) implemented.
Target device selection.
LCD write only mode: R/W line may be hardwired to no portpin necessary.
Configuration file format changed to XML.
Update for AVR Studio 4.11, build 401.

V1.02 - 6.9.2004
LCD supports up to 40 characters per line.

V1.01 - 28.8.2004
Update for AVR Studio 4.10, build 356.

V1.0 - 23.8.2004
First Release!

Contact:
Please e-mail any suggestions, complaints and other feedback HYPERLINK "mailto:helmix@lycos.at"
helmix@lycos.at


HYPERLINK "http://www.helmix.at" \t "_top"
http://www.helmix.at


Helmut Wallner, 15.3.2005
HYPERLINK "http://www.helmix.at/index.htm" \t "_top" INCLUDEPICTURE "http://www.helmix.at/bilder/homejump.gif" \* MERGEFORMATINET


!
"
#
o
p
Э
Ю
ю
я
N
O
Y
х

D
E
L
M
O
Y

Б


Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 
NoIX ключ Запомнить

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru