我用LPC2148控制几个LED做实验,用慢速GPIO时很正常,用快速GPIO时全速运行也正常,但是单不调试不行,端口没有输出
程序如下
#include <LPC214X.H> /* LPC214x definitions */
#define LED1 (1<<18)
#define LED2 (1<<19)
#define LED3 (1<<20)
#define LED4 (1<<23)
int main()
{
delay_ms(500);
PINSEL0 = 0x00000000;
PINSEL1 = 0x00000000;
// lcd_ini();
IO0DIR = LED1|LED2|LED3|LED4;
IO0SET = LED1|LED2|LED3|LED4;
IO0CLR = LED1;
IO0CLR = LED2;
IO0CLR = LED3;
IO0CLR = LED4;
SCS = 0x01;
FIO0DIR = LED1|LED2|LED3|LED4;
FIO0MASK = 0;
while (1)
{
FIO0SET = LED1|LED2|LED3|LED4;
// delay_ms(500);
FIO0CLR = LED1;
// delay_ms(500);
FIO0CLR = LED2;
// delay_ms(500);
FIO0CLR = LED3;
// delay_ms(500);
FIO0CLR = LED4;
// delay_ms(1000);
} |