6 3 Problem (P),(P3),(P4) University of Electronic Science Technology of China(UESTC) P2:How to organize and design the software architecture on the top of uc/OS II >DFD(Data Flow Diagram) >Task structure ☐P3:How to( drive t the steering e engine to turn Left/Right? Given a turning a angle,How to implement the "turning"command? P:How to determine the turning angle in each adjustment Real-Time Systems Lab
6 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 3 Problem (P2 ), (P3 ), (P4 ) P2 : How to organize and design the software architecture on the top of uc/OS II ? DFD (Data Flow Diagram) Task structure P3 : How to drive the steering engine to turn Left/Right? Given a turning angle, How to implement the “turning” command? P4 : How to determine the turning angle in each adjustment ?
4 Implement the above design on the top of uC/OSII University of Electronic Science Technology of China(UESTC) APIs provided by the uC/OS II? Task management:OSTaskCreate ( Mail Box: OSMBoxCreate OSMBoxPost OSMBoxPend ( >Synchronize:OSSemCreate() OSSemPost O OSSemPend ( Mutex:OSMutexCreate ( OSMutexPost ( OSMutexPend ( >Interrupt:OSVectSet ( a111 Real-Time Systems Lab
7 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 4 Implement the above design on the top of uC/OSⅡ Task management: OSTaskCreate () Mail Box: OSMBoxCreate () OSMBoxPost () OSMBoxPend () Synchronize: OSSemCreate () OSSemPost () OSSemPend () Mutex: OSMutexCreate () OSMutexPost () OSMutexPend () Interrupt: OSVectSet () ...... ...... APIs provided by the uC/OSⅡ?
8 4 Implement the above design on the top of uC/OS II University of Electronic Science Technology of China(UESTC) Interfaces for ultrasonic MCF_GPIO_PORTDD&=~Trig /produce a 20us pulse >TestTimeSum=Gettime[1]-Gettime[0]//Calculate the distance Interfaces for PWM OSSpeeddown O OSSpeedup ( OSTurnLeft ( OSTurnRight ( ■Interfaces for LCD LCDWcmd ( /Determine the position on the LCD LCDWdata ( /Display the given information LCDShowChar ()/Display the detected distance Real-Time Systems Lab
8 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 4 Implement the above design on the top of uC/OSⅡ MCF_GPIO_PORTDD&=~Trig // produce a 20us pulse TestTimeSum=Gettime[1]-Gettime[0] //Calculate the distance Interfaces for ultrasonic OSSpeeddown () OSSpeedup () OSTurnLeft () OSTurnRight () Interfaces for PWM LCDWcmd () // Determine the position on the LCD LCDWdata () // Display the given information LCDShowChar () // Display the detected distance Interfaces for LCD
9 5 How to design a more perfect control system? University of Electronic Science Technology of China(UESTC) More sensors(A group of photoelectric sensors) More tasks Perfect control algorithm Optimize your program Responsibility,Stability Other control applications ▣Q&A Real-Time Systems Lab
9 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 5 How to design a more perfect control system? More sensors (A group of photoelectric sensors) More tasks Perfect control algorithm Optimize your program Responsibility, Stability Other control applications …… Q & A