Write a program to send the value 0X45 to PORTB and 0X54 to PORTC every 1/4 seco
ID: 3862650 • Letter: W
Question
Write a program to send the value 0X45 to PORTB and 0X54 to PORTC every 1/4 second. Assume a clock frequency of 1 MHz. Write a program that will monitor the PB4 bit until it becomes LOW; when it becomes LOW, write the value 0XFF to PORTD. Which register is affected by the execution of an arithmetic instruction? When using a conditional branch instruction, which register is checked for its status? What is the main difference between the rotate and shift instructions? Write a program that will add the values 0X45 and 0X20 and the sum is multiplied by 0X03 and the result is sent to PORTB Write a program that will find the position of the first low in an 8-bit data item. the data is scanned from D7 to D0. Give the result for 0XF4 How do you define constant values in assembly? Give an example. the different ways in which the CPU access data is known as the _. Match the instructions in the first column with their corresponding pair in the second column. How do you place fixed data into program ROM? How do you fetch data from program ROM? Write a program that will read the following message from ROM and place it in data RAM starting at 0X100 .ORG 0X500 MYMESSAGE: .DB "Programming in Assembly is fun!", 0 Write a program that will find y where y = 20x + 5, and x is between 0 and 5Explanation / Answer
1. In the atmega328p the total number of pins available for I/O port programming are 20 pins. Out of the 20 pins, 14 pins are digital I/O pins and 6 are analog I/O pins.
2. In the Arduino board 0 to 5 analog pins that means 6 pins are available for I/O port programming.
3. In DDrx register, DDR means Data Direction Register and x indicates port alphabet. The purpose of this register is to set the direction of port pins to be either input or output.
The DDrx register can be used as, if for the input set 0 and output set 1, the we set DDRB as DDRB=0x0F. The upper four pins are set as inputs and lower four pins are set as outputs.
4. PINx is a 8-bit read data register which stores the logic value, current state of physical pins on Portx. The purpose of PINx register is that if we need to read the values on the Portx, we read the values that are in PINx register. It only reads and returns the actual values of the pins.
9. The carry flag register is mostly affected by the execution of an arithmetic instruction.
11. The main difference between rotate and shift instruction is that though both the instructions are used for moving the bit strings, Shift instruction move a bit string to the right or left with excess bits discarded. The Rotate instructions are similar to shift instructions except that, they are circular with the bits shifted out one end returning on the other end. The rotates can be to the left or right.
14. The constant value in assembly is defined by using EQU directive. The syntax is
CONSTANT_NAME EQU expression
For example, TOTAL_STUDENTS equ 30
15. The different ways in which the CPU access data is known as addressing modes.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.