Keil Getting Start

������ҧ��ਤ(Creating Project)
�բ�鹵͹�ѧ���

  • ���ҧ��ਤ���������͡��Դ CPU
  • ���ҧsource file �����������������������������ਤ
  • ��˹���Ңͧstartup code ���������������������ਤ
  • ���͡option �ͧ target hardware
  • Build project ��� ���ҧ HEX-file

���ҧ��ਤ���������͡��Դ CPU (Staring uVision and Creating a Project)

㹡�����ҧ��ਤ���� ���͡�ҡ���� Project - New Project..
�������ਤ��÷����¡����ͧ�͡�ҡ�ѹ ���������ö���ҧ��ͧ������ҡ icon Create New Project
��������ͧ (Project1)
��ѧ�ҡ������͡��ͧ������Ǥ��¾���������ਤŧ� �� Project1 ������ Save ����� uVision2 ������ҧ��ਤ������ Project1.UV2 ��� ���㹻�Сͺ���� default target ��Ъ��� file group����������ö�٪����������ҹ����ҡ Project Window - Files.
�͹���л�ҡ� dialog Select Device For Target ����� ��������������͡������� Project-Select Device For Target �������dialog ���������������͡��Դ�ͧ CPU ����� 㹷�������͡�� Philips 89C51RD2 ���ǡ� OK
���ҧsource file �����������������������������ਤ(Creating New Source Files)
���ҧ new source file �ҡ���� File- New ��觡������ྨ����������Ҿ����������ͧ���ŧ� ��ѧ�ҡ��鹷ӡ��૿����� �����͡ File- Save As ���Ǿ������������ 㹷�����ժ����� main.C ��ѧ�ҡ��� uVision �зӡ�� highlight ��� syntax ���� C
��������ҧsource file ����������ҡ�зӡ�� add ����������ਤ�¡�ä��顢�ҷ��ྨ Project Workspace (��������������͡ Project Window - File)���͡��� Add Files to Group
���͡��� main.c ��������¹��� ���ǡ����� Add
��˹���Ңͧstartup code ���������������������ਤ(Adding and Configuring the Startup Code)

��� Starup.A51 ��� startup code ����Ѻ CPU ��С�� 8051 ��˹�ҷ�������� data menory �Թ������ hardware ���reentrant stack pointors �͡�ҡ��� 8051 �ҧ��蹵�ͧ��� �Թ�������鴷��������������Ѻ����͡Ẻ�Ҵ���� ¡������ҧ�� Philips 8051RD+ �� on chip xdata RAM ���ж١ enable �� startup code �ѧ��鹨֧���copy ��� Starup.A51������ਤ���� �¡�����ҧ Group file �������������Ѻ CPU configuration ��੾�� ���͡ Project - Targets,Groups,Files...

���͡page Groups/Add Files ��������Group ŧ�(System Files) ������ Add
�������ǡ�ӡ�� add ���Starup.A51ŧ���ͧSystem Files�ա��˹�� �����͡�����ͧSystem Files ��ԡ������ Add Files to Group...
���͡��� Starup.A51�ҡ��ͧ C:\KEIL\C51\LIB �������ǡ����� Add ��� Starup.A51������������System Files
���͡option �ͧ target hardware(Setting Tool Options for Target)
uVision �������繤���˹� Option �ͧ target hardware ���ͧ�ҡ dialog Option for Target .��绪��� Target ��ҨС�˹�����������������ѹ��Ѻtarget hardware�����ػ�ó캹�Ծ ŧ� �ѧ�ٻ
���ҧ�ʴ� Option �ͧ Target dislog
Dialog Item Description
Xtal ��˹��ѭ�ҳ���ԡҢͧCPU �դ�����ǡѺ������� XTAL �����
Memory Model ��˹� memory model ����Ѻ C51 ��һ��Ԩ��� SMALL
Allocate On-Chip Use multiple DPTRregisters

 

��˹������ on-chip component ����·���� �ж١ enable Startup code �������� on-chip xdata RAM(XRAM) ��Ҥ�÷��� enable �����Ҷ֧ XRAM ���� Startup code.A51����
Off-chip... Memory �繷���˹���鹷��ͧexternal Memory �������ͧ target hardware
Code Banking ��˹�����������ͧ code ��� xdata banking
Build project ��� ���ҧ HEX-file(Building Project and Creating a HEX Files)
��ѧ�ҡ�ӵ����鹵͹��ҹ���������� ����ҡ��繢�鹵͹�ش���¤�� ����ŧ�ҡ source file ��������¹������� HEX File������Ŵŧ� Micro controller �����价�� Project-Option for Target-Output �������͡ Create HEX FILE
�ҡ�������ԡ����ͤ͹ Build Target
���� Project -Build Target
uVision ���ʴ���ͼԴ��Ҵ��Т�ͤ�����͹�����ҷ�Һ�˹�ҵ�ҧ Output-Window-Build
����� Double click ����ͤ�����С��ⴴ��ѧsource file ���Դ��Ҵ���
���ӡ������������١��ͧ(㹷������ѧ 1 ������ǧ���) ���Ǥ�ԡ����ͤ͹ Build Target �ա����˹�� ���ǹ�� uVision ��§ҹ�������բ�ͼԴ��Ҵ
���.HEX �������繪������ǡѺ������ਤ�������������������ͧ���ǡѹ ����������ö����������Ŵ��� Micro controller ��ѹ��