In a twinkling of an eye, my junior year is coming to an end, and my college life is coming to an end. Because I am interested in software, I may be away from my major (Electronic Information Science and Technology) after graduation; I also participated in electronic design competitions during my college career. During the competition, I was mainly responsible for Single-Chip MicrocomputerProgramTherefore, we are familiar with the MSP430 Series single-chip microcomputer.ArticleI mainly introduce my understanding of 430 single-chip microcomputer, sort out the program I wrote earlier, and generate a universal 430 library.
My initial contact with MSP430 came from the book "Design and Practice of MSP430 Series Single Chip Microcomputer System" published by the Mechanical Industry Publishing House. I started to participate in the electronic design competition during my sophomore summer vacation, before the holiday, I heard that the competition used msp430f169 single-chip microcomputer. Then I went to the library to find books about 430 single-chip microcomputer. There were not many books about this single-chip microcomputer. Fortunately, I borrowed this book; I wrote 430 Single-Chip Microcomputer Program style was greatly affected by this book.
Library organization: the Library solution contains multiple projects. Each project is a library and example for a unit (for example, UART asynchronous serial port), such as a library for asynchronous serial port, UART project, UART. c is the main librarySource code, UART. H is the corresponding header file. This header file must be included in use. Main. C is an example of use.Code.
When using the library, you only need the. c file and the corresponding. h file.
File organization: the C files of the library correspond to the H files one by one. The C file contains at least two header files, one of which is the 430 header file to use the hardware resources of the microcontroller, the other is the corresponding header file, such as UART. c starts
# Include <symbol x16x. h>
# Include "UART. H"
To prevent repeated inclusion of header files, the # define statement such as the beginning and end of UART. H is displayed:
# Ifndef _ uart_h
# DEFINE _ uart_h
# Endif/* _ uart_h */
Library usage: Step 1: first copy the c file and H file to the project folder; then add the c file to the project, right-click the project in the workspace on the left, select Add-> add files and select the added C file;
Finally, include the copied header file in the program file that calls the library function. After that, you can call the function in the library normally (if necessary, you can add it as stated in the H file ).
The library is currently intended to be written from an asynchronous serial port. Thank you for your support.
Author:Give me a drink
Source: http://Engin.cnblogs.com/
The copyright of this article is shared by the author and the blog Park. You are welcome to repost it. repost the text and indicate the source. Thank you.