Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a ) Given the circuit, explain how DDRL should be initialised. ( 2 marks ] b ) Assume DDRL has been initialised correctly, write the

a) Given the circuit, explain how DDRL should be initialised.
(2 marks]
b)
Assume DDRL has been initialised correctly, write the code to: i)
Turn ON LEDO and LED2 only.
Turn OFF LED1 and LED3 only.
[3 marks]
[3 marks]
ii) Turn OFF all LEDs at the beginning, check the switch and:
Create a blinking LED at pin PL5(LED3) every 100ms when the switch is open.
Turn on LED1, delay 150ms then turn on LED when the switch is closed.
Explain your code.
[8 marks]
c)
Assume DDRL has been initialised correctly, fill in the blank space "..." in the following program to produce a 2 Hz,40% duty cycle signal on LEDO:
int
main(void
DORL =
904I
However you initialised it above
PORTLI
=0x30;
PORTL &=0xF9; while (1)
PORTL |=
--- S
delay ms (..
D:
PORTL 8=
deaay ms...3
Explain your code.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions