Professional Documents
Culture Documents
Lesson-1: Design Examples and Case Studies of Program Modeling and Programming With Rtos - 1
Lesson-1: Design Examples and Case Studies of Program Modeling and Programming With Rtos - 1
Lesson-1
CASE STUDY OF EMBEDDED SYSTEM
DESIGN AND CODING FOR AN
AUTOMATIC CHOCOLATE VENDING
MACHINE (AVCM) USING µC/OS-II
RTOS
λ Priority ─ 9
λ Action─ Waits for the coins and action
as per coins collected
λ IPC pending: Event signal (s) from
Port_1, Port_2 and Port_5;
SemStimeout,
λ IPC posted: *MboxAmount
Chapter-11 L01: "Embedded Systems - Architecture,
2008 Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, 39
Inc.
Task_Collect
λ Priority ─ 11
λ Action─ Waits for coins = or > cost till
timeout and act accordingly
λ IPC pending: SemFlag1;
*MboxAmount
λ IPC posted: SemFlag2, SemFlag3,
*MboxAmount, *Str1
Chapter-11 L01: "Embedded Systems - Architecture,
2008 Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, 40
Inc.
Task_Deliver
λ Priority ─ 12
λ Action─ Waits for SemFlag2, delivers
chocolate, and decreases coins’ amount
after delivery
λ IPC pending: SemFlag2
λ IPC posted: SemFlag2, *Str2
λ Priority ─ 17
λ Action─ Waits for refund event and
refunds the amount
λ IPC pending: SemFlag3
λ IPC posted: *Str3
λ Priority ─ 13
λ Action─ Refunds the Excess excess
amount
λ IPC pending: SemFlag2,
*MboxAmount
λ IPC posted: *Str4
λ Priority ─ 15
λ Action─ Waits for the message mails
and display as per message
λ IPC pending: *collect, *delivered,
*refund, *excessRefund, Str2, Str3,
Str4 and *TimeDate
λ IPC posted: ─
Chapter-11 L01: "Embedded Systems - Architecture,
2008 Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, 44
Inc.
10. Coding using µC/OS-II RTOS