CBC下寫的串口編程,API函數實例
I wish this site had been around when I was trying to figure out how to make serial communications work in Windows95. I, like many programmers, was hit with the double-whammy of having to learn Windows programming and Win95 serial comm programming at the same time. I found both tasks confusing at best. It was particularly frustrating because I had, over the years, written so much stuff (including lots of serial comm software) for the DOS environment and numerous embedded applications. Interrupt driven serial comm, DMA transfer serial comm, TSR serial comm, C, assembler, various processors... you name it, it had written it. Yet, everything I knew seemed upside-down in the message-driven-callback world of Windows.
This example program shows how to configure and use the A/D Converter of the following microcontroller:
STMicroelectronics ST10F166
After configuring the A/D, the program reads the A/D result and outputs the converted value using the serial port.
To run this program...
Build the project (Project Menu, Build Target)
Start the debugger (Debug Menu, Start/Stop Debug Session)
View the Serial Window (View Menu, Serial Window #1)
View the A/D converter peripheral (Peripheral Menu, A/D Converter)
Run the program (Debug Menu, Go)
A debug script (debug.ini) creates buttons that set different analog values in A/D channels. As the program runs, you will see the A/D input and output change.
Other buttons create signals that generate sine wave or sawtooth patterns as analog inputs. µ Vision3 users may enable the built-in Logic Analyzer to view, measure and compare these input signals graphically.
The project KEIL_IODemo shows how to use memory allocation routines (malloc) and char I/O (printf, scanf) via a serial interface with the Keil ARM toolchain.
The I/O functions are adapted for the Analog Devices ADuC7000 series using the SERIAL.C module.
The example also shows the efficiency of the Keil CA ARM Compiler run-time library which is tuned for single chip systems.
UART I/O and Memory Allocation Example for GNU
The project GNU_IODemo shows how to use memory allocation routines (malloc) and char I/O (printf, scanf) via a serial interface with the GNU toolchain.
The I/O functions are adapted for the Analog Devices ADuC7000 series using the SERIAL.C module.
The example also shows the efficiency of the Keil CA ARM Compiler run-time library which is tuned for single chip systems.
物流分析工具包。Facility location: Continuous minisum facility location, alternate location-allocation (ALA) procedure, discrete uncapacitated facility location
Vehicle routing: VRP, VRP with time windows, traveling salesman problem (TSP)
Networks: Shortest path, min cost network flow, minimum spanning tree problems
Geocoding: U.S. city or ZIP code to longitude and latitude, longitude and latitude to nearest city, Mercator projection plotting
Layout: Steepest descent pairwise interchange (SDPI) heuristic for QAP
Material handling: Equipment selection
General purpose: Linear programming using the revised simplex method, mixed-integer linear programming (MILP) branch and bound procedure
Data: U.S. cities with populations of at least 10,000, U.S. highway network (Oak Ridge National Highway Network), U.S. 3- and 5-digit ZIP codes
GDB Remote Stub Backend for debugging an embedded ARM system via JTAG common hardware debug interface. Communication is done via standard TCP/IP GDB Remote Serial Protocol.