



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




THE INTERNATINONAL UNIVERSITY (IU) – VIETNAM NATIONAL UNIVERSITY – HCMC Midterm Examination Date: 20/04/2020. Duration: 3 days Group Numer : 1 Student Name : … Đặng Chí Hào …… Student ID: ……… EEEEIU15004 ………… Student Name : ……Nguyễn Bá Trình…… Student ID: ……EEEEIU16083……… Student Name : …………………………… Student ID: …………………………………… SUBJECT: Real-Time Embedded Systems Dean of School of Electrical Engineering Signature: Full name: Dr. Mai Linh Lecturer: Vo Minh Thanh Signature: Full name: Vo Minh Thanh INTRODUCTIONS:
Q2. Draw the Unified Modeling Language (UML) activity diagram of the embedded system design process.
Q4. Refer to LPC1768 datasheet, LPC 1768 Manual to answer briefly the functions of GPIO Registers for Port 1 (FIO1DIR, FIO1MASK, FIO1PIN, FIO1SET, and FIO1CLR). 1) FIODIR : This is the GPIO direction control register. Setting a bit to 0 in this register will configure the corresponding pin to be used as an Input while setting it to 1 will configure it as Output. 2) FIOMASK : This gives masking mechanism for any pin i.e. it is used for Pin access control. Setting a bit to 0 means that the corresponding pin will be affected by changes to other registers like FIOPIN, FIOSET, FIOCLR. Writing a 1 means that the corresponding pin won't be affected by other registers. 3) FIOPIN : This register can be used to Read or Write values directly to the pins. Regardless of the direction set for the particular pins it gives the current start of the GPIO pin when read. 4) FIOSET : It is used to drive an 'output configured pin to Logic 1 i.e HIGH. Writing Zero does NOT have any effect and hence it cannot be used to drive a pin to Logic 0 i.e LOW. For driving pins LOW FIOCLR is used which is explained below. 5) FIOCLR : It is used to drive an 'output' configured pin to Logic 0 i.e LOW. Writing Zero does NOT have any effect and hence it cannot be used to drive a pin to Logic 1. Q5. Suppose you are using LPC 1768 microcontroller, write a short C code to initiate Port 1 Pin 28 as output.
Q6. Suppose you are using LPC 1768 microcontroller, write a short C code to initiate Port 2 Pin 6 as input.
Q7. Suppose you are using LPC 1768 microcontroller, write a function short C code to set (assign 1) and reset (assign 0) port 1 pin 28.
Q8. Suppose you are using LPC 1768 microcontroller, write a program to configure P0.2 as Input to interface with a button using internal pull-up resistor. P0.6 is configured as output and connected to LED. If Input for P0.2 is a 'Low' then set output for P0.6 is made High for 5 seconds and then made Low.