Question

Hi,

Please can anyone help me to solve this question in ARM assembly language ASAP??

Thank you,

Task 4 On the Cornish, there is a pedestrian traffic light with a push button. Under normal condition, the green light is on for the cars to go, and the pedestrian light is red. When a pedestrian wants to cross, he/she presses on the push button and the red light turns on for the cars and green for pedestrian. Design this traffic light controller No request Initial state Green Request Yellow Red

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include lpc21xx.h
int main()
{
int i;
PINSEL0=0x00000000; //port 0 set to GPIO
IO0DIR=0x00000001; // 0th bit of port 0 will act as o/p for green light
IO1DIR=0x00000001; // 1st bit of port 0 will act as o/p for yellow light
IO2DIR=0x00000001; // 2nd bit of port 0 will act as o/p for red light

PINSEL2=0x00000000; //Port 1 as GPIO
IO1DIR=0x00000000;
while(1)
{
   if((0x00010000&IO1PIN)==0x00000000) //giving input at p1.16
   {
       IO1SET=0x00000001; // anode of led is connected to 0th bit of Port0
       for(i=0;i<100000;i++); //to create some delay(give delay of 1 ms)
       // adjust the value according to your oscilator frequency
       IO0SET=0x00000010; //turning yellow ON 1st pin of port 0
       for(i=0;i<100000;i++); //to create some delay (give delay of 1 sec)
       IO0CLR=0x00000010; //turning yellow off
       IO0SET=0x00000100; //turning red ON 2nd pin of port 0
       for(i=0;i<100000;i++); //give delay of 5 sec
       IO0CLR=0x00000100; //turning red off
      
   }
   else
   {
   IO1CLR=0x00000001;
   }
  
      
}

Add a comment
Know the answer?
Add Answer to:
Hi, Please can anyone help me to solve this question in ARM assembly language ASAP?? Thank...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • ARM assembly lang please write code Street Crossing - This consists of a street light (red,yellow,green...

    ARM assembly lang please write code Street Crossing - This consists of a street light (red,yellow,green row of LEDs), and a separate red and green led (walk/dont walk) and a button. When the button is pressed, the red lights light up and the green indicator for walk lights up. Eventually the green and yellow will flash saying time to walk is over, then the red for dont walk lights up, and green for traffic lights up.

  • ARM assembly lang please write code Street Crossing - This consists of a street light (red,yellow,green...

    ARM assembly lang please write code Street Crossing - This consists of a street light (red,yellow,green row of LEDs), and a separate red and green led (walk/dont walk) and a button. When the button is pressed, the red lights light up and the green indicator for walk lights up. Eventually the green and yellow will flash saying time to walk is over, then the red for dont walk lights up, and green for traffic lights up.

  • Can someone please show me a circuit diagram so i can see how to construct this...

    Can someone please show me a circuit diagram so i can see how to construct this on a bread board i am id 6 yhanks in advance EEET-2251: Course & Projoct Guide 2018 EEET-2251: Cousc &Projoct Guide 2018 affic Light Controller A single switch must set your HC74 based state machine to the initial state (the U state This lab will get you to design a simple controller for a pedestrian crossing based on synchronous digital logic. You will master...

  • please help and answer all ASAP please thank you so much Question 49 (1 point) When...

    please help and answer all ASAP please thank you so much Question 49 (1 point) When light travelling in glass enters glass with a higher index of refraction, the wave will be: a) partially transmitted with a change in phase b) transmitted forming a standing wave pattern in air c) reflected so as to form a node at the junction d) totally reflected at the junction e) partially reflected without a change in phase Question 38 (1 point) The charge,...

  • Can someone please read this case for me and answer this question and thank you. 1....

    Can someone please read this case for me and answer this question and thank you. 1. Utilize the triple bottom line to measure Uber’s performance under Kalanick’s leadership. Make sure to incorporate examples from the case in your response. Uber - A Startup’s Origins and Early Days Case: Criticizing customers. Short-changing workers. Sassing regulators. Deceiving authorities. Emphasizing rule breaking and ruthlessness in a “win at all costs” workplace culture. Is this what it takes to go from startup to a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT