Firmware Implementation of the project design
7.2. Creating Applications
This chapter describes the Build Mode of µVision3 and is grouped into the following sections:
Create a Project : explains the steps required to setup a simple application and to generate HEX output.
Project Target and File Groups : shows how to create application variants and organized the files that belong to a project.
Tips and Tricks : provides information about the advanced features of the µVision3 Project Manager.
This chapter uses the ARM as target architecture and only explains generic features of the µVision3 IDE. Architecture specific information (like bank switching for 8051) can be found in the Getting Started User's Guide of the related toolchain.
Debugging
This chapter describes the Debug Mode of µVision3 and shows you how to use the user interface to test a sample program. Also discussed are simulation mode and the different options available for program debugging.
You can use µVision3 Debugger to test the applications you develop.
The µVision3 Debugger offers two operating modes that are selected in the Options for Target — Debug dialog.
Use Simulator configures the µVision3 Debugger as software-only product that simulates most features of a microcontroller without actually having target hardware. You can test and debug your embedded application before the hardware is ready. µVision3
external I/O, and timers. The peripheral set is selected when you select a CPU from the device database for your target.
Use Advanced GDI drivers, like the ULINK Debugger to interface to your target hardware. For µVision3 various drivers are available that interface to:
JTAG/OCDS Adapter: which connects to on-chip debugging systems like the ARM Embedded ICE.?
Monitor: that may be integrated with user hardware or is available on many evaluation boards.
Emulator: which connects to the CPU pins of the target hardware?
In-System Debugger: which is part of the user application program and provides basic test functions?
Test Hardware: such as the Infineon Smart Card ROM Monitor RM66P or the Philips SmartMX DBox.
The Status Bar shows the current active debugging tool. In simulation mode, timing statistics are provided.
Simulation
The µVision3 Debugger incorporates a C script language you can use to create Signal Functions. Signal functions let you simulate analog and digital input to the microcontroller. Signal functions run in the background while µVision3 simulates your target program.
The µVision3 simulator simulates the timing and logical behavior of serial communication protocols like UART, I²C, SPI, and CAN. But µVision3 does not simulate the I/O port toggling of the physical communication pins on the I/O port.
To provide fast simulation speed and optimum access to communication peripherals, the logic behavior of communication peripherals is reflected in virtual registers that are listed with the DIR VTREG command.
This has the benefit that you can easily write debug functions that stimulate complex peripherals.
The chapter contains several Signal function temples that you may use to simulate:
• Digital Input
• Push Button
• Interrupt Signal
• Impulse Patterns
• Analog Input
• Square Wave Signal
• Saw Tooth Signal
• Sine Wave
• Noise Signal
• Signal Combination
• UART Communication
• CAN Communication
• I²C Communication
• SPI Communication 7.3. Flash Programming
µVision3 integrates Flash Programming Utilities in the project environment.
All configurations are saved in context with your current project.
You may use external command-line driven utilities (usually provided by the chip vendor) or the Keil ULINK USB-JTAG Adapter. The Flash Programming Utilities are configured under
Project — Options — Utilities.
Flash Programming may be started from the Flash Menu or before starting the µVision3 Debugger when you enable Project — Options — Utilities — Update Target before Debugging.
For more information refer to the following topics:
Configure Flash Menu: configures the Flash Menu for using an external command-line based utility or the Keil ULINK USB-JTAG Adapter.
ULink Configuration: explains the configuration settings for the Keil ULINK USB-JTAG Adapter.
Pre-Download Scripts: allows to you program multiple applications or configure the BUS system which is required for ULINK when you program off-chip Flash devices.
Flash Algorithms: explains you how to create own Flash Program Algorithms for the Keil ULINK USB-JTAG Adapter.
HEX File Flash Download: explains how to program existing HEX files.
The screenshot of µ3vision is as shown in figure 7.1
Fig 7.1 screenshot of keil µ3vision Flash Magic
The screenshot of FLASH MAGIC is as shown in figure 7.2
Fig 7.2 screenshot of flashmagic 7.4.CODE:
/* Voting mechain using Finger print; */
#include <lpc214x.h>
#include "serial.h"
#include"lcd.h"
#define sw1 0x00100000
#define sw2 0x00020000
#define sw3 0x00040000
#define sw4 0x00080000
unsigned char i=0,fp[20],j=0,str[4],s=0,rec,dummy;
unsignedchar
enroll[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X01,0X00,0X05};
unsignedchar
generate_ch[13]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X04,0x02,0X01,0X00,0X 08};
unsignedchar store[11]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X06,0X06,0X01};
unsignedchar
identify[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X11,0X00,0X15};
unsigned char b1=0,b2=0,i1=0,i2=0,id=0,id1=0,id2=0,cnt=0,eeprom_add=0,aa,n=0;
void clearfp(void);
void convert (unsigned char temp_value);
unsignedchar part_A=0,part_B=0,part_C=0,part_D=0,check=0,count=0,enroll_check=0,en_byte;
void long_delay (void );
main program
---*/
int main (void ) {
lcd_init();
again:
lcd_cmd(0x01,0);
delay(1000);
message(0," welcome ");
//lcd_cmd(0x01,0);
lcd_cmd(0xc0,0);
message(0,"EVM with FP");
delay(1000);
i=0;
while(1) {
/******* Enrolling your ID *********************/
{
else
else
}
while(count<en_byte)
i1=i1*10;
poll:
}
void convert(unsigned char temp_value)