



版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、EK-LM3S8962-UG-5821開發(fā)板用戶指南EK-LM3S8962Firmware Development Package USERS GUIDESW-EK-LM3S8962-UG-5821Copyright?2008T exas Instruments Incorporated.CopyrightCopyright?2008Texas Instruments Incorporated.All rights reserved.Stellaris and StellarisWare are registered trademarks of Texas Instruments.ARM an
2、d Thumb are registered trademarks and Cortex is a trademark of ARM Limited.Other names and brands may be claimed as the property of others.be aware that an important notice concerning availability,standard warranty,and use in critical applications of Texas Instruments semicon-ductor products and dis
3、claimers thereto appears at the end of this document.Texas Instruments108Wild Basin,Suite350Austin,TX78746Main:+1-512-279-8800Fax:+1-512-279-8879Revision InformationThis is version5821of this document,last updated on March29,2010.2March29,2010T able of Contents Table of ContentsCopyright (2)Revision
4、 Information (2)1Introduction (5)2Example Applications (7)2.1AES Pre-expanded Key(aes_expanded_key) (7)2.2AES Normal Key(aes_set_key) (7)2.3Bit-Banding(bitband) (7)2.4Blinky(blinky) (7)2.5Boot Loader Demo1(boot_demo1) (8)2.6Boot Loader Demo2(boot_demo2) (8)2.7Boot Loader(boot_eth) (8)2.8Boot Loader(
5、boot_serial) (9)2.9CAN device FIFO mode example(can_device_?fo) (9)2.10CAN Device Board LED Application(can_device_led) (9)2.11CAN Device Board Quickstart Application(can_device_qs) (9)2.12CAN FIFO mode example(can_?fo) (9)2.13Ethernet-based I/O Control(enet_io) (10)2.14Ethernet with lwIP(enet_lwip)
6、 (10)2.15Ethernet with PTP(enet_ptpd) (11)2.16Ethernet with uIP(enet_uip) (11)2.17GPIO JTAG Recovery(gpio_jtag) (11)2.18Graphics Example(graphics) (11)2.19Hello World(hello) (12)2.20Interrupts(interrupts) (12)2.21MPU(mpu_fault) (12)2.22PWM(pwmgen) (12)2.23EK-LM3S8962Quickstart Application(qs_ek-lm3s
7、8962) (12)2.24SD card using FA T?le system(sd_card) (13)2.25Timer(timers) (13)2.26UART(uart_echo) (14)2.27Watchdog(watchdog) (14)3Development System Utilities (15)4Display Driver (21)4.1Introduction (21)4.2API Functions (21)4.3Programming Example (25)5Command Line Processing Module (27)5.1Introducti
8、on (27)5.2API Functions (27)5.3Programming Example (29)6CPU Usage Module (31)6.1Introduction (31)6.2API Functions (31)6.3Programming Example (32)7Flash Parameter Block Module (35)7.1Introduction (35)7.2API Functions (35)March29,20103Table of Contents7.3Programming Example (37)8Integer Square Root Mo
9、dule (39)8.1Introduction (39)8.2API Functions (39)8.3Programming Example (40)9Ethernet Board Locator Module (41)9.1Introduction (41)9.2API Functions (41)9.3Programming Example (44)10lwIP Wrapper Module (45)10.1Introduction (45)10.2API Functions (45)10.3Programming Example (48)11PTPd Wrapper Module (
10、49)11.1Introduction (49)11.2API Functions (49)11.3Programming Example (49)12Ring Buffer Module (51)12.1Introduction (51)12.2API Functions (51)12.3Programming Example (57)13Sine Calculation Module (59)13.1Introduction (59)13.2API Functions (59)13.3Programming Example (60)14Ethernet Software Update Mo
11、dule (61)14.1Introduction (61)14.2API Functions (61)14.3Programming Example (63)15TFTP Server Module (65)15.1Introduction (65)15.2Usage (65)15.3API Functions (68)16Micro Standard Library Module (73)16.1Introduction (73)16.2API Functions (73)16.3Programming Example (79)17UART Standard IO Module (81)1
12、7.1Introduction (81)17.2API Functions (82)17.3Programming Example (88)IMPORTANT NOTICE (90)4March29,2010Introduction 1IntroductionThe Texas Instruments?Stellaris?EK-LM3S8962evaluation board is a platform that can beused for software development and to prototype a hardware design.It contains a Stella
13、risARM?Cortex?-M3-based microcontroller,along with an OLED display,push buttons,a smallspeaker,a CAN interface,and an Ethernet interface that can be used to exercise the peripherals onthe microcontroller.Additionally,all of the microcontrollers pins are brought to unpopulated stakeheaders,allowing f
14、or easy connection to other hardware for the purposes of prototyping(after thestake headers have been populated by the customer).This document describes the board-speci?c drivers and example applications that are provided forthis development board.March29,20105Introduction6March29,2010Example Applic
15、ations 2Example ApplicationsThe example applications show how to utilize features of the Cortex-M3microprocessor,the pe-ripherals on the Stellaris microcontroller,and the drivers provided by the peripheral driver library.These applications are intended for demonstration and as a starting point for n
16、ew applications.There is an IAR workspace?le(ek-lm3s8962.eww)that contains the peripheral driver libraryproject,along with all of the board example projects,in a single,easy to use workspace for use withEmbedded Workbench version5.There is a Keil multi-project workspace?le(ek-lm3s8962.mpw)that conta
17、ins the peripheral driverlibrary project,along with all of the board example projects,in a single,easy to use workspace foruse with uVision.All of these examples reside in the boards/ek-lm3s8962subdirectory of the?rmware develop-ment package source distribution.2.1AES Pre-expanded Key(aes_expanded_k
18、ey)This example shows how to use pre-expanded keys to encrypt some plaintext,and then decrypt itback to the original pre-expanded keys avoids the need to perform the expansionat run-time.This example also uses cipher block chaining(CBC)mode instead of the simpler ECBmode.2.2AES Normal Key(aes_set_ke
19、y)This example shows how to set an encryption key and then use that key to encrypt some plaintext.It then sets the decryption key and decrypts the previously encrypted block back to plaintext. 2.3Bit-Banding(bitband)This example application demonstrates the use of the bit-banding capabilities of the
20、 Cortex-M3microprocessor.All of SRAM and all of the peripherals reside within bit-band regions,meaning thatbit-banding operations can be applied to any of them.In this example,a variable in SRAM is set toa particular value one bit at a time using bit-banding operations(it would be more ef?cient to d
21、o asingle non-bit-banded write;this simply demonstrates the operation of bit-banding).2.4Blinky(blinky)A very simple example that blinks the on-board LED.March29,20107Example Applications2.5Boot Loader Demo1(boot_demo1)An example to demonstrate the use of the Serial or Ethernet boot loader.After bei
22、ng started by theboot loader,the application will con?gure the UART and Ethernet controller and branch back to theboot loader to await the start of an update.The UART will always be con?gured at115,200baudand does not require the use of auto-bauding.The Ethernet controller will be con?gured for basi
23、coperation and enabled.Reprogramming using the Ethernet boot loader will require both the MACand IP Addresses.The MAC address will be displayed at the bottom of the screen.Since a TCP/IPstack is not being used in this demo application,an IP address will need to be selected that will beon the same su
24、bnet as the PC that is being used to program the?ash,but is not in con?ict with anyIP addresses already present on the network.Both the boot loader and the application must be placed into?ash.Once the boot loader is in?ash,it can be used to program the application into?ash as well.Then,the boot load
25、er can be used toreplace the application with another.The boot_demo2application can be used along with this application to easily demonstrate that theboot loader is actually updating the on-chip?ash.2.6Boot Loader Demo2(boot_demo2)An example to demonstrate the use of the Serial or Ethernet boot load
26、er.After being started bythe boot loader,the application will con?gure the UART and Ethernet controller,wait for the selectbutton to be pressed,and then branch back to the boot loader to await the start of an update.TheUART will always be con?gured at115,200baud and does not require the use of auto-
27、bauding.The Ethernet controller will be con?gured for basic operation and enabled.Reprogramming usingthe Ethernet boot loader will require both the MAC and IP Addresses.The MAC address willbe displayed at the bottom of the screen.Since a TCP/IP stack is not being used in this demoapplication,an IP a
28、ddress will need to be selected that will be on the same subnet as the PC thatis being used to program the?ash,but is not in con?ict with any IP addresses already present onthe network.Both the boot loader and the application must be placed into?ash.Once the boot loader is in?ash,it can be used to p
29、rogram the application into?ash as well.Then,the boot loader can be used toreplace the application with another.The boot_demo1application can be used along with this application to easily demonstrate that theboot loader is actually updating the on-chip?ash.2.7Boot Loader(boot_eth)The boot loader is
30、a small piece of code that can be programmed at the beginning of?ash to actas an application loader as well as an update mechanism for an application running on a Stellarismicrocontroller,utilizing either UART0,I2C0,SSI0,or Ethernet.The capabilities of the boot loaderare con?gured via the bl_con?g.h
31、 include?le.For this example,the boot loader uses Ethernet toload an application.8March29,2010Example Applications 2.8Boot Loader(boot_serial)The boot loader is a small piece of code that can be programmed at the beginning of?ash to actas an application loader as well as an update mechanism for an a
32、pplication running on a Stellarismicrocontroller,utilizing either UART0,I2C0,SSI0,or Ethernet.The capabilities of the boot loaderare con?gured via the bl_con?g.h include?le.For this example,the boot loader uses UART0toload an application.2.9CAN device FIFO mode example(can_device_?fo)This applicatio
33、n uses the CAN controller in FIFO mode to communicate with the CAN FIFO modeexample program that is running on the main board.The main board must have the can_?fo ex-ample program loaded for this example to function.This application will simply echo all data that itreceives back in its receive FIFO
34、back out its transmit FIFO.2.10CAN Device Board LED Application(can_device_led)This simple application uses the two buttons on the board as a light switch.When the“up”buttonis pressed the status LED will turn on.When the“down”button is pressed,the status LED will turnoff.2.11CAN Device Board Quickst
35、art Application(can_device_qs)This application uses the CAN controller to communicate with the evaluation board that is runningthe example game.It receives messages over CAN to turn on,turn off,or to pulse the LED on thedevice board.It also sends CAN messages when either of the up and down buttons a
36、re pressed orreleased.2.12CAN FIFO mode example(can_?fo)This application uses the CAN controller in FIFO mode to communicate with the CAN device board.The CAN device board must have the can_device_?fo example program loaded and running priorto starting this application.This program expects the CAN d
37、evice board to echo back the data that itreceives and this application will then compare the data received with the transmitted data and lookfor differences.This application will then modify the data and continue transmitting and receivingdata over the CAN bus inde?nitely.Note:This application must
38、be started after the can_device_?fo example has started on the CANdevice board.March29,20109Example Applications2.13Ethernet-based I/O Control(enet_io)This example application demonstrates web-based I/O control using the Stellaris Ethernet controllerand the lwIP TCP/IP Stack.DHCP is used to obtain a
39、n Ethernet address.If DHCP times out withoutobtaining an address,a static IP address will be chosen using AutoIP.The address that is selectedwill be shown on the OLED display allowing you to access the internal web pages served by theapplication via your normal web browser.Two different methods of c
40、ontrolling board peripherals via web pages are illustrated via pageslabelledIO Control Demo1andIO Control Demo2in the navigation menu on the left of theapplications home page.IO Control Demo1uses JavaScript running in the web browser to send HTTP requests for par-ticular special URLs.These special U
41、RLs are intercepted in the?le system support layer(lmi_fs.c)and used to control the LED and speaker PWM.Responses generated by the board are returnedto the browser and inserted into the page HTML dynamically by more JavaScript code.IO Control Demo2uses standard HTML forms to pass parameters to CGI(C
42、ommon GatewayInterface)handlers running on the board.These handlers process the form data and control thePWM and LED as requested before sending a response page(in this case,the original form)back tothe browser.The application registers the names and handlers for each of its CGIs with the HTTPDserve
43、r during initialization and the server calls these handlers after parsing URL parameters eachtime one of the CGI URLs is requested.Information on the state of the various controls in the second demo is inserted into the served HTMLusing SSI(Server Side Include)tags which are parsed by the HTTPD serv
44、er in the application.Aswith the CGI handlers,the application registers its list of SSI tags and a handler function with theweb server during initialization and this handler is called whenever any registered tag is found in a.shtml,.ssi or.shtm?le being served to the browser.Note that the web server
45、 used by this example has been modi?ed from the example shipped withthe basic lwIP package.Additions include SSI and CGI support along with the ability to have theserver automatically insert the HTTP headers rather than having these built in to the?les in the?lesystem image.For additional details on
46、 lwIP,refer to the lwIP web page at:2.14Ethernet with lwIP(enet_lwip)This example application demonstrates the operation of the Stellaris Ethernet controller using thelwIP TCP/IP Stack.DHCP is used to obtain an Ethernet address.If DHCP times out withoutobtaining an address,AUTOIP will be used to obt
47、ain a link-local address.The address that isselected will be shown on the OLED display.The?le system code will?rst check to see if an SD card has been plugged into the microSD slot.Ifso,all?le requests from the web server will be directed to the SD card.Otherwise,a default set ofpages served up by a
48、n internal?le system will be used.For additional details on lwIP,refer to the lwIP web page at:10March29,2010Example Applications 2.15Ethernet with PTP(enet_ptpd)This example application demonstrates the operation of the Stellaris Ethernet controller using thelwIP TCP/IP Stack.DHCP is used to obtain
49、 an Ethernet address.If DHCP times out withoutobtaining an address,AUTOIP will be used to obtain a link-local address.The address that isselected will be shown on the OLED display.A default set of pages will be served up by an internal?le system and the httpd server.The IEEE1588(PTP)software has bee
50、n enabled in this code to synchronize the internal clock toa network master clock source.Two methods of receive packet timestamping are implemented.The default mode uses the Stellarishardware timestamp mechanism to capture Ethernet packet reception time using timer3B.On partswhich do not support har
51、dware timestamping or if the application is started up with the“Select”button pressed,software time stamping is used.For additional details on lwIP,refer to the lwIP web page at:For additional details on the PTPd software,refer to the PTPd web page at:2.16Ethernet with uIP(enet_uip)This example appl
52、ication demonstrates the operation of the Stellaris Ethernet controller using theuIP TCP/IP Stack.DHCP is used to obtain an Ethernet address.A basic web site is served overthe Ethernet port.The web site displays a few lines of text,and a counter that increments eachtime the page is sent.For addition
53、al details on uIP,refer to the uIP web page at:http:/www.sics.se/adam/uip/ 2.17GPIO JTAG Recovery(gpio_jtag)This example demonstrates changing the JT AG pins into GPIOs,along with a mechanism to revertthem to JTAG pins.When?rst run,the pins remain in JT AG mode.Pressing the select push buttonwill to
54、ggle the pins between JT AG mode and GPIO mode.Because there is no debouncing of thepush button(either in hardware or software),a button press will occasionally result in more thanone mode change.In this example,all?ve pins(PB7,PC0,PC1,PC2,and PC3)are switched,though the more typicaluse would be to
55、change PB7into a GPIO.2.18Graphics Example(graphics)A simple application that displays scrolling text on the top line of the OLED display,along with a4-bit gray scale image.March29,201011Example Applications2.19Hello World(hello)A very simple“hello world”example.It simply displays“hello world”on the
56、 OLED and is a startingpoint for more complicated applications.2.20Interrupts(interrupts)This example application demonstrates the interrupt preemption and tail-chaining capabilities ofCortex-M3microprocessor and NVIC.Nested interrupts are synthesized when the interrupts havethe same priority,increasing priorities,and decreasing priorities.With increasing priorities,pre-emption will occur;in the other two cases tail-chaining will occur.The currently pending interruptsand the currently executing interrupt will be display
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 腦血管造影術(shù)簡介及術(shù)后護理
- 遼寧省朝陽市多校2024-2025學(xué)年高一下學(xué)期6月聯(lián)合考試物理試卷(含解析)
- 情境教學(xué)深化高中生物學(xué)概念學(xué)習(xí)的課例研究
- 口服藥相關(guān)知識培訓(xùn)課件
- 2025年度企業(yè)研發(fā)項目保密協(xié)議與技術(shù)成果權(quán)歸屬合同
- 中藥灌腸技術(shù)
- 2025年學(xué)生校園體育設(shè)施租賃與使用合作協(xié)議
- 2025年跨境電商全程物流與供應(yīng)鏈綜合管理服務(wù)協(xié)議書
- 2025年農(nóng)產(chǎn)品溯源體系建設(shè)與采購合作合同模板
- 2025年學(xué)生托管與心理輔導(dǎo)一體化服務(wù)合同
- 中國兒童嚴重過敏反應(yīng)診斷與治療建議
- Excel必知必會第一期
- KW分布式光伏電站技術(shù)方案
- 私募基金管理人-廉潔從業(yè)管理制度
- 2025年銷售總監(jiān)面試試題及答案
- 攝像基礎(chǔ)知識入門
- 2025-2030全球PCBA納米涂層行業(yè)調(diào)研及趨勢分析報告
- 2024年老年脆性骨折護理(最終版本)
- 《工程勘察資質(zhì)標準(征求意見稿)》
- 體檢中心溝通技巧課件
- 佛吉亞卓越體系知識手冊
評論
0/150
提交評論