我用的芯片是LPC2119,其中要用到P0.5口输出方波,我写入以下代码可是P0.5引脚保持低电位,不知道代码那里错了?
INCLUDE LPC2294.INC ;-------------------------------------------- AREA TEST,CODE,READONLY ENTRY ;-------------------------------------------- MAIN ;------------引脚连接MAT0.1------------------ ldr r0,=PINSEL0 mov r1,#0x800 str r1,[r0] ;p0.5-->mat0.1 ;------------定时器0初试化------------------- ldr r0,=T0MR1 ldr r1,=0x00000bb7 str r1,[r0] ;溢出时间MR1 ldr r0,=T0MCR mov r1,#0x10 str r1,[r0] ;MR1复位 ldr r0,=T0EMR mov r1,#0xc0 str r1,[r0] ;MAT0.1(p0.5)外部匹配引脚翻转 ldr r0,=T0TCR mov r1,#0x03 str r1,[r0] ldr r0,=T0TCR mov r1,#0x01 str r1,[r0] ;起动定时器 ;---------------------------------------------- B . ;---------------------------------------------- END |