Q1- Write code in C language(Atmel atmega32 avr microcontroller) (a)-Switches are connected to Port C and Port...

90.2K

Verified Solution

Question

Programming

Q1- Write code in C language(Atmel atmega32 avrmicrocontroller)
(a)-Switches are connected to Port C and Port B and LED’s withPORTD. Write a code to read input from
PortB and C and perform following.
Addition of both inputs, Subtraction, Multiplication, Division,And, Or, Nor,Xor.


(b)- A switch is connected to PD0 and LED’s to Port B and Port C.Write a code to perform following:
When switch is 0 send your roll number to Port B.
When Switch is 1, toggle PortC 20 times.

Answer & Explanation Solved by verified expert
4.5 Ratings (982 Votes)
AnsCodeainclude include include include include int mainDDRB 0 make portB input DDRC 0 make portCinput DDRD 0xff makeportD outputwhile 1 PORTD    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students