搜索
bottom↓
回复: 0

lpc1114IO控制不了?

[复制链接]

出0入0汤圆

发表于 2013-6-27 13:30:55 | 显示全部楼层 |阅读模式
我试着控制1114的IO,却只有部分IO能变化,但我也没有做其它任何动作,只是初始化了IO!
#include <lpc11xx.h>
#include "gpio.h"

void GPIO_Configuration(void);
void  Delay (uint32_t nCount);



int main(void)
{
        GPIOInit();
        GPIO_Configuration();
        while(1)
        {
                GPIOSetValue(PORT0,0,HIGH);
                GPIOSetValue(PORT0,1,HIGH);
                GPIOSetValue(PORT0,2,HIGH);       
                GPIOSetValue(PORT0,4,HIGH);
                GPIOSetValue(PORT0,5,HIGH);
                GPIOSetValue(PORT0,6,HIGH);
                GPIOSetValue(PORT0,8,HIGH);
                GPIOSetValue(PORT0,9,HIGH);
                GPIOSetValue(PORT0,10,HIGH);       
                GPIOSetValue(PORT0,11,HIGH);

                GPIOSetValue(PORT1,0,HIGH);
                GPIOSetValue(PORT1,1,HIGH);
                GPIOSetValue(PORT1,2,HIGH);
                GPIOSetValue(PORT1,3,HIGH);
                GPIOSetValue(PORT1,6,HIGH);
                GPIOSetValue(PORT1,7,HIGH);

                Delay(0xfffff);
                GPIOSetValue(PORT0,0,LOW);
                GPIOSetValue(PORT0,1,LOW);
                GPIOSetValue(PORT0,2,LOW);       
                GPIOSetValue(PORT0,4,LOW);
                GPIOSetValue(PORT0,5,LOW);
                GPIOSetValue(PORT0,6,LOW);
                GPIOSetValue(PORT0,8,LOW);
                GPIOSetValue(PORT0,9,LOW);
                GPIOSetValue(PORT0,10,LOW);       
                GPIOSetValue(PORT0,11,LOW);

                GPIOSetValue(PORT1,0,LOW);
                GPIOSetValue(PORT1,1,LOW);
                GPIOSetValue(PORT1,2,LOW);
                GPIOSetValue(PORT1,3,LOW);
                GPIOSetValue(PORT1,6,LOW);
                GPIOSetValue(PORT1,7,LOW);
                Delay(0xfffff);
                       
        }
}

/*******************************************************************************
* Function Name  : Delay
* Description    : Delay Time
* Input          : - nCount: Delay Time
* Output         : None
* Return         : None
* Attention                 : None
*******************************************************************************/
void  Delay (uint32_t nCount)
{
  for(; nCount != 0; nCount--);
}

/*******************************************************************************
* Function Name  : GPIO_Configuration
* Description    : Configure GPIO Pin
* Input          : None
* Output         : None
* Return         : None
* Attention                 : None
*******************************************************************************/
void GPIO_Configuration(void)
{
        GPIOSetDir(PORT0,0,OUT);
        GPIOSetDir(PORT0,1,OUT);
        GPIOSetDir(PORT0,2,OUT);       
        GPIOSetDir(PORT0,4,OUT);
        GPIOSetDir(PORT0,5,OUT);
        GPIOSetDir(PORT0,6,OUT);
        GPIOSetDir(PORT0,8,OUT);
        GPIOSetDir(PORT0,9,OUT);
        GPIOSetDir(PORT0,10,OUT);       
        GPIOSetDir(PORT0,11,OUT);

        GPIOSetDir(PORT1,0,OUT);
        GPIOSetDir(PORT1,1,OUT);
        GPIOSetDir(PORT1,2,OUT);
        GPIOSetDir(PORT1,3,OUT);
        GPIOSetDir(PORT1,6,OUT);
        GPIOSetDir(PORT1,7,OUT);       
                       
}

把这个代码烧到1112就更不靠谱了,一个IO都没有动,本人初学,求大虾指路,十分感谢

阿莫论坛20周年了!感谢大家的支持与爱护!!

你熬了10碗粥,别人一桶水倒进去,淘走90碗,剩下10碗给你,你看似没亏,其实你那10碗已经没有之前的裹腹了,人家的一桶水换90碗,继续卖。说白了,通货膨胀就是,你的钱是挣来的,他的钱是印来的,掺和在一起,你的钱就贬值了。
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-10-3 04:30

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表