📄 dk3200_ee_demo.lst
字号:
C51 COMPILER V7.06 DK3200_EE_DEMO 10/13/2004 10:12:17 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE DK3200_EE_DEMO
OBJECT MODULE PLACED IN DK3200_EE_DEMO.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE DK3200_EE_DEMO.C BROWSE DEBUG OBJECTEXTEND
stmt level source
1 /*------------------------------------------------------------------------------
2 DK3200_1_demo.c
3
4 Simple EE Emulation Demo code for uPSD
5
6 06/2002 Ver 0.1 - Initial Version
7
8 Copyright 2002 ST Microelectronics
9 This example demo code is provided as is and has no warranty,
10 implied or otherwise. You are free to use/modify any of the provided
11 code at your own risk in your applications with the expressed limitation
12 of liability (see below) so long as your product using the code contains
13 at least one uPSD products (device).
14
15 LIMITATION OF LIABILITY: NEITHER STMicroelectronics NOR ITS VENDORS OR
16 AGENTS SHALL BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA,
17 INTERRUPTION OF BUSINESS, NOR FOR INDIRECT, SPECIAL, INCIDENTAL OR
18 CONSEQUENTIAL DAMAGES OF ANY KIND WHETHER UNDER THIS AGREEMENT OR
19 OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
20 ------------------------------------------------------------------------------*/
21
22 #pragma optimize(8,size)
23 #pragma SYMBOLS
24 #pragma NOAREGS
25
26
27
28 #include "upsd_hardware.h" // environment hardware specific defines
29 #include "upsd3200.h" // special function register declarations for UPSD
30
31 #include "lcd_io.h" // prototype declarations and defines for uPSD IP drivers
32 #include "upsd_timer.h"
33 #include "eeprom.h"
34
35 #include <stdlib.h>
36
37 xdata PSD_REGS PSD8xx_reg _at_ PSD_REG_ADDR; // Define PSD registers at address "csiop" space
38
39
40
41
42 Initia_MCU()
43 {
44 1 WDKEY = 0x55;
45 1 }
46
47
48 void main (void)
49 {
50 1 unsigned char status;
51 1 BYTE xdata buf[1]; //Buffer that holds data to write
52 1 BYTE xdata tmpbuf[1]; //Buffer which holds data read back from the flash
53 1
54 1 // WDKEY = 0x55; // Turn off the Watch Dog Timer
55 1 tmpbuf[0] = 0; // Initialize the temp buffer
C51 COMPILER V7.06 DK3200_EE_DEMO 10/13/2004 10:12:17 PAGE 2
56 1 buf[0] = 0xAA; // Load the data pattern to write
57 1
58 1 PSD8xx_reg.VM |= 0x80; // enable peripheral I/O mode for LCD display
59 1
60 1 Initia_MCU();
61 1 lcd_init(); // initialize LCD. 8 bits, 2 lines, 5x7 font,
62 1 // no blink, cursor off, clear
63 1
64 1 printfLCD("EEPROM Emulation\n"); //display on LCD
65 1 printfLCD("TEST1");
66 1 delay_2sec();
67 1 printfLCD("TEST1"); //display on LCD
68 1 delay_2sec();
69 1 lcd_clear();
70 1
71 1 Eeprom_Init();
72 1 status = EEPROM_Format(0x0001); // Format one record
73 1
74 1 status = Update_Record(0, &buf); // Write record one with the content in buf[0]
75 1
76 1 printfLCD("Write_Record_0\n"); //display on LCD
77 1 printfLCD("%x\n",buf[0]);
78 1 delay_2sec();
79 1 lcd_clear();
80 1
81 1 Read_Record(0,&tmpbuf); // read the records
82 1
83 1 if (tmpbuf[0] == buf[0]) // Compare the record
84 1 {
85 2 printfLCD("Read & Compare_0\n");
86 2 printfLCD("Compared_OK: %x\n",tmpbuf[0]);
87 2 delay_2sec();
88 2 delay_2sec();
89 2 status = 0;
90 2 // lcd_clear();
91 2 }
92 1 else
93 1 {
94 2 printfLCD("Read & Compare_0\n");
95 2 printfLCD("Miscompared \n");
96 2 delay_2sec();
97 2 lcd_clear();
98 2 status = Get_Sector_Status(SECTOR_0);
99 2 printfLCD("Rec Status: %x\n", status);
100 2 delay_2sec();
101 2 }
102 1 while(1);
103 1 } // End main
104
105
106
C51 COMPILER V7.06 DK3200_EE_DEMO 10/13/2004 10:12:17 PAGE 3
NAME CLASS MSPACE TYPE OFFSET SIZE
==== ===== ====== ==== ====== ====
P1 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0090H 1
P3 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00B0H 1
P4 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00C0H 1
WDKEY. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00AEH 1
UISTA. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00E8H 1
_Update_Record . . . . . . . . . . . . EXTERN CODE PROC ----- -----
IE . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A8H 1
size_t . . . . . . . . . . . . . . . . TYPEDEF ----- U_INT ----- 2
record_entry . . . . . . . . . . . . . * TAG * ----- STRUCT ----- 4
status . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0000H 1
record_data. . . . . . . . . . . . . MEMBER ----- ARRAY 0001H 1
last_record_update . . . . . . . . . MEMBER ----- PTR 0002H 2
IP . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00B8H 1
lcd_clear. . . . . . . . . . . . . . . EXTERN CODE PROC ----- -----
_Read_Record . . . . . . . . . . . . . EXTERN CODE PROC ----- -----
main . . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
status . . . . . . . . . . . . . . . AUTO DATA U_CHAR 0000H 1
buf. . . . . . . . . . . . . . . . . AUTO XDATA ARRAY 0000H 1
tmpbuf . . . . . . . . . . . . . . . AUTO XDATA ARRAY 0001H 1
Initia_MCU . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
Mix_Reg. . . . . . . . . . . . . . . . TYPEDEF XDATA UNION ----- 1
byte . . . . . . . . . . . . . . . . MEMBER ----- CHAR 0000H 1
bits . . . . . . . . . . . . . . . . MEMBER ----- STRUCT 0000H 1
REG_PSD_struct . . . . . . . . . . . . * TAG * ----- STRUCT ----- 256
DATAIN_A . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0000H 1
DATAIN_B . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0001H 1
CONTROL_A. . . . . . . . . . . . . . MEMBER ----- U_CHAR 0002H 1
CONTROL_B. . . . . . . . . . . . . . MEMBER ----- U_CHAR 0003H 1
DATAOUT_A. . . . . . . . . . . . . . MEMBER ----- U_CHAR 0004H 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -