1=Write a program in C to get 16-bit data from Port-D and send it to ports Port-B
2-Write instructions in C to toggle both bits RD7 and RD0 continuously
3-Write instructions in C to get the status of RB2 and put it on RB0
4-Code a simple program in C to send 3499H to Port B and Port D.
1)
DDRD = B11111110; // sets Arduino pins 1 to 7 as outputs, pin 0
as input
DDRD = DDRD | B11111100; // this is safer as it sets pins 2 to 7 as
outputs
// without changing the value of pins 0 & 1, which are RX &
TX
2)
BCF TRISD, 0
BCF TRISD, 7
H2 BTG PORTD, 0
BTG PORTD, 7
BRA H2
3)
BSF TRISB, 2
BCF TRISB, 0
AGAIN BTFSS PORTB, 2
BRA OVER
BSF PORTB, 0
BRA AGAIN
OVER BCF PORTB, 0
BRA AGAIN
4)
MOVLW 0x3499
MOVWF PORTB
MOVWF PORTD
PLEASE UPVOTE
1=Write a program in C to get 16-bit data from Port-D and send it to ports...
04. a) Write an 8051 C program to send values 00 through FFH to port Pl. b) Write an 8051 C program to send values -3 to +3 to port P1. c) Write an 8051 C program to toggle all bits of P1 (between 55H and AAH) with some delay d) A door sensor is connected to P1.1 and a buzzer to P1.7. Write an 8051 C program to monitor the sensor and when it opens (0') sound the buzzer...
19. Is the instruction "CPL Pi" a valid instruction? 20. Write a program to toggle P1.2 and P1.5 continuously without disturbing the rest of the bits. 21. Write a program to toggle P1.3, P1.7, and P2.5 continuously without disturb- ing the rest of the bits. 22. Write a program to monitor bit P1.3. When it is high, send 55H to P2. 23. Write a program to monitor the P2.7 bit. When it is low, send 55H and AAH to PO...
Lab Activity 2 Test the 8051's ports for input operation as follows: A) Connect each bit of Pl (P1.0-P1.7) of the 8051 to DIP switches of your development kit. Connect each bit of P2 (P2.0-P2.7) of the 8051 to LED indicators of your development kit. B) Write and run a program to get data from Pl and send it to P2. Any change of status of the switches connected to P1 will be instantly reflected on LEDS connected to P2....
Write a program to get data from the SFRs of PORT A. Add the decimal value 5 to it and send it to the SFRs of PORT C. (AVR microcontroller)
17. Write a C program to toggle bits PB1 and PB7. - 18. Write a C program to toggle only bit PBO. 19. Write a C program to count up PORTB from 0-99 continuously.
Consider a hypothetical microprocessor generating a 16-bit address (for example, assumethat the program counter and the address registers are 16 bits wide) and havinga 16-bit data bus.a. What is the maximum memory address space that the processor can access directlyif it is connected to a “16-bit memory”?b. What is the maximum memory address space that the processor can access directlyif it is connected to an “8-bit memory”?c. What architectural features will allow this microprocessor to access a separate“I/O space”?d. If...
Goal: To become familiar with using Port A and Port H as input ports H as an input port and port B as an output port, using dragon12-Light boards as well as to improve your programming skills.Project: Write an assembly program and a C program to do the following:When DIP switch #8 is high and #1 is low, turn on all the even numbered LEDs and let them stay on even after the switch #8 is changed to low.When DIP...
Write a C program that uses the bitwise shift operators to shift the bits to the right >> or the left > m; /* This shifts m bits to the right, and the m least significant bits are lost.*/ The following statements are the same. num = num >> 3; num >>= 3; Show the operation in binary by calling the following function as defined in 3.1, void to_binary(unsigned int n); The function converts decimal to binary and outputs the...
Using network sockets, write a C program called client that receives three command-line arguments in the form: client host port file and sends a request to a web server. The command-line arguments are hostRepresents the web server to connect to port Represents the port number where a request is sent. Normally an HTTP request is sent over port 80, but this format allows for custom ports file Represents the file requested from the web server Your program should create a...
4. In this problem you will use CodeWarrior to develop the code to implement a three-light traffic signal. The program should do the following: a. Turn on a green LED attached to Port B bit 2 for 60 seconds, b. Turn off the green LED and turn on a yellow LED attached to Port B bit 1 for 30 seconds, c. Turn off the yellow LED and turn on a red LED attached to Port B bit 0 for 60...