Sie sind auf Seite 1von 14

8/4/13

Education Center

Home Academics About Us Contact Us About me News

Embedded and Real-Time Systems << Miscellaneous Topics << Notes

Click Here to Download Micellaneous

www.peddi.in/view_lesson.php?brandid=74

1/14

8/4/13

Education Center

www.peddi.in/view_lesson.php?brandid=74

2/14

8/4/13

Education Center

www.peddi.in/view_lesson.php?brandid=74

3/14

8/4/13

Education Center

www.peddi.in/view_lesson.php?brandid=74

4/14

8/4/13

Education Center

Automatic Chocolate Vending Machine ( ACVM )


This example discusses the Functionality, Behavioral Description and Hardware Architecture of an Automatic Chocolate Vending Machine. The design and development of the software for this Embedded System is organized by creating 6 tasks, which perform in an Real-time Operating System environment ( discussed in Miscellaneous Topics ).

Functionality : The ACVM accepts coins in the denominations of Rs. 1 , Rs. 2 and Rs.5 in three independent slots.
When sufficient money is inserted, this machine delivers a chocolate. This machine should take of other possibilities like, inserting insufficient amount, inserting more amount than the cost of the chocolate etc. A Display unit should guide the buying process of chocolate.

Behavioral Description :
(1) When a child inserts coin into the coin slot machine to buy a chocolate, the first coin into the machine generates a trigger pulse. This trigger pulse serves as a start signal for the coin slot machines built-in timer. This timer is designed for a 2 minute count-down, using hardware
www.peddi.in/view_lesson.php?brandid=74 5/14

8/4/13

timer is designed for a 2 minute count-down, using hardware ( this 2 minute time is fixed through hardware ) . Timers countdown starts upon receiving the signal (trigger pulse ). The child is expected to insert balance amount within two minutes , to get his chocolate. (2) The coin slot machine has three dedicated 8-bit registers ( R1, R2, R5 ) for denominations of Rs. 1, Rs. 2 and Rs. 5 respectively. These registers store the information bout the number of coins inserted. When the child inserts a coin for example , a Five rupee coin, then the R5 registers D0 bit is set to 1. If the child inserts a second 5 Rupee coin, then the D1 bit of the same register ( R5) is set to 1, indicating that the child has inserted 2 coins of 5 rupee denomination. As a result, the content of R5 is 0000 0011. The inserted coins are routed to a coin box for the collection by the owner of ACVM. Thus the insertion of coins in the coin-slot-machine generated data in the three registers. (3) Within two minutes if the child inserts the balance amount ( cost of the chocolate) , the following tasks are performed : The coin slot machine transfers the contents of R1, R2 and R5 ( 3 bytes ) to the microcontroller through a parallel port P1. A software program task compute the amount received by the ACVM. {amount =( number of 1s in R1 *1 )+( number of 1s in R2 * 2) +( number of 1s in R5 * 5)} This amount is compared with the cost of the chocolate. If the amount = the cost of the chocolate, the microcontroller sends a message to the display unit using Port 3. The display unit displays : Please wait chocolate will be delivered shortly Concurrently, the microcontroller uses its Port pin P0.2 to send signal to the chocolate delivery machine to deliver the chocolate. After the chocolate is delivered into the chocolate collect bowl, the microcontroller sends a message to the display unit and a message appears : Please collect the chocolate . Thank You. Visit again If the amount is > than the chocolate , the microcontroller signals the mount refunding system through Port pin P0.3 - and the excess amount is refunded along with the chocolate with a message: Please collect the chocolate & excess refund amount. Thank You. Visit Again (4) Within two minutes if the child fails to insert the balance amount OR if the child inserts some more coins; but the net amount is less than the cost of the chocolate: The microcontroller performs a task that displays a message: Please insert the balance amount and waits for 30 seconds. [ using its timer ] If there is not response from the child, the coin-slot-machine system signals the microcontroller. Upon receiving the signal, the microcontroller switches to perform a task that refunds the mount inserted by the child with a message on the display : Insufficient amount inserted. Amount refunded. Please collect your money. Try again Bye.

Education Center

Hardware Architecture :
The proposed Hardware Architecture of the ACVM is shown below.

www.peddi.in/view_lesson.php?brandid=74

6/14

8/4/13

Education Center

**************************************************************************************************** The Software Architecture of ACVM is shown in the figure below. The software is decomposed into 6 tasks namely, (1) READPORTS TASK, (2) COLLECT TASK, (3) DELIVERY TASK, (4) REFUND TASK, (5) EXCESS REFUND TASK, ( 6) DISPLAY TASK .

These tasks work using Micro-C -II Operating System.

........................................................................................................................................................................................................

www.peddi.in/view_lesson.php?brandid=74

7/14

8/4/13

Education Center

........................................................................................................................................................................................................

www.peddi.in/view_lesson.php?brandid=74

8/14

8/4/13

Education Center

www.peddi.in/view_lesson.php?brandid=74

9/14

8/4/13

Education Center

www.peddi.in/view_lesson.php?brandid=74

10/14

8/4/13

Education Center

www.peddi.in/view_lesson.php?brandid=74

11/14

8/4/13

Education Center

To receive any Clarification in this Unit, fill the form below and submit.
[The Clarification will be mailed to you.]

*Name: *Roll Number : *Email Id: *Type Matter in the Box below for clarification:

www.peddi.in/view_lesson.php?brandid=74

12/14

8/4/13

Education Center

To receive any Clarification in this Unit, fill the form below and submit.
[The Clarification will be mailed to you.]

*Name: *Roll Number : www.peddi.in/view_lesson.php?brandid=74

13/14

8/4/13 *Roll Number :


*Email Id: *Type Matter in the Box below for clarification:

Education Center

Home

About Our C enter

Academics

News and Events

About Me

www.peddi.in/view_lesson.php?brandid=74

14/14

Das könnte Ihnen auch gefallen