150 likes | 239 Views
Safety dB Meter Software Review. ETec 474 By Polly Leung. Kernel Selection and Task/ISR Design. MicroC/OS-II StartTask KeyTask UITask OSTickISR. StartTask. Priority 4 Initialization Create other tasks Once only. KeyTask. Priority 5 It is for detecting and verifying key presses.
E N D
Safety dB Meter Software Review ETec 474 By Polly Leung
Kernel Selectionand Task/ISR Design • MicroC/OS-II • StartTask • KeyTask • UITask • OSTickISR
StartTask • Priority 4 • Initialization • Create other tasks • Once only
KeyTask • Priority 5 • It is for detecting and verifying key presses. • Period=10ms • Average execution time =3.3us • Peak execution time=16.6us • It is written by Profession Morton, and I modified it to fit my project.
UITask • Priority 7 • This task handles the data come from the ATD port. • It modulates the pulse width output to the LCD and turns LEDs on and off. • Periodic • Period=50ms • Estimated peak execution time= 1ms
OSTickISR • MicroC/OS-II clock ticks • OSTimeDly()
CPU Load • Worst case = 16.6us/10ms+ 1ms/50ms = 0.0217
Module/Library Description • dBmeter.c • Key.c • PWM.c • AToD.c
Main ( ) StartTask( ) UITask( ) Key Level Peak dBmeter.cFunctions Variables
KeyInit( ) KeyPend( ) GetKey( ) KeyTask( ) KeyScan( ) KeyBuffer key cur_key button err Key.cFunctionsVariables
PWMInit( ) ChangePWM( ) Intensity PWM.cFunctionsVariables
AToDInit( ) AToDRead( ) level AToD.cFunctionsVariables
Key Module Pushbuttons Functions Tp KeyInit( ) KeyTask( ) Key.buffer KeyPend( ) Key.flag
KeyTask( ) KeyPend( ) UITask Key.buffer OSSemPost( ) Key.flag OSSemPend( )
A-to-D I/O Function A to D converter AN0 AToDRead( ) ATDDR0 PAD00