Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!