3349|4

484

帖子

12

TA的资源

纯净的硅(高级)

楼主
 

试MSP432 launchpad有感 [复制链接]

昨天拿到TI的MSP432 launchpad实验板,随便搞了一个例程,无法使用,后来在TI官网下载一个有关MSP的
软件还是无法使用,再后来,更新了我的keil5 for ARM,可以运行TI的例程。
再再后来,我重新安装了CCS6.1软件,只选择了MSP430,勾选MSP432选项,这个默认是非选中的。
涛声依旧。

/*
* -------------------------------------------
*    MSP432 DriverLib - v2_20_00_08
* -------------------------------------------
*
* --COPYRIGHT--,BSD,BSD
* Copyright (c) 2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* *  Redistributions of source code must retain the above copyright
*    notice, this list of conditions and the following disclaimer.
*
* *  Redistributions in binary form must reproduce the above copyright
*    notice, this list of conditions and the following disclaimer in the
*    documentation and/or other materials provided with the distribution.
*
* *  Neither the name of Texas Instruments Incorporated nor the names of
*    its contributors may be used to endorse or promote products derived
*    from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --/COPYRIGHT--*/
/*******************************************************************************
* MSP432 GPIO - Input Interrupt
*
* Description: This example demonstrates a very simple use case of the
* DriverLib GPIO APIs. P1.1 (which has a switch connected to it) is configured
* as an input with interrupts enabled and P1.0 (which has an LED connected)
* is configured as an output. When the switch is pressed, the LED output
* is toggled.
*
*                MSP432P401
*             ------------------
*         /|\|                  |
*          | |                  |
*          --|RST         P1.0  |---> P1.0 LED
*            |                  |
*            |            P1.1  |<--Toggle Switch
*            |                  |
*            |                  |
*
* Author: Timothy Logan
******************************************************************************/
/* DriverLib Includes */
#include "driverlib.h"
/* Standard Includes */
#include
#include
int main(void)
{
    volatile uint32_t ii;
    /* Halting the Watchdog */
    MAP_WDT_A_holdTimer();
    /* Configuring P1.0 as output and P1.1 (switch) as input */
    MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
    /* Configuring P1.1 as an input and enabling interrupts */
    MAP_GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P1, GPIO_PIN1);
    MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN1);
    MAP_GPIO_enableInterrupt(GPIO_PORT_P1, GPIO_PIN1);
    MAP_Interrupt_enableInterrupt(INT_PORT1);
    /* Enabling SRAM Bank Retention */
    MAP_SysCtl_enableSRAMBankRetention(SYSCTL_SRAM_BANK1);
   
    /* Enabling MASTER interrupts */
    MAP_Interrupt_enableMaster();   
    /* Going to LPM3 */
    while (1)
    {
        MAP_PCM_gotoLPM3();
    }
}
/* GPIO ISR */
void gpio_isr(void)
{
    uint32_t status;
    status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P1);
    MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, status);
    /* Toggling the output on the LED */
    if(status & GPIO_PIN1)
    {
        MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0);
    }
}

翻译结果如图

gpio_input_interrupt.PNG (72.67 KB, 下载次数: 0)

gpio_input_interrupt.PNG

最新回复

支持楼主  谢谢分享  详情 回复 发表于 2015-5-18 09:25
 
点赞 关注

回复
举报

6066

帖子

90

TA的资源

裸片初长成(初级)

沙发
 
是通过TI store购买的吗?

如果是可以来这里晒单:
购买TI store MSP432P401R LaunchPad 晒单就送礼!

 
 

回复

484

帖子

12

TA的资源

纯净的硅(高级)

板凳
 
呵呵,TI送的,从这个例程可看出,现在的MSP432和过去的MSP430的
开发模式已经不同了,这个也和TM4C123G的固件库也有差别
看来我又得翻译MSP432的固件库函数了。
 
 
 

回复

484

帖子

12

TA的资源

纯净的硅(高级)

4
 
本帖最后由 平湖秋月 于 2015-5-18 09:14 编辑

还有,MSP432已经不是单片机而是 ARM Cortex M4F内核了。
我发这个帖子可能对刚刚接触MSP432的坛友有点启发,
过去已经按照CCS6的坛友,如果不重新安装CCS6是不能
使用MSP432 launchpad实验板的。
 
 
 

回复

793

帖子

8

TA的资源

纯净的硅(中级)

5
 
支持楼主  谢谢分享
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/7 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表