📄 basic_ice.dat
字号:
echo off
Com *--------------------------------------------------------------------------------------
Com * ATMEL Microcontroller Software Support - ROUSSET -
Com *--------------------------------------------------------------------------------------
Com *The software is delivered "AS IS" without warranty or condition of any
Com *kind, either express, implied or statutory. This includes without
Com *limitation any warranty or condition with respect to merchantability or
Com *fitness for any particular purpose, or against the infringements of
Com *intellectual property rights of others.
Com *--------------------------------------------------------------------------------------
Com *File Name : File Basic_ICE.dat
Com *Object : Script file for axd debugger
Com *
Com *1.0 20/Dec/04 JPP : Creation
Com *1.1 24/Feb/05 JPP : Reset
Com *1.2 23/Aug/05 JPP : Change MC_FMR Setting and reset
Com *1.3 23/Oct/05 JPP : Correct Reset
Com *--------------------------------------------------------------------------------------
Com <---- This command is the comment command.
Com Enable the semihosting. If you don't use printf and/or scanf functions, set semihosting_enabled to 0.
Com Define the top of memory to store the buffer for semihosting calls.
Com Needed when working with an ICE Interface and if you use C printf/scanf functions in your code.
Com Disable all vector catch to not have AXD to warn you that a vector exception has been caught.
echo on
spp semihosting_enabled 1
let $top_of_memory 0x00203600
spp vector_catch 0x0
echo off
com Reset chip use setup file for SAM_ICE (0xFFFFFD08 0xFFFFFD00)
Com Watchdog Disable
Com AT91C_BASE_WDTC->WDTC_WDMR= AT91C_SYSC_WDDIS (0xFFFFFD44)
echo on
setmem 0xFFFFFD08 0xA5000011 32
setmem 0xFFFFFD00 0xA5000005 32
setmem 0xFFFFFD44 0x00008000 32
echo off
Com Set Flash Waite sate
Com Single Cycle Access at Up to 30 MHz
Com if MCK = 48,054850 I have 72 Cycle for 1 useconde ( flied MC_FMR->FMCN)
Com A page erase is performed before programming.
Com AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS (0xFFFFFF60);
Com Mask All interrupt pAic->AIC_IDCR = 0xFFFFFFFF (0xFFFFF124);
Com disable peripheral clock Peripheral Clock Disable Register (0xFFFFFC14)
echo on
setmem 0xFFFFFF60 0x00480100 32
setmem 0xFFFFF124 0xffffffff 32
setmem 0xFFFFF128 0xffffffff 32
setmem 0xFFFFFC14 0xffffffff 32
Com Set PLL
Com -1- Enabling the Main Oscillator:
Com *#define AT91C_PMC_MOR ((AT91_REG *) 0xFFFFFC20) (PMC) Main Oscillator Register
Com *#define AT91C_PMC_PLLR ((AT91_REG *) 0xFFFFFC2C) (PMC) PLL Register
Com *#define AT91C_PMC_MCKR ((AT91_REG *) 0xFFFFFC30) (PMC) Master Clock Register
setmem 0xFFFFFC20 0x00000601 32
Com *pPMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x06 <<8) | 0x0000 0600
Com AT91C_CKGR_MOSCEN )); 0x0000 0001
setmem 0xFFFFFC2C 0x00481C0E 32
Com -2- Wait
Com -3- Setting PLL and divider:
Com - div by 14 Fin = 1.3165 =(18,432 / 14)
Com - Mul 72+1: Fout = 96.1097 =(3,6864 *73)
Com for 96 MHz the erroe is 0.11%
Com Field out NOT USED = 0
Com PLLCOUNT pll startup time esrtimate at : 0.844 ms
Com PLLCOUNT 28 = 0.000844 /(1/32768)
Com pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x0E) | 0x0000 000E
Com (AT91C_CKGR_PLLCOUNT & (28<<8)) 0x0000 1C00
Com (AT91C_CKGR_MUL & (72<<16))); 0x0048 0000
Com 0xFFFFFC30 0x0000000 4 32
Com "------------------------------- PLL SET -----------------------"
Com -2- Wait
Com -5- Selection of Master Clock and Processor Clock
Com select the PLL clock divided by 2
Com pPMC->PMC_MCKR = AT91C_PMC_CSS_PLL_CLK | 0x0000 0003
Com AT91C_PMC_PRES_CLK_2 ; 0x0000 0004
setmem 0xFFFFFC30 0x00000007 32
Com "------------------------------- PLL Enable --------------------"
setreg cpsr 0xd3
mem 0x00100000 +0 32 hex
mem 0x0 +0 32 hex
mem 0x00200000 +0 32 hex
Com SET remap if 0x0 if than 0x0
echo on
setmem 0xFFFFFF00 0x01 32
Com Load file
ld BasicMouse.axf
COM setmem 0xFFFFFF00 0x01 32
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -