查看: 5073|回复: 6

[原创] lpc4370实验,点亮LED灯

[复制链接]
  • TA的每日心情
    开心
    2019-4-28 12:41
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

    8

    主题

    280

    帖子

    0

    高级会员

    Rank: 4

    积分
    802
    最后登录
    2021-9-5
    发表于 2016-4-15 10:39:32 | 显示全部楼层 |阅读模式
    自己新建的工程,keil 5.15版本功能led等交替闪烁
    /*
    * @brief Blinky example using sysTick
    *
    * @note
    * Copyright(C) NXP Semiconductors, 2013
    * All rights reserved.
    *
    * @par
    * Software that is described herein is for illustrative purposes only
    * which provides customers with programming information regarding the
    * LPC products.  This software is supplied "AS IS" without any warranties of
    * any kind, and NXP Semiconductors and its licensor disclaim any and
    * all warranties, express or implied, including all implied warranties of
    * merchantability, fitness for a particular purpose and non-infringement of
    * intellectual property rights.  NXP Semiconductors assumes no responsibility
    * or liability for the use of the software, conveys no license or rights under any
    * patent, copyright, mask work right, or any other intellectual property rights in
    * or to any products. NXP Semiconductors reserves the right to make changes
    * in the software without notification. NXP Semiconductors also makes no
    * representation or warranty that such application will be suitable for the
    * specified use without further testing or modification.
    *
    * @par
    * Permission to use, copy, modify, and distribute this software and its
    * documentation is hereby granted, under NXP Semiconductors' and its
    * licensor's relevant copyrights in the software, without fee, provided that it
    * is used in conjunction with NXP Semiconductors microcontrollers.  This
    * copyright, permission, and disclaimer notice must appear in all copies of
    * this code.
    */

    #include "board.h"
    #include <stdio.h>
    #include "stopwatch.h"

    /*****************************************************************************
    * Private types/enumerations/variables
    ****************************************************************************/
    #define TICKRATE_HZ1 (1000)        /* 10 ticks per second */
    #define SDRAM_START_ADDRESS        0x28000000

    /*****************************************************************************
    * Public types/enumerations/variables
    ****************************************************************************/

    /*****************************************************************************
    * Private functions
    ****************************************************************************/

    /*****************************************************************************
    * Public functions
    ****************************************************************************/

    /**
    * @brief        Handle interrupt from SysTick timer
    * @return        Nothing
    */
    void SysTick_Handler(void)
    {
            static int x = 0;
            if (x++ > 500) {
                    Board_LED_Toggle(0);
                    Board_LED_Toggle(1);
                    x = 0;
            }
    }

    /* Set up and initialize all required blocks and functions related to the
       board hardware */
    void Board_Init(void)
    {
            /* Sets up DEBUG UART */
            DEBUGINIT();

            /* Initializes GPIO */
            Chip_GPIO_Init(LPC_GPIO_PORT);

            /* Initialize LEDs */
            Board_LED_Init();
    }

    /**
    * @brief        main routine for blinky example
    * @return        Function should not exit.
    */
    int main(void)
    {
            SystemCoreClockUpdate();
            Board_Init();

            /* Enable and setup SysTick Timer at a periodic rate */
            SysTick_Config(SystemCoreClock / TICKRATE_HZ1);

            while (1) {
                    __WFI();
            }

            return 0;
    }

    Template - LEDS.zip

    19 MB, 下载次数: 34, 下载积分: 威望 1

    评分

    参与人数 1NXP金币 +10 收起 理由
    小七 + 10 打赏!

    查看全部评分

    回复

    使用道具 举报

  • TA的每日心情
    开心
    2017-1-24 09:50
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

    654

    主题

    3262

    帖子

    0

    金牌会员

    Rank: 6Rank: 6

    积分
    13128
    最后登录
    2019-1-27
    发表于 2016-4-15 13:31:07 | 显示全部楼层
    不错哈 ~ 建议可以放个图片上来   然后  建议楼主编辑帖子的时候,可以展开高级模式,使用添加代码功能哦。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2019-4-28 12:41
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

    8

    主题

    280

    帖子

    0

    高级会员

    Rank: 4

    积分
    802
    最后登录
    2021-9-5
     楼主| 发表于 2016-4-15 16:58:52 来自手机 | 显示全部楼层
    小七 发表于 2016-4-15 13:31
    不错哈 ~ 建议可以放个图片上来   然后  建议楼主编辑帖子的时候,可以展开高级模式,使用添加代码功能 ...

    图片太大,上传不了图片
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2017-1-24 09:50
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

    654

    主题

    3262

    帖子

    0

    金牌会员

    Rank: 6Rank: 6

    积分
    13128
    最后登录
    2019-1-27
    发表于 2016-4-15 17:23:08 | 显示全部楼层
    sxdahss 发表于 2016-4-15 16:58
    图片太大,上传不了图片

    太大了吧,大到无法传

    对了  以后发帖请不要发在FAE板块哦, 可以选择其他板块发帖。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2019-4-28 12:41
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

    8

    主题

    280

    帖子

    0

    高级会员

    Rank: 4

    积分
    802
    最后登录
    2021-9-5
     楼主| 发表于 2016-4-16 09:03:06 来自手机 | 显示全部楼层
    小七 发表于 2016-4-15 17:23
    太大了吧,大到无法传

    对了  以后发帖请不要发在FAE板块哦, 可以选择其他板块发帖。 ...

    下次注意了,图片已上传
    IMG_20160415_103337.jpg
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    慵懒
    昨天 20:57
  • 签到天数: 1848 天

    连续签到: 3 天

    [LV.Master]伴坛终老

    203

    主题

    3万

    帖子

    64

    超级版主

    Rank: 8Rank: 8

    积分
    112630
    最后登录
    2025-7-21
    发表于 2019-5-28 11:45:48 | 显示全部楼层
    支持一下~~~
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

  • TA的每日心情
    无聊
    2025-7-14 08:51
  • 签到天数: 550 天

    连续签到: 1 天

    [LV.9]以坛为家II

    0

    主题

    552

    帖子

    0

    金牌会员

    Rank: 6Rank: 6

    积分
    1720
    最后登录
    2025-7-14
    发表于 2020-9-28 16:41:34 | 显示全部楼层
    謝謝 分享 , 第一次 用nxp 來學習一下
    想睡覺
    回复 支持 反对

    使用道具 举报

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

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-7-22 01:33 , Processed in 0.097450 second(s), 27 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

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