9G-CM0 新唐CM0+MDK–ARM入门开发进程简介
一,预备MDK-ARM + 新唐CM0软件包
1,在http://www.mcu123.com/news/Soft/embsof/arm/201006/529.html
下载RealView MDK-ARM 4.12 (MDK-ARM V4.12,MDK4.12)
mdk412_mcu123.rar
在http://www.mcu123.com/news/Soft/ShowSoftDown.asp?UrlID=3&SoftID=529上
右击“下载地址:”后的“下载”挑选“方针另存为”下载文件到本地硬盘。
(自己查找破解文件“keygen.exe”)
http://esoft.mcu123.com/MCU123_temp_20100103@/arm/mdk412_mcu123.rar
2,在http://www.nuvoton.com/NuvotonMOSS/Community/ProductInfo.aspx?tp_GUID=403a9c50-52c2-4463-9057-2595190602c5上
上下载 “NUC1xx Keil ICE driver (Build 3814) V1.01.zip”
NUC1xxKeilICEdriverBuild3814V101.zip
http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMCortexTMM0/Documents/NUC1xxKeilICEdriverBuild3814V101.zip
下载“NUC1xx Nu-Tiny-EVB and Nu-Link-Me Board user manual EN v1.0.pdf”文档
NUC1xxNuTinyEVBandNuLinkMeBoardusermanualENv10.pdf
http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMCortexTMM0/Documents/NUC1xxNuTinyEVBandNuLinkMeBoardusermanualENv10.pdf
下载“NUC1xx Nu-Link-Me_001 Board Schematic v1.0.pdf”文档
NUC1xxNuLinkMe_001BoardSchematicv10.pdf
http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMCortexTMM0/Documents/NUC1xxNuLinkMe_001BoardSchematicv10.pdf
下载“NUC1xx Nu-Tiny-EVB_001 Board Schemetic v1.0.pdf”文档
NUC1xxNuTinyEVB_001BoardSchemeticv10.pdf
http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMCortexTMM0/Documents/NUC1xxNuTinyEVB_001BoardSchemeticv10.pdf
3,在http://www.nuvoton.com/NuvotonMOSS/Community/ProductInfo.aspx?tp_GUID=7052964b-b71b-46b7-91b2-221afeddd575上
上下载 “NUC1xxBSP_v1.1.1.zip”
NUC1xxBSP_v111.zip
http://www.nuvoton.com/NuvotonMOSS/Community/ProductInfo.aspx?tp_GUID=38a57efd-e9f8-4809-a585-21e62f8b6041
4,新唐官方材料网址
新唐CM0官方材料主页
http://www.nuvoton.com/hq/chs/Pages/default.aspx
新唐CM0主页材料进口
ARM单片机 -> ARM Cortex?-M0 单片机 NuMicro? 宗族
新唐CM0主页材料网址
http://www.nuvoton.com/NuvotonMOSS/Community/ProductInfo.aspx?tp_GUID=30cfcae5-0f93-414d-a8df-b3bac8b932a2
新唐CM0在线选型东西
http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMCortexTMM0/Pages/SelectGuide.aspx
新唐CM0在线训练教程
http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMCortexTMM0/Pages/OnLineTraining.aspx
二,树立CM0的MDK-ARM+Nu-LINK开发环境
1,双击“mdk412_mcu123.rar”运转里边的“MDK412.exe”,一路的“NEXT”再“NEXT”,最终就会装置MDK-ARM 4.12到电脑上,将会在桌面发生Keil uVision4的快捷方式;
2,双击“keygen.exe”,把“uVision4”的“File->License Management”菜单里边的“CID”仿制到keygen里边的CID框中,挑选“TARGET”为“ARM”后点击“Generate”,把
发生的序列号仿制到前面“uVision4”的窗口中的“LIC”框中,点击“ADD LIC”便会免除编译约束;
3,双击“NUC1xxKeilICEdriverBuild3814V101.zip ”运转里边的“Nu-Link_Driver.EXE”,便会在KEIL目录中装置上相关的“Nu-LINK”的驱动。
三,树立CM0的MDK-ARM根本工程
1,在电脑开始菜单中翻开“Keil uVision4”,在“uVision4”的IDE菜单中挑选“Project”->“New uVision Project”创立一个新工程,在“Create New Project”挑选存储目录
到D:works9G-CM0uc140project下面,工程名叫“nuc140.uvproj”;
2,接着在“select a CPU Data Base File”菜单中挑选“NUVOTON NUC1XX Devices”点击“OK”,挑选“Nuvoton”公司下面的“NUC140VE3AN”点击“OK”后承认仿制发动代码“startup_NUC1xx.s”和
加入到工程项目中,即可发生一个空工程,再点击悉数保存项目,会D:works9G-CM0uc140project目录中发现“nuc140.uvproj”和“nuc140.uvopt”,“startup_NUC1xx.s”等文件;
3,在“D:works9G-CM0uc140”下树立文件夹“include”,“driver”,“library”,“source”,等子目录,解压“NUC1xxBSP_v111.zip”,把里边的目录“NUC1xxBSP”解压到“library”里边,在D:works9G-CM0uc140project
下树立子目录“obj”和“lst”;
4,在“uVision4”的IDE菜单中挑选“Project”->“Manage”->“Components,Environment,Books”翻开“Components,Environment,Books”页面里的“Project Components”,
双击“Target1”改名为“NUC140”,双击“Source Group 1”改名为“boot”再增加“lib”“drv”“src”“inc”等目录后确认。
5,在“uVision4”的IDE菜单中挑选“File”->“New”后挑选“File”->“Save”把新树立的文件保存到D:works9G-CM0uc140source,文件名为“main.c”,右击项目窗口中的“src”挑选“Add Files
to Group src”并在“main.c”中填入下面内容:
#include
void SystemInit(void){}
void GPIO_Init(void){ NUC_GPIOC->PMD = 0x00005555;} /* LEDs on PORT C defined as Output */
int main(void)
{
int i;
GPIO_Init();
while(1)
{
for(i=0;i<1000000;i++);NUC_GPIOC->DOUT &= 0xFFFFFF00;/* switch on LEDs */
for(i=0;i<1000000;i++);NUC_GPIOC->DOUT |= 0x000000FF;/* switch off LEDs */
}
}
三,装备CM0的MDK-ARM根本工程
1,在“uVision4”的IDE菜单中挑选“Project”->“Opitions for Target ‘NUC140’”,在“Output”页面勾选“Create HEX File”,并在“Select Folder Objects”指定目录到“D:works9G-CM0uc140projectobj”,
后点击“OK”,同样在“Listing”中在“Select Folder Listings”指定目录到“D:works9G-CM0uc140projectlst”;
2,在“Opitions for Target ‘NUC140’”的“Debug”页面挑选用硬件仿真器“Nu-Link Debugger”勾选“Run to main{}”,在“Utilities”页面挑选“Use Target Driver for Flash Programming”用
“Nu-Link Debugger”勾选上“Update Target before Debugging”后在“Setting”里边的“Configure”,确保用内置22M晶体,和从“APROM”发动及低压检测电压值等装备选项后点击“OK”再“OK”退出;
3,在“Opitions for Target ‘NUC140’”的“C/C++”页面的“Include Paths”中填入“C:KeilARMINCNuvotonNUC1xx”
四,调试CM0的MDK-ARM根本工程
1,点击在“uVision4”的IDE菜单中挑选“Flash”->“Download”便会自己编译代码生成HEX文件并下载到方针板子中;
2,点击在“uVision4”的IDE菜单中挑选“Debug”->“Start/Stop Debug session”进入调试状况,然后挑选“Debug”->“Run”,全速运转,能够看到IO口上的LED在闪耀。9G-CM0-20100629.zip
四,树立CM0的MDK-ARM高档工程
(待续)