Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an assembly code for the simulation below. The microcontroller is AT89C52. Code starts like that: org 00h mov p1, #00h mov p2, #00h mov

Write an assembly code for the simulation below. The microcontroller is AT89C52. Code starts like that:

org 00h mov p1, #00h mov p2, #00h mov p3, #00h mov dptr, #99h mov TMOD, #01h mov r2,#00h setb p1^1 setb p1^0 loop: mov TH0, #00h ; reset timer registers mov TL0, #00h setb p1^0 ; creating 10us pulse by trig pin mov r0,#10d djnz r0,$ ; wait 10 us clr p1^0 acall measure_time acall calculate_distance acall adjust_digits acall distance_control acall screen_write sjmp loop

image text in transcribed

LCD1 LM016L RN1 1 2 2 3 4 5 6 7 8 9 10 4 DD DI NOON 10k C1 U1 22pF 19 XTAL1 X1 CRYSTAL 18_XTAL2 C2 PO.O/ADO PO.1/AD1 PO.2/AD2 PO 3/AD3 PO.4/AD4 P0.5/AD5 PO.B/ADO PO.7/AD7 39 38 37 36 35 34 33 32 22pF 9 RST 29 PSEN 30 ALE 31 EA P2.0/A8 P2.1/A9 P2.2/A 10 P2.3/A 11 P2.4/A 12 P2.5/A13 P2.6/A 14 P2.7/A15 21 22 23 24 25 28 27 28 10 12 1 2 3 4 5 6 7 8 13 P1.0/T2 P1.1/T2EX P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 AT89C52 P3.0/RXD P3.1/TXD P3.2ANTO P3.3 INT1 P3.4/TO P3.5/T1 P3.6/WR 14 15 10 +5V Trigger Echo Gnd P3.7/RD_17 SONAR1 ULTRASONIC SENSOR LCD1 LM016L RN1 1 2 2 3 4 5 6 7 8 9 10 4 DD DI NOON 10k C1 U1 22pF 19 XTAL1 X1 CRYSTAL 18_XTAL2 C2 PO.O/ADO PO.1/AD1 PO.2/AD2 PO 3/AD3 PO.4/AD4 P0.5/AD5 PO.B/ADO PO.7/AD7 39 38 37 36 35 34 33 32 22pF 9 RST 29 PSEN 30 ALE 31 EA P2.0/A8 P2.1/A9 P2.2/A 10 P2.3/A 11 P2.4/A 12 P2.5/A13 P2.6/A 14 P2.7/A15 21 22 23 24 25 28 27 28 10 12 1 2 3 4 5 6 7 8 13 P1.0/T2 P1.1/T2EX P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 AT89C52 P3.0/RXD P3.1/TXD P3.2ANTO P3.3 INT1 P3.4/TO P3.5/T1 P3.6/WR 14 15 10 +5V Trigger Echo Gnd P3.7/RD_17 SONAR1 ULTRASONIC SENSOR

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_2

Step: 3

blur-text-image_step3

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

More Books

Students also viewed these Databases questions

Question

3. Review together your differences and similarities.

Answered: 1 week ago