新聞中心

EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 【32位MCU】9G-CM0 新唐CM0+MDK-ARM入門開(kāi)發(fā)過(guò)程簡(jiǎn)介

【32位MCU】9G-CM0 新唐CM0+MDK-ARM入門開(kāi)發(fā)過(guò)程簡(jiǎn)介

作者: 時(shí)間:2016-11-29 來(lái)源:網(wǎng)絡(luò) 收藏
9G-CM0 新唐CM0+MDK-ARM入門開(kāi)發(fā)過(guò)程簡(jiǎn)介

一,準(zhǔn)備MDK-ARM + 新唐CM0軟件包

本文引用地址:http://m.butianyuan.cn/article/201611/323203.htm

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上
右擊“下載地址:”后的“下載”選擇“目標(biāo)另存為”下載文件到本地硬盤。
(自己查找破解文件“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,新唐官方資料網(wǎng)址
新唐CM0官方資料主頁(yè)
http://www.nuvoton.com/hq/chs/Pages/default.aspx
新唐CM0主頁(yè)資料入口
ARM單片機(jī) -> ARM Cortex?-M0 單片機(jī) NuMicro? 家族
新唐CM0主頁(yè)資料網(wǎng)址
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在線培訓(xùn)教程
http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMCortexTMM0/Pages/OnLineTraining.aspx

二,建立CM0的MDK-ARM+Nu-LINK開(kāi)發(fā)環(huán)境

1,雙擊“mdk412_mcu123.rar”運(yùn)行里面的“MDK412.exe”,一路的“NEXT”再“NEXT”,最后就會(huì)安裝MDK-ARM 4.12到電腦上,將會(huì)在桌面產(chǎn)生Keil uVision4的快捷方式;

2,雙擊“keygen.exe”,把“uVision4”的“File->License Management”菜單里面的“CID”復(fù)制到keygen里面的CID框中,選擇“TARGET”為“ARM”后點(diǎn)擊“Generate”,把
產(chǎn)生的序列號(hào)復(fù)制到前面“uVision4”的窗口中的“LIC”框中,點(diǎn)擊“ADD LIC”便會(huì)解除編譯限制;

3,雙擊“NUC1xxKeilICEdriverBuild3814V101.zip ”運(yùn)行里面的“Nu-Link_Driver.EXE”,便會(huì)在KEIL目錄中安裝上相關(guān)的“Nu-LINK”的驅(qū)動(dòng)。

三,建立CM0的MDK-ARM基本工程

1,在電腦開(kāi)始菜單中打開(kāi)“Keil uVision4”,在“uVision4”的IDE菜單中選擇“Project”->“New uVision Project”創(chuàng)建一個(gè)新工程,在“Create New Project”選擇存儲(chǔ)目錄
到D:works9G-CM0uc140project下面,工程名叫“nuc140.uvproj”;

2,接著在“select a CPU Data Base File”菜單中選擇“NUVOTON NUC1XX Devices”點(diǎn)擊“OK”,選擇“Nuvoton”公司下面的“NUC140VE3AN”點(diǎn)擊“OK”后確認(rèn)復(fù)制啟動(dòng)代碼“startup_NUC1xx.s”和
加入到工程項(xiàng)目中,即可產(chǎn)生一個(gè)空工程,再點(diǎn)擊全部保存項(xiàng)目,會(huì)D:works9G-CM0uc140project目錄中發(fā)現(xiàn)“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”打開(kāi)“Components,Environment,Books”頁(yè)面里的“Project Components”,
雙擊“Target1”改名為“NUC140”,雙擊“Source Group 1”改名為“boot”再添加“lib”“drv”“src”“inc”等目錄后確定。

5,在“uVision4”的IDE菜單中選擇“File”->“New”后選擇“File”->“Save”把新建立的文件保存到D:works9G-CM0uc140source,文件名為“main.c”,右擊項(xiàng)目窗口中的“src”選擇“Add Files
to Group src”并在“main.c”中填入下面內(nèi)容:
#include /* NUC1xx definitions */
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”頁(yè)面勾選“Create HEX File”,并在“Select Folder Objects”指定目錄到“D:works9G-CM0uc140projectobj”,
后點(diǎn)擊“OK”,同樣在“Listing”中在“Select Folder Listings”指定目錄到“D:works9G-CM0uc140projectlst”;

2,在“Opitions for Target ‘NUC140’”的“Debug”頁(yè)面選擇用硬件仿真器“Nu-Link Debugger”勾選“Run to main{}”,在“Utilities”頁(yè)面選擇“Use Target Driver for Flash Programming”用
“Nu-Link Debugger”勾選上“Update Target before Debugging”后在“Setting”里面的“Configure”,確保用內(nèi)置22M晶體,和從“APROM”啟動(dòng)及低壓檢測(cè)電壓值等配置選項(xiàng)后點(diǎn)擊“OK”再“OK”退出;

3,在“Opitions for Target ‘NUC140’”的“C/C++”頁(yè)面的“Include Paths”中填入“C:KeilARMINCNuvotonNUC1xx”

四,調(diào)試CM0的MDK-ARM基本工程

1,點(diǎn)擊在“uVision4”的IDE菜單中選擇“Flash”->“Download”便會(huì)自己編譯代碼生成HEX文件并下載到目標(biāo)板子中;

2,點(diǎn)擊在“uVision4”的IDE菜單中選擇“Debug”->“Start/Stop Debug session”進(jìn)入調(diào)試狀態(tài),然后選擇“Debug”->“Run”,全速運(yùn)行,可以看到IO口上的LED在閃爍。9G-CM0-20100629.zip

四,建立CM0的MDK-ARM高級(jí)工程
(待續(xù))



關(guān)鍵詞: 32位MCU新唐CM0MDKARM入

評(píng)論


技術(shù)專區(qū)

關(guān)閉