Question

Write an assembly program that toggles a LED connected to pin4 of PORTB with a custom...

Write an assembly program that toggles a LED connected to pin4 of

PORTB with a custom delay time.

Homework Answers

Answer #1

; Main Program

CPL PB4 // compliments value at pin 4 of PORT B

ACALL Wait // calls wait function

SJMP Start

Wait : MOV R4 , #05H // puts value 05H in R4  

Wait1 : MOV R3 , #00H // puts value 00H in R3

Wait2: MOV R2 , #00H //puts value 00H in R2

Wait3 : DJNZ R2,Wait3

DNJZ R3,Wait2

DNJZ R4,Wait1

RET

Hope this helps. If you have any queries or suggestions regarding the answers please leave them in the comments section so I can update and improve the answer. Thank you.

  

Know the answer?
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
Similar Questions
open atmell studio and write an assembly program that toggels a 8 leds for differnt collor...
open atmell studio and write an assembly program that toggels a 8 leds for differnt collor connected to portB with a custom delay time i want the code of this program
Write a microcontroller assembly program that makes the PORTB output and that blinks with a certain...
Write a microcontroller assembly program that makes the PORTB output and that blinks with a certain delay. The delay is between 250ms and 1000ms. You should use infinite loop.
Write the Assembly Code for PIC16F84A microcontroller to read a switch connected to Bit 2 of...
Write the Assembly Code for PIC16F84A microcontroller to read a switch connected to Bit 2 of PORTB. You will need to first set the pin to an input, then test whether the pin is 0 ( switch closed, if so go to existing program at label SWITCH If not the program is to continue: Add comments to each line to explain what the code does.
Write a program to count number between 0 and 255 in binary using 8 LEDs connected...
Write a program to count number between 0 and 255 in binary using 8 LEDs connected to the Arduino. This code should start at 0 and loop back to 0 once it counts to 255. Delay 0.25s between counts.
Write a program for the msp430FR6989 to make led1 and led 2 alternate blinking 2. repeat...
Write a program for the msp430FR6989 to make led1 and led 2 alternate blinking 2. repeat the program to make each led blink 5 times in a sequence, then 5 times simultaneously
Write an assembly language program that will implement the following:       If ( (AX >=BX) AND (CX...
Write an assembly language program that will implement the following:       If ( (AX >=BX) AND (CX < DX) ) goto LoopA Else go to LoopB (Here I want you to write the whole assembly program that could run in CMD. THANK YOU
Write assembly code to create a 1 sec delay time by using Timer2?
Write assembly code to create a 1 sec delay time by using Timer2?
Write an assembly program to count the binary ones in register R1.   
Write an assembly program to count the binary ones in register R1.   
Write an assembly language program that reverses all the bits of a 32-bit number. (Without using...
Write an assembly language program that reverses all the bits of a 32-bit number. (Without using RBIT instruction) Write an assembly language program that checks whether an unsigned number is perfect square or not.
Write an Assembly program that will produce all divisors for a 1-digit decimal number. For example,...
Write an Assembly program that will produce all divisors for a 1-digit decimal number. For example, if the number is 6, then the outputs will be 1,2,3,6 which are the divisors of 6. ASSEMBLY program
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT