⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fireplace.lst

📁 使用三星芯片的控制程序,可供三星8位MCU初学者参考!
💻 LST
📖 第 1 页 / 共 5 页
字号:
 -------  FILE NO #1 : fireplace.l -------
Mon Aug 14 15:13:07 2006


     SAM8 Assembler for Reduced Instruction  Ver. 2.15T(Win32)
         Copyright (c) 2003 Samsung Electronics Co.

    --------------------------------------------------------------------

                       Source File Name : fireplace.src
                       Output File Name : fireplace.o
                       List File Name   : fireplace.l


    1                    ;*******************************************************
    2                    ;Project:   fireplace     
    3                    ;Designer:       
    4                    ;Subject:        
    5                    ;File name:      fireplace.src
    6                    ;MCU name:       S3C9454
    7                    ;MCU Clock:      3.2MHz
    8                    ;Original Date:  
    9                    ;last ver  date: 
   10                    ;Finished Date:  
   11                    ;*******************************************************
   12                    	.include	"define.mac"
   13                    .include	"S3c9454.reg"
   14                    ; 86C4504.REG Copyright (c) 1996 SAMSUNG ELECTRONICS CO.
   15                    
   16                    	.list   on
   17                    
   18                    ;;;;;;;;;define ram part;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   19                    ;general_ram:00h-0bfh
   20                    ;work_register:0c0h-0cfh
   21                       
   22         00 00      serial_data       equ  00h      ;74ls164 data 
   23                        
   24         00 01      key_press_time1   equ  01h
   25         00 02      key_press_time2   equ  02h
   26                    
   27         00 03      key_press_time    equ  03h     ;delay time counter 20ms
   28         00 04      key_hold_flag     equ  04h      ;if press first #01 else #00
   29         00 05      key_hold_down     equ  05h      ;if key already hold down       
   30         00 06      key_value         equ  06h
   31         00 07      key_value_store   equ  07H
   32         00 08      key_add_flag      equ  08h
   33         00 0A      key_press_down    equ  0ah
   34         00 0B      key_realease_flag equ  0bh
   35         00 0C      key_release       equ  0ch
   36                    
   37                    
   38         00 0D      sound_backup      equ  0dh
   39         00 0E      lamp_backup       equ  0eh
   40         00 10      fire_status       equ  10H
   41         00 11      temp_status       equ  11h
   42         00 12      lamp_status       equ  12h
   43         00 13      sound_status      equ  13h
   44         00 14      fire_value        equ  14h
   45         00 15      temp_value        equ  15H
   46                    
   47                    ;**********************************************************
   48         00 12      lamp_status_dress       equ   12H
   49         00 13      sound_status_dress      equ   13H
   50         00 14      fire_value_dress        equ   14H
   51         00 15      temp_value_dress        equ   15H
   52                    
   53         00 EF      I2C_SDA0   equ   0efH   ;SDA=P2.4=0  #1110 1111B
   54         00 10      I2C_SDA1   equ   10H    ;SDA=P2.4=1  #0001 0000B
   55         00 DF      I2C_SCL0   equ   0dfH   ;SCL=P2.5=0  #1101 1111B
   56         00 20      I2C_SCL1   equ   20H    ;SCL=P2.5=1  #0010 0000B
   57         00 E2      I2C_PORT   equ   P2
   58                    ;**********************************************************
   59         00 16      I2C_ack_flag    equ  16h
   60         00 17      I2C_wrdata      equ  17h
   61         00 18      I2C_rddata      equ  18h
   62         00 19      I2C_data        equ  19h
   63         00 1A      I2C_dress       equ  1ah
   64                    ;***********************************************
   65         00 1B      led_display_flag        equ  1bh        ;if led display #01H else #00H
   66         00 1C      led_15s_time1           equ  1ch           ;use to count led_sleep_time
   67         00 1D      led_15s_time2           equ  1dh
   68                    
   69                    
   70         00 20      motor_value             equ  20h
   71         00 21      motor_value_temp        equ  21h
   72                    
   73         00 22      ad_hdata                equ  22h
   74         00 23      ad_ldata                equ  23h
   75                    
   76         00 24      beep_flag               equ  24h
   77                    
   78         00 25      common_counter          equ  25h
   79         00 26      common_flag             equ  26h
   80         00 27      motor_delay_time        equ  27h
   81         00 28      beep_counter            equ  28h
   82                    
   83         00 29      ad_hdata_back           equ  29h
   84         00 2A      ad_hdata_1              equ  2ah
   85         00 2B      ad_hdata_2              equ  2bh
   86         00 2C      ad_hdata_3              equ  2ch
   87         00 2D      ad_hdata_4              equ  2dh
   88         00 2E      ad_hdata_5              equ  2eh
   89                    
   90         00 61      ad_hdata_a              equ  61h
   91         00 62      ad_hdata_b              equ  62h
   92         00 63      ad_hdata_temp           equ  63h
   93         00 64      ad_comp_cnt             equ  64h
   94                    
   95         00 65      AD_convert_time         equ  65h
   96         00 66      AD_convert_time1        equ  66h
   97                    
   98         00 30      remote_pulse_time       equ  30h        
   99         00 31      remote_flag             equ  31h
  100         00 32      remote_bit_num          equ  32h
  101         00 33      remote_byte_num         equ  33h
  102         00 34      remote_data             equ  34h
  103         00 35      receive_end_flag        equ  35h
  104         00 40      remote_byte_buf0        equ  40h
  105         00 41      remote_byte_buf1        equ  41h
  106         00 42      remote_byte_buf2        equ  42h
  107         00 43      remote_byte_buf3        equ  43h
  108                    
  109         00 50      remote_repeat_start     equ  50h
  110         00 51      remote_repeat_time      equ  51h
  111         00 52      remote_again            equ  52h
  112         00 53      remote_value            equ  53h
  113         00 54      remote_repeat_flag      equ  54h
  114                    
  115         00 55      temp_sensor             equ  55h
  116         00 56      not_sensor_counter1     equ  56h
  117         00 57      not_sensor_counter2     equ  57h
  118                    
  119                    
  120         00 58      temp                    equ  58h
  121         00 59      holdkey_timeover        equ  59h
  122                    
  123                    ;key_first_delay         equ  5ah
  124                    ;;;;;;;;;define mac part;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  125                    ;************initial stack poiter********************
  126                    ;this marco initials the system clock
  127                    ;****************************************************
  128                    init_clock_sp:		.macro
  129                            
  130                            LD      CLKCON,#18H             ;CPU clock frequency = fxx
  131                    
  132                            
  133                    	LD	SP,#0c0h                ;00H-C0H
  134                    	
  135                            .endm
  136                    
  137                    ;************initial ports macro*********************
  138                    ;this macro initial P0-P2
  139                    ;include use the port for I/O or special funtion
  140                    ;if the port need pull up
  141                    
  142                    ;Port 0 Control Register:p0conl/p0conh
  143                    
  144                    ;0 0 = Schmitt trigger input
  145                    ;0 1 = Schmitt trigger input; pull-up enable
  146                    ;1 0 = Push-pull output
  147                    ;1 1 = A/D converter input (ADC3); Schmitt trigger input off
  148                    
  149                    init_port:		.macro
  150                    
  151                    	;ld      p0conl,#10101001b       ;p0.0 uart input,other_output
  152                            ld      p0conl,#10110100b
  153                         
  154                            ld      p0conh,#10101010b
  155                            
  156                            ld      P0,#00h
  157                            
  158                            ld      p1,#0ffh         
  159                                
  160                            ld      p0pnd,#00001000b        ;INT1 falling edge interrupt enable
  161                                                    
  162                    	ld      p1con,#00001010b        ;clock_circuit,reset_circuit
  163                    	
  164                    	ld      p2conl,#10101010b       ;led_scan_output: p2.0-3 output 
  165                    	ld      p2conh,#01001111b       ;led_scan_output: p2.0-3 output 
  166                    	
  167                    	ld      p2,#0ffH
  168                    	
  169                            .endm
  170                    
  171                    ;***************initial timers**************
  172                    ;this marco is used to initial all timers
  173                    ;including base timer、timer0 、watch timer
  174                    ;****************************************************
  175                    
  176                    init_timer:		.macro
  177                    
  178                    	;initial timer0
  179                    	;LD	T0CON,#10001000b        ;timers mode  8MHz
  180                    	;LD	T0CON,#01001010b	;Timer0 clock = fxx/8
  181                    	LD	T0CON,#10001010b        ;Timer0 interrupt enable
  182                     
  183                    	;LD	T0DATA,#200
  184                    	LD	T0DATA,#38								
  185                    	.endm
  186                    	
  187                    ;****************************************************	
  188                    enable_base_time:        .macro
  189                    	
  190                    	;initial base timer
  191                    	LD	BTCON,#0b2H		;enable watchdog timer ,Fxx/4096
  192                    					;Basic timer input clock=fxx/16
  193                    	.endm				
  194                            					
  195                    ;****************************************************	
  196                    disable_base_time:        .macro
  197                    	
  198                    	;initial base timer
  199                    	LD	BTCON,#0a2H		;disable watchdog timer ,Fxx/4096
  200                    					;Basic timer input clock=fxx/16
  201                    	.endm	
  202                    
  203                    			       					
  204                    
  205                    
  206  0000   01 C3              vector  0000H,int_vec         ;interrupt vector
  207                            
  208  003C                       .org    003cH
  209                            
  210  003C   00                 db      00H
  211  003D   00                 db      00H
  212                            ;db      00110000B                    ;DISABLE LVR=3.9V
  213  003E   B0                 db      10110000B
  214  003F   03                 db      03H                     ;3.2M RC
  215                    	
  216  0100              	.org	0100H
  217                    	
  218  0100              reset:	
  219  0100   8F                 DI
  220                            
  221         <01>               init_clock_sp
  222                            
  223  0101   E6 D4 18           LD      CLKCON,#18H             ;CPU clock frequency = fxx
  224                    
  225                            
  226  0104   E6 D9 C0   	LD	SP,#0c0h                ;00H-C0H
  227                    	
  228         <01>               .endm
  229                            
  230         <01>               init_timer
  231                    
  232                    	;initial timer0
  233                    	;LD	T0CON,#10001000b        ;timers mode  8MHz
  234                    	;LD	T0CON,#01001010b	;Timer0 clock = fxx/8
  235  0107   E6 D2 8A   	LD	T0CON,#10001010b        ;Timer0 interrupt enable
  236                     
  237                    	;LD	T0DATA,#200
  238  010A   E6 D1 26   	LD	T0DATA,#38								
  239         <01>       	.endm

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -