Arm Lab 1 (LED Display)

Source: Internet
Author: User

(The following is the computer experiment of the school course "ARM embedded system structure and programming" 2012.5.16)

Experiment 1 arm Development Environment Experiment 1. Purpose 1) understand the ADT ide integrated development environment; 2) master the basic engineering settings and program compilation methods in the ADT ide integrated development environment; 3) master the BASIC program debugging methods in the integrated development environment of adt ide. 2. experiment content 1) familiar with ADT ide integrated development environment 2) Establish an leddemo project 3) set and compile the leddemo Project 4) debug the leddemo project 3. Experiment Device 1) hardware • JXARM9-2410 teaching lab box, Pc 2) software • Operating System, ADT ide 4. Lab step 1) Watch "Experiment 1. Avi"Video file 2) create a project 3) Create the leddemo. c file and edit the code 4) Create the ldscript file and edit the Code 5) set the project, refer "Experiment 1. Avi"6) compile the project, refer "Experiment 1. Avi"7) download and debug, refer "Experiment 1. Avi" 

About link script file 1) ldscript, used to guide program segment Organization during program connection 2) program segment: • Read-Only segment (available in ROM and RAM ): text, rodata • read/write segments (must be in Ram): Data, BSS sections {. = 0x30000000 ;. text :{*(. text )}. data :{*(. data )}. rodata :{*(. rodata )}. BSS :{*(. BSS)} _ eh_frame_begin __= .; _ eh_frame_end __= .; provide (_ stack = .);. debug_info 0 :{*(. debug_info )}. debug_line 0 :{*(. debug_line )}. debug_abbrev 0 :{*(. debug_abbrev )}. debug_frame 0 :{*(. d Ebug_frame)} about the hardware connection N, connect the power cord of the experiment box to the 220v AC outlet and connect it to the experiment box. N turn off the power switch of the lab box (on the left side of the lab box ). N connect one end of the trunk cable of the lab box to the computer and the other to the lab box. There are two Connection Methods: connect to the parallel socket above (simple JTAG socket, on the edge of the USB socket ), check the simple
The JTAG jumper must be short-wired with a patch cap to connect to the adt1000a simulator, the simulator to connect to the power supply, and connect to the JTAG interface above with a 20 PIN soft wire. Check the simple
JTAG jumper. The jumper CAP must be disconnected. N the above operations must be performed in the power-off status of the experiment box. Otherwise, it is easy to burn the lab box or computer parallel chip. If the simple JTAG jumper is short, use the simple JTAG interface in the lab box. (In this experiment, use the simple JTAG interface. You must select arm9simple in the program, if you use the standard JTAG interface, select arm9lpt) n. If the simple JTAG jumper is disconnected, use an external advanced simulator (arm9lpt) n to connect to the device correctly. Then, power the device on the device and observe the LCD, wait for the program to start to the following interface (the LCD is displayed as a green white text interface) to start the next operation jx2410 # About the experiment effect n if the experiment runs correctly, the six digital tubes in the lab box will display data from 0 to F and from F to 0. N modifying the delay function call values in a program changes the display speed. The larger the value, the slower the display speed. N modification program: different numbers are displayed on the six digital tubes.
For example
123456 experiment report requirements n Brief description of the basic process of compiling leddemo in the integrated development environment of ADT ide n Brief description of the role and writing rules of the link script file, comment the ldscript file n description of the program debugging process information: N jxarm9-2410-3 user manual authorization n ADT
User Manual (ADT → help → User Guide)

-----------------------------------------------------------------------------

Modified program:

# Define u8 unsigned charunsigned char seg7table [16] = {/* 0 1 2 3 4 5 6 7 */0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8,/* 8 9 a B C D E */0x80, 0x90, 0x88, 0x83, 0xc6, 0xa1, 0x86, 0x8e,}; unsigned int num = 0; unsigned char N [6]; unsigned char select [6] = {0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf}; void test_seg7 (void) {int I; Int J; int K; For (num = 1; num <0x999999; num + = 1) {TRANS (n, num); for (I = 0; I <10; I ++) {for (j = 0; j <6; j ++) {* (u8 *) 0x10000006) = select [J];/* display characters from 0 to f x // For (k = 0; k <6; k ++) {/* query table and output data */* (u8 *) 0x10000004) = seg7table [n [J];} // delay (10); k = 1000; while (k --) {;}} K = 1000; while (k --) {;}}} void trans (unsigned char N [], const unsigned int num) {int I; for (I = 0; I <6; I ++) {n [I] = num % 10; num = num/10;} return ;}

Running effect:

By slightly modifying the above program, you can output a fixed number of "123456" (very simple, the source code is not provided here)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.