TI CCS IDE轻松玩转MSP430

[复制链接]
243|9
手机看帖
扫描二维码
随时随地手机跟帖
szt1993|  楼主 | 2023-2-23 17:17 | 显示全部楼层 |阅读模式
本帖最后由 szt1993 于 2023-2-28 14:26 编辑

#申请原创#@21小跑堂
MSP430系列MCU下载驱动库的话肯定涉及驱动库的使用,下面咱们一起以MSP430 DriverLib for MSP430FR2xx_4xx Devices的驱动库为例给大家详细说明一下TI IDE CCS如何查阅相关的文档!
打开ccs后点击View界面,弹出相关试图菜单,其中Resource Exerplorer和Resource Exerplorer Offline就是搜索资源窗口,第一个是在线资源第二个是离线资源!
1.png

在在线资源下面的MSP430Ware (3.80.14.01)选择Libraries就会出现关于MSP430的相关文件

2.png

在Libraries库文件下选择Driver Library驱动库文件,驱动文件分MCU进行存放,选择需要的MCU进行查阅

3.png

驱动库文件下游各种驱动示例,以GPIO为例讲解一下:

4.png

点击GPIO会弹出相关的GPIO的相关案例程序,选择需要的查看API函数以及使用过程,里面讲解的很详细,里面的驱动库也比较齐全,唯一的缺点是相关讲解说明是英文的。

5.png

/* --COPYRIGHT--,BSD
* Copyright (c) 2017, 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--*/
//******************************************************************************
//   Write a Word to Port A (Port1+Port2)
//
//   Writes a Word(FFFFh) to Port A and stays in LPM4
//   ACLK = 32.768kHz, MCLK = SMCLK = default DCO
//
//  Tested On: MSP430FR4133
//             -----------------
//         /|\|                 |
//          | |                 |
//          --|RST          PA.x|-->HI
//            |                 |
//            |                 |
//
//
//   This example uses the following peripherals and I/O signals.  You must
//   review these and change as needed for your own board:
//   - GPIO Port peripheral
//
//   This example uses the following interrupt handlers.  To use this example
//   in your own application you must add these interrupt handlers to your
//   vector table.
//   - None.
//******************************************************************************
#include "driverlib.h"

void main (void)
{
    //Stop WDT
    WDT_A_hold(WDT_A_BASE);

    //PA.x output
    GPIO_setAsOutputPin(
        GPIO_PORT_PA,
        GPIO_PIN0 + GPIO_PIN1 + GPIO_PIN2 + GPIO_PIN3 +
        GPIO_PIN4 + GPIO_PIN5 + GPIO_PIN6 + GPIO_PIN7 +
        GPIO_PIN8 + GPIO_PIN9 + GPIO_PIN10 + GPIO_PIN11 +
        GPIO_PIN12 + GPIO_PIN13 + GPIO_PIN14 + GPIO_PIN15
        );


    //Set all PA pins HI
    GPIO_setOutputHighOnPin(

        GPIO_PORT_PA,
        GPIO_PIN0 + GPIO_PIN1 + GPIO_PIN2 + GPIO_PIN3 +
        GPIO_PIN4 + GPIO_PIN5 + GPIO_PIN6 + GPIO_PIN7 +
        GPIO_PIN8 + GPIO_PIN9 + GPIO_PIN10 + GPIO_PIN11 +
        GPIO_PIN12 + GPIO_PIN13 + GPIO_PIN14 + GPIO_PIN15
        );

    PMM_unlockLPM5();

    //Enter LPM4 w/interrupts enabled
    __bis_SR_register(LPM4_bits + GIE);

    //For debugger
    __no_operation();
}


整体的一个TI CCS 软件相关资料的查阅基本就是在线查找即可,非常方便快捷,对于新手来说也非常友好,只不过需要深入学习一下!

最后咱们说一下在线资源和离线资源的对比情况。

在线资源列表如下图:
9在线.png
离线资源列表如下图:
10.png
在线资源与离线资源对比总结如下:

1、离线资源就是下载的MSP430 Ware资源包含库、设备等
2、在线资源不仅包含MSP430的资源还包含其他的MCU资源、Hardware kits and boards等资源,种类更齐全
3、在线资源实时更新,所有库文件状态会有所变化
个人建议使用在线资源进行相关文档的查阅学习!





  

使用特权

评论回复
评分
参与人数 1威望 +10 收起 理由
xyz549040622 + 10 很给力!
xyz549040622| | 2023-2-25 22:39 | 显示全部楼层
个人认为,TI的Resource  Explorer的是业界做的相当好的东西了,非常方便。

使用特权

评论回复
szt1993|  楼主 | 2023-2-28 10:26 | 显示全部楼层
xyz549040622 发表于 2023-2-25 22:39
个人认为,TI的Resource  Explorer的是业界做的相当好的东西了,非常方便。

确实,我感觉也是集成度非常高,而且运行还挺流畅

使用特权

评论回复
minzisc| | 2023-3-18 12:17 | 显示全部楼层
图形化开发单片机是趋势了。              

使用特权

评论回复
abotomson| | 2023-3-18 13:56 | 显示全部楼层
CCS 这个软件还是非常不错的 。性能给力。

使用特权

评论回复
hilahope| | 2023-3-18 14:41 | 显示全部楼层
直接iar开发吧。              

使用特权

评论回复
wangdezhi| | 2023-3-18 15:14 | 显示全部楼层
现在CCS的版本到哪里了              

使用特权

评论回复
pentruman| | 2023-3-18 15:57 | 显示全部楼层
CCS IDE安装文件太大了。              

使用特权

评论回复
gygp| | 2023-3-18 16:37 | 显示全部楼层
msp430好久没有用过了,感觉都非常陌生了。

使用特权

评论回复
zwsam| | 2023-3-24 21:44 | 显示全部楼层

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

138

主题

1361

帖子

4

粉丝