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

📄 cstartup_sam7.lst

📁 Real working watchdog
💻 LST
字号:
   1              		.file	"Cstartup_SAM7.c"   9              	.Ltext0:  10              		.align	2  11              		.global	AT91F_LowLevelInit  13              	AT91F_LowLevelInit:  14              	.LFB2:  15              		.file 1 "init/Cstartup_SAM7.c"   1:init/Cstartup_SAM7.c **** //*----------------------------------------------------------------------------
   2:init/Cstartup_SAM7.c **** //*         ATMEL Microcontroller Software Support  -  ROUSSET  -
   3:init/Cstartup_SAM7.c **** //*----------------------------------------------------------------------------
   4:init/Cstartup_SAM7.c **** //* The software is delivered "AS IS" without warranty or condition of any
   5:init/Cstartup_SAM7.c **** //* kind, either express, implied or statutory. This includes without
   6:init/Cstartup_SAM7.c **** //* limitation any warranty or condition with respect to merchantability or
   7:init/Cstartup_SAM7.c **** //* fitness for any particular purpose, or against the infringements of
   8:init/Cstartup_SAM7.c **** //* intellectual property rights of others.
   9:init/Cstartup_SAM7.c **** //*----------------------------------------------------------------------------
  10:init/Cstartup_SAM7.c **** //* File Name           : Cstartup_SAM7.c
  11:init/Cstartup_SAM7.c **** //* Object              : Low level initializations written in C for Tools
  12:init/Cstartup_SAM7.c **** //* Creation            : 12/Jun/04
  13:init/Cstartup_SAM7.c **** //* 1.2   28/Feb/05 JPP : LIB change AT91C_WDTC_WDDIS & PLL
  14:init/Cstartup_SAM7.c **** //* 1.3   21/Mar/05 JPP : Change PLL Wait time
  15:init/Cstartup_SAM7.c **** //* 1.4   21/Aug/05 JPP : Change MC_FMR Setting
  16:init/Cstartup_SAM7.c **** //* 1.5   29/Aug/05 JPP : Change PLL error
  17:init/Cstartup_SAM7.c **** //*----------------------------------------------------------------------------
  18:init/Cstartup_SAM7.c **** 
  19:init/Cstartup_SAM7.c **** // Include the board file description
  20:init/Cstartup_SAM7.c **** #include "../include/include.h"
  21:init/Cstartup_SAM7.c **** 
  22:init/Cstartup_SAM7.c **** // The following functions must be write in ARM mode this function called directly
  23:init/Cstartup_SAM7.c **** // by exception vector
  24:init/Cstartup_SAM7.c **** extern void AT91F_Spurious_handler(void);
  25:init/Cstartup_SAM7.c **** extern void AT91F_Default_IRQ_handler(void);
  26:init/Cstartup_SAM7.c **** extern void AT91F_Default_FIQ_handler(void);
  27:init/Cstartup_SAM7.c **** 
  28:init/Cstartup_SAM7.c **** //*----------------------------------------------------------------------------
  29:init/Cstartup_SAM7.c **** //* \fn    AT91F_LowLevelInit
  30:init/Cstartup_SAM7.c **** //* \brief This function performs very low level HW initialization
  31:init/Cstartup_SAM7.c **** //*        this function can be use a Stack, depending the compilation
  32:init/Cstartup_SAM7.c **** //*        optimization mode
  33:init/Cstartup_SAM7.c **** //*----------------------------------------------------------------------------
  34:init/Cstartup_SAM7.c **** void AT91F_LowLevelInit( void)
  35:init/Cstartup_SAM7.c **** {
  16              		.loc 1 35 0  17              		@ Function supports interworking.  18              		@ args = 0, pretend = 0, frame = 8  19              		@ frame_needed = 1, uses_anonymous_args = 0  20 0000 0DC0A0E1 		mov	ip, sp  21              	.LCFI0:  22 0004 00D82DE9 		stmfd	sp!, {fp, ip, lr, pc}  23              	.LCFI1:  24 0008 04B04CE2 		sub	fp, ip, #4  25              	.LCFI2:  26 000c 08D04DE2 		sub	sp, sp, #8  27              	.LCFI3:  36:init/Cstartup_SAM7.c ****  int            i;
  37:init/Cstartup_SAM7.c ****  AT91PS_PMC     pPMC = AT91C_BASE_PMC;
  28              		.loc 1 37 0  29 0010 0231A0E3 		mov	r3, #-2147483648  30 0014 C33AA0E1 		mov	r3, r3, asr #21  31 0018 10300BE5 		str	r3, [fp, #-16]  38:init/Cstartup_SAM7.c ****     //* Set Flash Waite sate
  39:init/Cstartup_SAM7.c **** 	//  Single Cycle Access at Up to 30 MHz, or 40
  40:init/Cstartup_SAM7.c **** 	    AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS ;
  32              		.loc 1 40 0  33 001c FF20E0E3 		mvn	r2, #255  34 0020 013CA0E3 		mov	r3, #256  35 0024 603082E5 		str	r3, [r2, #96]  41:init/Cstartup_SAM7.c **** 
  42:init/Cstartup_SAM7.c ****     //* Watchdog Disable
  43:init/Cstartup_SAM7.c ****        // AT91C_BASE_WDTC->WDTC_WDMR= AT91C_WDTC_WDDIS;
  44:init/Cstartup_SAM7.c **** 
  45:init/Cstartup_SAM7.c **** 	//* Set MCK at 47 923 200
  46:init/Cstartup_SAM7.c ****     // 1 Enabling the Main Oscillator:
  47:init/Cstartup_SAM7.c ****         // SCK = 1/32768 = 30.51 uSecond
  48:init/Cstartup_SAM7.c ****     	// Start up time = 8 * 6 / SCK = 56 * 30.51 = 1,46484375 ms
  49:init/Cstartup_SAM7.c ****        //// mt pPMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x06 <<8) | AT91C_CKGR_MOSCEN ));
  50:init/Cstartup_SAM7.c **** 	   pPMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x06 <<8) ) | AT91C_CKGR_MOSCEN );
  36              		.loc 1 50 0  37 0028 10201BE5 		ldr	r2, [fp, #-16]  38 002c 063CA0E3 		mov	r3, #1536  39 0030 013083E2 		add	r3, r3, #1  40 0034 203082E5 		str	r3, [r2, #32]  41              	.L2:  51:init/Cstartup_SAM7.c ****         // Wait the startup time
  52:init/Cstartup_SAM7.c ****         while(!(pPMC->PMC_SR & AT91C_PMC_MOSCS));
  42              		.loc 1 52 0  43 0038 10301BE5 		ldr	r3, [fp, #-16]  44 003c 683093E5 		ldr	r3, [r3, #104]  45 0040 013003E2 		and	r3, r3, #1  46 0044 000053E3 		cmp	r3, #0  47 0048 0C00000A 		beq	.L2  53:init/Cstartup_SAM7.c **** 	// 2 Checking the Main Oscillator Frequency (Optional)
  54:init/Cstartup_SAM7.c **** 	// 3 Setting PLL and divider:
  55:init/Cstartup_SAM7.c **** 		// - div by 14 Fin = 1.3165 =(18,432 / 14)
  56:init/Cstartup_SAM7.c **** 		// - Mul 72+1: Fout =	96.1097 =(3,6864 *73)
  57:init/Cstartup_SAM7.c **** 		// for 96 MHz the erroe is 0.11%
  58:init/Cstartup_SAM7.c **** 		// Field out NOT USED = 0
  59:init/Cstartup_SAM7.c **** 		// PLLCOUNT pll startup time estimate at : 0.844 ms
  60:init/Cstartup_SAM7.c **** 		// PLLCOUNT 28 = 0.000844 /(1/32768)
  61:init/Cstartup_SAM7.c ****        pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 14 ) |
  48              		.loc 1 61 0  49 004c 10201BE5 		ldr	r2, [fp, #-16]  50 0050 1237A0E3 		mov	r3, #4718592  51 0054 073B83E2 		add	r3, r3, #7168  52 0058 0E3083E2 		add	r3, r3, #14  53 005c 2C3082E5 		str	r3, [r2, #44]  54              	.L4:  62:init/Cstartup_SAM7.c ****                          (AT91C_CKGR_PLLCOUNT & (28<<8)) |
  63:init/Cstartup_SAM7.c ****                          (AT91C_CKGR_MUL & (72<<16)));
  64:init/Cstartup_SAM7.c **** 
  65:init/Cstartup_SAM7.c **** 
  66:init/Cstartup_SAM7.c ****         // Wait the startup time
  67:init/Cstartup_SAM7.c ****         while(!(pPMC->PMC_SR & AT91C_PMC_LOCK));
  55              		.loc 1 67 0  56 0060 10301BE5 		ldr	r3, [fp, #-16]  57 0064 683093E5 		ldr	r3, [r3, #104]  58 0068 2331A0E1 		mov	r3, r3, lsr #2  59 006c 013003E2 		and	r3, r3, #1  60 0070 000053E3 		cmp	r3, #0  61 0074 1600000A 		beq	.L4  62              	.L5:  68:init/Cstartup_SAM7.c ****         while(!(pPMC->PMC_SR & AT91C_PMC_MCKRDY));
  63              		.loc 1 68 0  64 0078 10301BE5 		ldr	r3, [fp, #-16]  65 007c 683093E5 		ldr	r3, [r3, #104]  66 0080 A331A0E1 		mov	r3, r3, lsr #3  67 0084 013003E2 		and	r3, r3, #1  68 0088 000053E3 		cmp	r3, #0  69 008c 1C00000A 		beq	.L5  69:init/Cstartup_SAM7.c ****  	// 4. Selection of Master Clock and Processor Clock
  70:init/Cstartup_SAM7.c ****  	// select the PLL clock divided by 2
  71:init/Cstartup_SAM7.c ****  	    pPMC->PMC_MCKR =  AT91C_PMC_PRES_CLK_2 ;
  70              		.loc 1 71 0  71 0090 10201BE5 		ldr	r2, [fp, #-16]  72 0094 0430A0E3 		mov	r3, #4  73 0098 303082E5 		str	r3, [r2, #48]  74              	.L7:  72:init/Cstartup_SAM7.c ****  	    while(!(pPMC->PMC_SR & AT91C_PMC_MCKRDY));
  75              		.loc 1 72 0  76 009c 10301BE5 		ldr	r3, [fp, #-16]  77 00a0 683093E5 		ldr	r3, [r3, #104]  78 00a4 A331A0E1 		mov	r3, r3, lsr #3  79 00a8 013003E2 		and	r3, r3, #1  80 00ac 000053E3 		cmp	r3, #0  81 00b0 2500000A 		beq	.L7  73:init/Cstartup_SAM7.c **** 
  74:init/Cstartup_SAM7.c ****  	    pPMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK  ;
  82              		.loc 1 74 0  83 00b4 10301BE5 		ldr	r3, [fp, #-16]  84 00b8 303093E5 		ldr	r3, [r3, #48]  85 00bc 032083E3 		orr	r2, r3, #3  86 00c0 10301BE5 		ldr	r3, [fp, #-16]  87 00c4 302083E5 		str	r2, [r3, #48]  88              	.L9:  75:init/Cstartup_SAM7.c ****  	    while(!(pPMC->PMC_SR & AT91C_PMC_MCKRDY));
  89              		.loc 1 75 0  90 00c8 10301BE5 		ldr	r3, [fp, #-16]  91 00cc 683093E5 		ldr	r3, [r3, #104]  92 00d0 A331A0E1 		mov	r3, r3, lsr #3  93 00d4 013003E2 		and	r3, r3, #1  94 00d8 000053E3 		cmp	r3, #0  95 00dc 3000000A 		beq	.L9  76:init/Cstartup_SAM7.c **** 
  77:init/Cstartup_SAM7.c **** 	// Set up the default interrupts handler vectors
  78:init/Cstartup_SAM7.c **** 	AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler ;
  96              		.loc 1 78 0  97 00e0 0231A0E3 		mov	r3, #-2147483648  98 00e4 C339A0E1 		mov	r3, r3, asr #19  99 00e8 68209FE5 		ldr	r2, .L15 100 00ec 802083E5 		str	r2, [r3, #128]  79:init/Cstartup_SAM7.c **** 	for (i=1;i < 31; i++)
 101              		.loc 1 79 0 102 00f0 0130A0E3 		mov	r3, #1 103 00f4 14300BE5 		str	r3, [fp, #-20] 104 00f8 4A0000EA 		b	.L11 105              	.L12:  80:init/Cstartup_SAM7.c **** 	{
  81:init/Cstartup_SAM7.c **** 	    AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler ;
 106              		.loc 1 81 0 107 00fc 0221A0E3 		mov	r2, #-2147483648 108 0100 C229A0E1 		mov	r2, r2, asr #19 109 0104 14001BE5 		ldr	r0, [fp, #-20] 110 0108 4C309FE5 		ldr	r3, .L15+4 111 010c 03C0A0E1 		mov	ip, r3 112 0110 8010A0E3 		mov	r1, #128 113 0114 0031A0E1 		mov	r3, r0, asl #2 114 0118 023083E0 		add	r3, r3, r2 115 011c 013083E0 		add	r3, r3, r1 116 0120 00C083E5 		str	ip, [r3, #0] 117              		.loc 1 79 0 118 0124 14301BE5 		ldr	r3, [fp, #-20] 119 0128 013083E2 		add	r3, r3, #1 120 012c 14300BE5 		str	r3, [fp, #-20] 121              	.L11: 122 0130 14301BE5 		ldr	r3, [fp, #-20] 123 0134 1E0053E3 		cmp	r3, #30 124 0138 3D0000DA 		ble	.L12  82:init/Cstartup_SAM7.c **** 	}
  83:init/Cstartup_SAM7.c **** 	AT91C_BASE_AIC->AIC_SPU  = (int) AT91F_Spurious_handler ;
 125              		.loc 1 83 0 126 013c 0231A0E3 		mov	r3, #-2147483648 127 0140 C339A0E1 		mov	r3, r3, asr #19 128 0144 14209FE5 		ldr	r2, .L15+8 129 0148 342183E5 		str	r2, [r3, #308]  84:init/Cstartup_SAM7.c **** 
  85:init/Cstartup_SAM7.c **** }
 130              		.loc 1 85 0 131 014c 0CD04BE2 		sub	sp, fp, #12 132 0150 00689DE8 		ldmfd	sp, {fp, sp, lr} 133 0154 1EFF2FE1 		bx	lr 134              	.L16: 135              		.align	2 136              	.L15: 137 0158 00000000 		.word	AT91F_Default_FIQ_handler 138 015c 00000000 		.word	AT91F_Default_IRQ_handler 139 0160 00000000 		.word	AT91F_Spurious_handler 140              	.LFE2: 184              	.Letext0:DEFINED SYMBOLS                            *ABS*:00000000 Cstartup_SAM7.c/cygdrive/c/DOCUME~1/Panini/LOCALS~1/Temp/ccRM6zbd.s:13     .text:00000000 AT91F_LowLevelInit/cygdrive/c/DOCUME~1/Panini/LOCALS~1/Temp/ccRM6zbd.s:20     .text:00000000 $a/cygdrive/c/DOCUME~1/Panini/LOCALS~1/Temp/ccRM6zbd.s:137    .text:00000158 $dUNDEFINED SYMBOLSAT91F_Default_FIQ_handlerAT91F_Default_IRQ_handlerAT91F_Spurious_handler

⌨️ 快捷键说明

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