Beijing Institute of Electronic Technology (BESTI)
Real Inspection report
Course: Information Security system Design Basic class: 1352
Name: Pan Heng Shi Zhiyu
Study No.: 20135209 20135204
Score: Instructor: Lou Jia Peng Experimental Date: 2015.11.17
Experiment level: Preview degree: Experiment time: 15:30~17:30
Instrument Group: 04,09 Compulsory/elective: Compulsory experiment serial number: 02
Experiment Name: 2.3 serial port programming
Experimental purposes and requirements:
1. understand the basic methods of serial programming in Linux environment.
2. Master The main properties of the terminal and set up methods familiar with the use of Terminal I/O functions.
3. Learn to use multi-threading to complete the serial port processing.
4. Learn, read and understand The code in 02_pthread 03_tty.
Experimental instrument:
Name |
Model |
Number |
Embedded experimental Platform |
Up-tech s2410/p270 |
1 |
PC Machine |
|
1 |
Experiment contents, steps and experience:
First, the contents of the experiment
Read the program source code, learning the use of terminal I/O functions, learning to apply multithreaded programming to the reception and transmission of the serial port program.
Second, the experimental steps
1. Read and understand the source code:
Go to the table of contents and use VI or another editor to read the source code.
2. Compile the application:
Run make to produce a term executable file.
02_pthread:
03_tty:
3. Download and debug
To the HyperTerminal window, use the NFS Mount Development host's/arm2410c1 to/host directory. Enter the Exp\basic\03_tty directory, run term, and observe the correctness of the running results.
02_pthread:
03_tty:
Third, the experimental experience
Experiment two is much simpler than experiment one, and through the reading of the experiment Instruction book, the existent problem can be solved basically. The computer is accurate, and sometimes the input
A very small imperceptible error can make the result impossible to get, so in the search for their own problems, but also meticulous.
Iv. Questions and understanding
- Understanding of the experimental process
(1) Why is the asynchronous serial I/O method inefficient?
Because each character has to be independently determined to start and end, characters and character putting may also have idle time of insufficient length.
(2) How does serial I/O reduce the signal connection?
Each character of the transmitted data is transmitted one after another, and the different bits of the data can be used to share the same transmission channel.
- Problems encountered during the experiment and solutions
(1) Questions:
Occurs when executing/.term:/dev/ttyso:no such file or directory
Solve:
Follow the experimental instructions in the HyperTerminal input: ln–sf/dev/tts/0/dev/ttys0 can be solved. (When you enter the statement given in the instruction book,
Because of the problem of case and o,0 distinction, it causes several times to come out of the results, and finally correct. )
Lab II Report 20135209 Pan Heng 20135204 Shi Zhiyu