Proteus 7.10 支持ARM Cortex-M3/LM3S*

 最新特性:

  • Proteus VSM for ARM Cortex-M3/LM3S* - Simulation support for this popular microcontroller family

    ARM Cortex-M3/LM3S*库模块:

    LIBRARY: STELLARIS.LIB

    MODELS: cm3.dll ,cm3_lm.dll ,STELLARIS.LML

    在proteus 7.7 or 7.8中可用,ITFMOD.MDF中增加一行:

    CM3    : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VDD,V-=GND,TRISE=1n,TFALL=1n


    可以搜到的Microprocessor设备名:

    LM3S300,LM3S301,LM3S308,LM3S310,LM3S315,LM3S316,LM3S317,LM3S328.

    测试代码(点亮LED):

    ;----===----ARM Cortex-M3/LM3S* LED汇编测试(TUMB-2指令集)
    ;----===----By G-Spider @2012
    
        AREA ARMcm3led,CODE, READONLY
    SYSCTL  equ 0x400fe000          ;base
    RCGC2   equ 0x108               ;offset
    GPIOD   equ 0x40007000          ;base
    AFSEL   equ 0x420               ;offset
    DIR     equ 0x400               ;offset
    DATA    equ 0x000               ;offset
    
        ENTRY
    Start
    ;--------------------------------
    ;enable GPIOA,GPIOB,GPIOC,GPIOD,GPIOE clocking for changing pin functions
        ldr r0,=(SYSCTL+RCGC2)
        mov r1,#0x1f
        str r1,[r0]                 ;SYSCTL->RCGC2 |= 0x0000001F
    ;--------------------------------
    ;all pins are GPIO
        ldr r2,=(GPIOD+AFSEL)
        mov r0,#0
        str r0,[r2]                 ;GPIOD->AFSEL = 0x00
    ;--------------------------------
    ;pin.0 is output
        ldr r1,=(GPIOD+DIR)
        mov r0,#1
        str r0,[r1]                 ;GPIOD->DIR = 0x01
    ;--------------------------------
        ldr r2,=(GPIOD+DATA)
        mov r0,#0
        str r0,[r2]                 ;GPIOD->DATA = 0
    ;--------------------------------
    loop
        mov r0,#1
        str r0,[r2]                 ;GPIOD->DATA = 1
        
        b loop
    
        END
    


    编译:

    @echo off
    
    set path=D:\Keil\ARM\BIN40;%path%
    
    set FILE=test
    
    
    armasm.exe  --cpu=Cortex-M3 -g -o %FILE%.o %FILE%.s
    
    armlink.exe  -o %FILE%.axf  %FILE%.o
     
    
    fromelf.exe --i32 --base 0x00 -o %FILE%.hex %FILE%.axf
    
    fromelf.exe -v -a -c -d -e -g -r -s -t -y -z  -o %FILE%.lst %FILE%.axf
    
    
    pause


     

    效果与下面一致(以下图片如果看不全,另存为,可看全):

     Proteus 7.10 支持ARM Cortex-M3/LM3S*_第1张图片

     

     

     

     

     

  • 你可能感兴趣的:(汇编,File,测试,Path,library,output)