[技术问答] keil 里没有 NUC131这款型号

[复制链接]
1900|6
 楼主| lotus_wolf 发表于 2016-8-30 09:15 | 显示全部楼层 |阅读模式
keil4 里没有 NUC131这款型号.请教一下大家怎么添加进去这个型号呢!有经验的朋友,望指点一下
玛尼玛尼哄 发表于 2016-8-30 12:42 | 显示全部楼层
如果是新款, 你换成Keil5就行了,可以通过包管理器安装的,昨晚我也搞新唐,安装的五,下载包,下载了半天。
玛尼玛尼哄 发表于 2016-8-30 12:43 | 显示全部楼层
最新版的开发包是1.0.8,需要在keil5的pack管理器里安装。
dongnanxibei 发表于 2016-8-30 20:36 | 显示全部楼层
C:\Keil_v5\ARM\PACK\Nuvoton\NuMicro_DFP\1.0.8\Boards\NUC131
dongnanxibei 发表于 2016-8-30 20:37 | 显示全部楼层
有的,需要你安装pack后,给你看个里面的例子,很好玩
  1. /**************************************************************************//**
  2. * [url=home.php?mod=space&uid=288409]@file[/url]     main.c
  3. * [url=home.php?mod=space&uid=895143]@version[/url]  V3.00
  4. * $Revision: 7 $
  5. * $Date: 15/01/16 11:44a $
  6. * [url=home.php?mod=space&uid=247401]@brief[/url]    Show the usage of GPIO interrupt function.
  7. * @note
  8. * Copyright (C) 2013 Nuvoton Technology Corp. All rights reserved.
  9. ******************************************************************************/
  10. #include <stdio.h>
  11. #include "NUC131.h"


  12. #define PLL_CLOCK   50000000


  13. /**
  14. * @brief       GPIO PA/PB IRQ
  15. *
  16. * @param       None
  17. *
  18. * [url=home.php?mod=space&uid=266161]@return[/url]      None
  19. *
  20. * [url=home.php?mod=space&uid=1543424]@Details[/url]     The PA/PB default IRQ, declared in startup_NUC131.s.
  21. */
  22. void GPAB_IRQHandler(void)
  23. {
  24.     /* To check if PB.3 interrupt occurred */

  25.     if(GPIO_GET_INT_FLAG(PB, BIT3))
  26.     {
  27.         GPIO_CLR_INT_FLAG(PB, BIT3);
  28.         printf("PB.3 INT occurred.\n");
  29.     }
  30.     else
  31.     {
  32.         /* Un-expected interrupt. Just clear all PA, PB interrupts */
  33.         PA->ISRC = PA->ISRC;
  34.         PB->ISRC = PB->ISRC;
  35.         printf("Un-expected interrupts.\n");
  36.     }
  37. }

  38. /**
  39. * @brief       GPIO PC/PD/PE/PF IRQ
  40. *
  41. * @param       None
  42. *
  43. * @return      None
  44. *
  45. * @details     The PC/PD/PE/PF default IRQ, declared in startup_NUC131.s.
  46. */
  47. void GPCDEF_IRQHandler(void)
  48. {
  49.     /* To check if PE.5 interrupt occurred */
  50.     if(GPIO_GET_INT_FLAG(PE, BIT5))
  51.     {
  52.         GPIO_CLR_INT_FLAG(PE, BIT5);
  53.         printf("PE.5 INT occurred.\n");
  54.     }
  55.     else
  56.     {
  57.         /* Un-expected interrupt. Just clear all PC, PD, PE and PF interrupts */
  58.         PC->ISRC = PC->ISRC;
  59.         PD->ISRC = PD->ISRC;
  60.         PE->ISRC = PE->ISRC;
  61.         PF->ISRC = PF->ISRC;
  62.         printf("Un-expected interrupts.\n");
  63.     }
  64. }

  65. void SYS_Init(void)
  66. {
  67.     /*---------------------------------------------------------------------------------------------------------*/
  68.     /* Init System Clock                                                                                       */
  69.     /*---------------------------------------------------------------------------------------------------------*/

  70.     /* Enable Internal RC 22.1184MHz clock */
  71.     CLK_EnableXtalRC(CLK_PWRCON_OSC22M_EN_Msk);

  72.     /* Waiting for Internal RC clock ready */
  73.     CLK_WaitClockReady(CLK_CLKSTATUS_OSC22M_STB_Msk);

  74.     /* Switch HCLK clock source to Internal RC and HCLK source divide 1 */
  75.     CLK_SetHCLK(CLK_CLKSEL0_HCLK_S_HIRC, CLK_CLKDIV_HCLK(1));

  76.     /* Enable external XTAL 12MHz clock */
  77.     CLK_EnableXtalRC(CLK_PWRCON_XTL12M_EN_Msk);

  78.     /* Waiting for external XTAL clock ready */
  79.     CLK_WaitClockReady(CLK_CLKSTATUS_XTL12M_STB_Msk);

  80.     /* Set core clock as PLL_CLOCK from PLL */
  81.     CLK_SetCoreClock(PLL_CLOCK);

  82.     /* Enable UART module clock */
  83.     CLK_EnableModuleClock(UART0_MODULE);

  84.     /* Select UART module clock source */
  85.     CLK_SetModuleClock(UART0_MODULE, CLK_CLKSEL1_UART_S_HXT, CLK_CLKDIV_UART(1));

  86.     /*---------------------------------------------------------------------------------------------------------*/
  87.     /* Init I/O Multi-function                                                                                 */
  88.     /*---------------------------------------------------------------------------------------------------------*/

  89.     /* Set GPB multi-function pins for UART0 RXD(PB.0) and TXD(PB.1) */
  90.     SYS->GPB_MFP &= ~(SYS_GPB_MFP_PB0_Msk | SYS_GPB_MFP_PB1_Msk);
  91.     SYS->GPB_MFP |= (SYS_GPB_MFP_PB0_UART0_RXD | SYS_GPB_MFP_PB1_UART0_TXD);

  92. }

  93. void UART0_Init(void)
  94. {
  95.     /*---------------------------------------------------------------------------------------------------------*/
  96.     /* Init UART                                                                                               */
  97.     /*---------------------------------------------------------------------------------------------------------*/
  98.     /* Reset UART0 module */
  99.     SYS_ResetModule(UART0_RST);

  100.     /* Configure UART0 and set UART0 Baudrate */
  101.     UART_Open(UART0, 115200);
  102. }

  103. /*---------------------------------------------------------------------------------------------------------*/
  104. /* MAIN function                                                                                           */
  105. /*---------------------------------------------------------------------------------------------------------*/
  106. int main(void)
  107. {
  108.     /* Unlock protected registers */
  109.     SYS_UnlockReg();

  110.     /* Init System, peripheral clock and multi-function I/O */
  111.     SYS_Init();

  112.     /* Lock protected registers */
  113.     SYS_LockReg();

  114.     /* Init UART0 for printf */
  115.     UART0_Init();

  116.     printf("\n\nCPU [url=home.php?mod=space&uid=72445]@[/url] %d Hz\n", SystemCoreClock);
  117.     printf("+------------------------------------------------+\n");
  118.     printf("|    GPIO PB.3 and PE.5 Interrupt Sample Code    |\n");
  119.     printf("+------------------------------------------------+\n\n");

  120.     /*-----------------------------------------------------------------------------------------------------*/
  121.     /* GPIO Interrupt Function Test                                                                        */
  122.     /*-----------------------------------------------------------------------------------------------------*/
  123.     printf("PB.3 and PE.5 are used to test interrupt ......\n");

  124.     /* Configure PB.3 as Input mode and enable interrupt by rising edge trigger */
  125.     GPIO_SetMode(PB, BIT3, GPIO_PMD_INPUT);
  126.     GPIO_EnableInt(PB, 3, GPIO_INT_RISING);
  127.     NVIC_EnableIRQ(GPAB_IRQn);

  128.     /*  Configure PE.5 as Quasi-bidirection mode and enable interrupt by falling edge trigger */
  129.     GPIO_SetMode(PE, BIT5, GPIO_PMD_QUASI);
  130.     GPIO_EnableInt(PE, 5, GPIO_INT_FALLING);
  131.     NVIC_EnableIRQ(GPCDEF_IRQn);

  132.     /* Waiting for interrupts */
  133.     while(1);
  134. }

  135. /*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/


wahahaheihei 发表于 2016-8-30 21:07 | 显示全部楼层
你找找STM32的也没有,你是不是安装后没有联网安装Pack
wahahaheihei 发表于 2016-8-30 21:09 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

13

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部