tutorbin

microprocessor and microcontroller homework help

Boost your journey with 24/7 access to skilled experts, offering unmatched microprocessor and microcontroller homework help

tutorbin

Trusted by 1.1 M+ Happy Students

WhatsApp Support

Get Instant
Online Homework Help
via WhatsApp

Get instant homework help from top tutors—just a WhatsApp message away. 24/7 hw help support for all your academic needs!

A
S
M
R
★★★★★
2M+ students trust TutorBin
Your WhatsApp Number
phone
or
⚡ Instant reply
🔒 100% private
👨‍🏫 Top tutors
🌍 All subjects
*Get instant homework help from top tutors—just a WhatsApp message away. 24/7 support for all your academic needs!
2M+ Students Helped24/7 Live SupportExpert TutorsAll Subjects CoveredInstant Response100% ConfidentialTop Rated ServiceMoney-back Guarantee2M+ Students Helped24/7 Live SupportExpert TutorsAll Subjects CoveredInstant Response100% ConfidentialTop Rated ServiceMoney-back Guarantee

Recently Asked microprocessor and microcontroller Questions

Expert help when you need it
  • Q1:7 [Extra credit: 10 pts] Write a program that subtracts 5 from 3. Show how the program will be stored in memory. What result do you expect to see on a hex display? Address Contents CommentSee Answer
  • Q2:Q6: (True/False) On Arduino ATmega328 micro-controller, analog input pins can also be used as digital (input or output) pins? A6:See Answer
  • Q3:Exercise 1 Figure 1 below shows the block diagram of a processor Integrated Circuit (IC). AVR CPU Oscillator 40H Crystal wேiintator Flash M 16 KB MCU C And Timing SRAM 1 KB EEPROM 5125 Iepet/Outpet Ports Interface PORTA PORTE PORT PORT Justification; ....... Tweew Counters d Timer USART SPI 1- Is the processor a microprocessor or microcontroller? TWI ISP Interrat Figure 1 The processor is: Microprocessor / Microcontroller ADC Justify your answer. 2- How many address lines are there required for the Flash Memory? There are ..address lines for the Flash Memory 3- How many address lines are there required for the the SRAM memory? There are address lines for the SRAM memory 4- The processor is a 16 bits processor. Does the processor require more instructions than the Cortex MO+ processor to perform 32 bits additions when the operands are stored in CPU internal registers? Justify your answer./nThe processor requires more clock cycles: Justification; 5- The Flash memory is a kind of RAM memory: True/False 6- Which of the following address ranges are possible for the Flash memory? Select ALL applicable. a- From Ox100 to 0x1FFF b- From 0x3000 to 0x3FFFFF c- From Ox5000 to 0x8FFF d- None of the above True/False 7- The Booting address of the processor is 0x2FFF. Which of the following address ranges can't be allocated to the RAM memory? Select ALL applicable. a- 0x2000 to 0x23FF b- 0x1000 to 0x13FF c- 0x000 to 0x3FF d- All of the above e- None of the above 8- What can be true about the Program Counter Register of this processor? a- It can be 4 bits width b- It can be 8 bits width c- It can be 9 bits width d- None of the above 9- Is it possible to interface the processor to an analog sensor? Select: Possible/Not possible. 10- The CPU has a multiplier that accepts two 16 bits operands and store the results into 24 bits special function register. For the multiplication of two unsigned numbers A and B, what would be the maximal value of B to avoid an overflow if A = 2¹4? (1 Mark)See Answer
  • Q4:Exercise 2 1- Answer the following: (a) How many nibbles are 16 bits? (b) How many bytes are 32 bits? (c) If a word is defined as 16 bits, how many words is a 64-bit data item? (d) What is the exact value (in decimal) of 1 meg? 2- 1 In a given byte-addressable computer, memory locations 10000H to 9FFFFH are available for user programs. The first location is 10000H and the last loca- tion is 9FFFFH. Calculate the following: (a) The total number of bytes available (in decimal) (b) The total number of kilobytes (in decimal) 3- Find the total amount of memory, in the units requested, for each of the fol- lowing CPUs, given the size of the address buses: (a) 16-bit address bus (in K) (b) 24-bit address bus (in megs) (c) 32-bit address bus (in megabytes and gigabytes) (d) 48-bit address bus (in megabytes, gigabytes, and terabytes)See Answer
  • Q5:Exercise 1 Provide the values of the Carry Flag (CF), Zero Flag (ZF), and the Sign Flag (SF) corresponding to each of the following arithmetic operations. Assume a 32 bits processor: OXCDAAACDF + 0xFABC1BCD 0x3DAAA1FF-0x9ACD4AB1 OxABCD12CF + 0x1245C122 OxCDFFB222 + 0xFFFF Notes: 1- As was mentioned in the class, each flag can take two possible values only: 1 or 0 if the event takes place or not respectively. For instance, if there is carry, then CF = 1. Otherwise CF = 0 2- As a reminder, a number is negative if its most significant bit is 1. In this case, SF flag = 1See Answer
  • Q6:3- A MOV assembly instruction copies the value of the source register to the destination register. What is the value of the destination register r1 after the following instruction is executed? Memory Address 0x08000166 Assembly Instruction MOV rl, pcSee Answer
  • Q7:2- Suppose the memory address in most embedded systems has 32 bits. How many unique memory locations can this 32-bit address access? Show your work.See Answer
  • Q8:1. The program counter (PC) points to the memory address of the next instruction to be loaded from the memory. A) How does the PC value change after fetching a 32-bit instruction? B) How does PC change after fetching two 16-bit instructions?See Answer
  • Q9: INSTRUCTIONS: In all cases you may use register definitions, like DDRB, ADMUX etc. to configure the register. Please comment your code as much as possible and make your code readable. Please submit one PDF for this exam. The PDF can include drawings, code segments and/or tables and short answers. Please use the exam numbering to specify your responses (like 1.a or 1.c.l). You may introduce your own variables throughout and can use any other coding techniques, unless otherwise specified. 1- In our lectures, we focused on the uses of GPIO, timers and ADCs. One demonstration we did during recitation was implementation of how a timer can be used to generate a PWM output on one of the microcontroller pins. The objective of this question is to use a timer and PWM to provide a clock signal to an external peripheral. A clock signal is nothing more than a 50% duty cycle PWM. The key here is to use a potentiometer to control the frequency of the PWM signal so that some other device can use the clock to control its functions. Start a project in PlatformIO, choose your Playground Classic microcontroller and let's build the main.cpp file. a. Because we want high resolution of the frequency of the PWM, we need to use a 16 bit timer. Choose one of the 16 bit timers on our 32U4 microcontroller to provide the PWM timing. Add a comment that specifies what timer you have chosen. b. Identify the pin that is associated with your PWM output. Add a comment that states the pin you will use along with the rational for selecting that pin. Keep in mind, you may use a pin that is available on the 32U4 but NOT available on your Playground Classic. c. Suppose the range of clock frequencies you would like to generate are between 1kHz and 4kHz. Write a C function called Setup TimerPWM() that sets up the timer you selected to output a 50% duty cycle PWM signal at 1kHz (for now). This requires setting up the TCCR and OCR registers. d. Write a C function called SetPWMFreq(uint16_t freqlnHz). This function takes in a single 16 bit integer representing the desired frequency of the PWM in Hz. Therefore, the resolution of this frequency value is 1Hz. This function should adjust the PWM frequency to "freqlnHz” Hz, while maintaining a duty cycle of 50%. Be sure to limit this value between 1000 and 4000Hz. e. Now, set up the ADC to read an analog input of your choice. Add a comment to your code that specifies which ADC pin you are using. Using a 10k Ohm potentiometer (variable resistor ranging from 0 Ohm to 10k Ohm) in series with a 10k Ohm resistor, use the potentiometer to control the frequency of the PWM you generated in c. When the potentiometer is 0 Ohm, let that represent 1kHz frequency of the PWM, while when 10k Ohm represents 4kHz. Write a C function called SetupADC() that sets up the ADC registers to sample the selected analog pin in "free running" mode. The idea is that as you rotate the potentiometer, varying its resistance, the PWM signal created at the pin will range in frequency from 1kHz to 4kHz. f. Write a C function that translates the read ADC value to a frequency and returns the necessary value to pass to d. called uint16_t translateADCtoFreq(uint16_t ADCval). g. Lastly, we need a visual to indicate the frequency (or the position of the potentiometer). We can use LED's for this. Design a creative way to use one or more LEDs to indicate the frequency value of the PWM. You can use something like a "progress bar” of LEDs for example. Its your choice, but the objective is to "at a glance" be able to determine generally where in the frequency range we currently are. Right a C function called SetupLEDs() that sets up the relevant DDR/PORT registers. Then write a C function called UpdateLEDS(uint8_t Percent), where Percent is 0 to 100 mapping linearly to the PWM frequency of 1KHz to 4kHz. This function should update the LEDs to inform the user of the currently set frequency. Your code should look something like this: void updateLEDs(uint8_t Percent) { } void Setup TimerPWM() { } void setupADC() { } void SetPWMFreq(translateADCtoFreq(uint16_t freqlnHz) { } void updateLEDs (uint8_t Percent) { } uint8_t translateADCto Freq(uint16_t ADCval) { } void setup() } SetupLEDs(); Setup TimerPWM(); SetupADC(); } void loop() { uint8_t FreqPercent; //Add a line here that calculates Freq Percent from the value of ADCW SetPWMFreq(translateADCto Freq (ADCW); //Read ADC and set the PWM Freq updateLEDS(Freq Percent); delay(100); //update 10 times a sec. } Good luck Everyone!See Answer
  • Q10:12 m IM Ve 3 me $ -- -- I have a project in Proteus using PIC18F46K22 that consists of 16 oil wells, and the power supply is 5V DC. I have represented each oil well with a variable resistor (10k ohm), and now I have 16 variable resistors as inputs connected to the ADC pins. Then, the oil flow level is displayed on an LCD screen (16x2) (LM016L), and also an active buzzer is connected to the PIC18F46K22. The requirement: Based on the connections shown in the image, write the code and the required initializations for the LCD and PIC18F46K22 using MPLAB X IDE development environment to measure the flow of each oil well. It should display the well number along with its flow level as a percentage on the LCD screen for five seconds, then move to the next well for 5 seconds, and so on until it reaches well 16 and then stops. When there is no oil flow for a well, the buzzer should sound and "No flow" should be written on the screen. Some important instructions: 1. The code written using the MPLAB X IDE program only. 2. Submit the code by attaching the MPLAB X IDE files. 3. The code is written while adhering to the connections shown in the figure only. 4. The Proteus (simulation) file has been attached and there is no need to build the connections again. RSee Answer
  • Q11: A microprocessor has an instruction set that consists of 135 instructions, where each instruction consists of opcode and two operands - each operand is 20 bits. Each instruction needs fetch, decode, read operand, execute, write, and interrupt stage Assume that as an average, each stage requires three micro-operations to complete. Also, assume that the control memory is N bits wide (i.e., control field bits + address selection field bits + address bits - N bits). The control field bits are 12, and there are 7 flags to be monitored. a. How many bits are needed in the address field? (3 points) b. What is the size of control buffer register? (3 points) c. What is the size of control address register? (3 points) d. What is the size of control memory, in bytes? (4 points) e. What is the size of instruction register? (3 points) f. In order to change this to two-address format, what parameter(s) are to be changed, and how? (4 points) Consider the following code. Draw a pipeline diagram with total clock cycles needed using instruction pipeline (FI, DI, FO, EI, WO). Assume that system has two memory ports, and A, B, C, D are values stored in memory. Mov RI, B Mov R2, C Sub R4, R1, R2 Mov C, R4 Add R6, R1, R2 Mov R5, D XOR R6, R5, R6See Answer
  • Q12:1. ARM Data Addressing. Suppose r0=0x8000, and the memory layout is as follows Data Address 0x8000 0x1A 0x8001 0x2C 0x8002 0xEB 0x8003 OxOD 0x8004 0xFD 0x8005 0xA3 0x8006 0xCD 0x8007 0x79 ARM processors can be configured as big-endianness or little-endianness. What is the value of rl after running? LDR r1, [ro] (This instruction basically loads the value found in address [ro] into register rl) a. If little-endianness, rl b. If big-endianness, rl=_ 2- A GPIO port supports a total of 16 pins. The mode register for a GPIO port has 32 bits, with two bits for each pin (Pin 0 - Pin 15). The definition of these two bits is as follows: digital input (00), digital output (01), alternate function (10), and analog (11). Suppose we need to set the mode of port B pin 9 to digital output. Does the following C code always work? Explain why? GPIOB->MODER |= (1<<18);See Answer
  • Q13:**I need each line explained. // ***I need to add a second code that makes another led blinks wired to different pin on the same program (2 LED blinks in one code). www //----This code will make LED blink using timer commands, LED wired to pin PB6--- #include "STM3214xx.h" //This comand line includes the necessary header file 'stm3214xx.h', which provides definitions and functions specific to the STM32L4 series microcontroller int main() { } RCC->AHB2ENR |=(1<<1); GPIOB->MODER &=~(11<<12); GPIOB->MODER |=(1<<12); RCC->APB1ENR1 |=(1<<1); TIM3->PSC-1600-1; TIM3->ARR=4000-1; TIM3->CNT=0; TIM3->CR1=1; while(1){ } while (!(TIM3->SR &1)){} TIM3->SR &=~1ul; GPIOB->ODR ^=(1<<6);/nTo/DO Need // after each line that explain what the line is Same code then Need to add asecond code that makes a second led blink. The program make one led blink, i want a second led blink Need explanation of each line. just basic descreption for example GPIO is input output port.just basic, most of them repet This is based on the arm-cortex STM32L476See Answer
  • Q14:7. 1). GPIOA->ODR =0x45; 2). N=GPIOC->IDR; Which C code, 1) or 2), is for reading data from external device into the microprocessor?See Answer
  • Q15: Please add comments to each instruction line. Then write another program for different I/O ports. #include "stm3214xx.h" void delayMS(volatile int n); int main() { outputs RCC->AHB2ENR |=(1<<1); // enable GPIO B GPIOB -> MODER &= ~((0x3<<2) | (0x3<<26) |(0x3<<28) |(0x3<<30)); GPIOB -> MODER |= (1<<2) | (1<<26) |(1<<28) | (1<<30); //PB1, PB13, Pb14 < pb15 set asa volatile int K; while(1) { K=K + 1; if (K>1000){ K=0;} if (K<500){ else{ GPIOB->ODR =(1<<1) | (1<<15); //activate PB1 & PB15 delayMS(3); GPIOB->ODR =(1<<1) | (1<<13); delayMS(3); GPIOB->ODR =(1<<13) | (1<<14); delayMS(3); GPIOB->ODR =(1<<14) | (1<<15); delayMS(3);} GPIOB->ODR =(1<<14) | (1<<15); //activate PB1 & PB15 delayMS(3); GPIOB->ODR =(1<<14) | (1<<13); } } } while(1){ }*/ delayMS(3); GPIOB->ODR=(1<<1) | (1<<13); delayMS(3); GPIOB->ODR =(1<<1) | (1<<15); delayMS(3);} GPIOB->ODR =(1<<1) | (1<<15); //activate PB1 & PB15 delayMS(3); GPIOB->ODR =(1<<1) | (1<<13); delayMS(3); GPIOB->ODR =(1<<13) | (1<<14); delayMS(3); GPIOB->ODR =(1<<14) | (1<<15); delayMS(3); void delayMS (volatile int n) { volatile int i; for (; n<0; n--); for (i=0; i<350; i++); Board pinout reference. PC10 PC12 VDD BOOTO IN 1 IN2 IN3 IN4 IN5 IN6 IN7 NC NC PA13 PA14 PA15 GND PB7 PC13 PC14 PC15 PHO PH1 VBAT PC2 PC3 Figure 24. NUCLEO-L476RG + 5--12V CN7 CN6 9 10 11 12 13 14 15 16 20 21 22 23 24 25 26 CN8 NUCLEO-L476RG PC11 PD2 E5V GND NC NC IOREF IOREF RESET RESET +3V3 +3V3 +5V +5V GND GND GND GND VIN VIN NC PAO АО PA1 A1 PA4 A2 РВО A3 PC1 A4 PCO A5 Stepper Motor driver reference ULN2003 pinouts. Arduino PC9 PB8 D15 D14 PB9 AVDD AVDD GND GND D13 PA5 D12 PA6 D11 PA7 D10 PB6 D9 PC7 PA9 D8 D7 PA8 D6 PB10 D5 PB4 D4 PB5 D3 PB3 D2 PA10 D1 PA2 DO PA3 Morpho CN5 CN10 CN9 GRES D GEHO eftirs 56 21 22 23 24 25 26 PC8 PC6 PC5 U5V NC PA12 PA11 PB12 PB11 GND PB2 PB1 PB15 PB14 PB13 AGND PC4 NC NC MSV36556V1See Answer
  • Q16:Exercises: Exercise 1: Write a program that makes the user LED flash twice by following the pattern (ON for 200 ms, OFF for 200 ms, ON for 200 ms, OFF for 2 seconds, and repeat). Exercise 2: Write a program that turns the user LED ON whenever the user push button is pressed, and OFF otherwise. Exercise 3: Using the mbed application shield, write a program that makes the rgb LED blink at 1 Hz frequency with different colors in the following sequence (red five times, green five times, blue five times, and repeat).See Answer
  • Q17:2. Write an MSP432 code segment that subtracts two 64-bit Hexadecimal numbers and stores the 64-bit binary value starting at 0x20000008. Subtract 0x0000 0000 9FED CBAO from OxABCD EF98 7654 3210. You can make it a continuation of the program in problem 1, but let me know that is what you are or are not doing. (write a small note). Enter the code into your lab tools (one of your assembly uVision programs) and cross check your answer. Include a printout or picture of your source assembly file with the final answer [15 pts]See Answer
  • Q18:5.7 Questions: 1. Describe the function of the assembler directives: equ, .section, .byte, .ascii, and .end. 2. If the following data is in these registers or memory, Register R0 = 0xB7 Register R1-0x2000.0040 Memory address 0x2000.0040=0x65 Memory address 0x2000.0042=0x7A What numbers are in registers RO and R1 after each of the following instructions is executed? a. LDRB RO, [R1, #2] b. LDRB RO, [R1], #2 c. LDRB R0, [R1, #2]! 3. Extra Credit: There are 50 students in the class and you want to input their one digit grades after displaying Grades for the next student on the screen. Write a program that uses InChar and OutStr to perform this input and display operation only. No conversion or storage operation needs to be done (unless you want to!).See Answer
  • Q19:3. Create a new project Lab5c. Starting with the files provided and the program in Figure 5.1, modify that program so that all the following changes are made in your new program: a. The table to be copied is of length 0x20. b. The original table is created starting at 0x2000.0480 c. The table starts with 0x00 and successive even numbers are stored in the table. d. The duplicate table is created starting at Ox2000.0C00 e. The duplicate table contains the copy of the original table in the reverse order.See Answer
  • Q20:2. Before starting this part of the lab, please do all calculations below manually. Create a new project: Lab5b. Copy the appropriate files over from the provided zip file. Starting with provided calculate.s, modify it to add or subtract the numbers that are stored in the memory and store the sum in memory (i.e. your program should read numbers from the memory, apply mathematical operation to the numbers accordingly and save the result in the memory). Put the operand values given into the .rodata section of your program. Execute the programs and record the sum or subtraction and the 'C' (carry) and 'Z' (zero) bits of the condition code register. Use the following data: a. Addition of two single-byte numbers: 0xC3 + 0x8D Helpful steps: 1) Use LDRB to read a byte of data from memory into a register. How does an instruction refer to memory location? How do you initialize memory? Hint: Look at Lab5a, above. 2) Use ADD to add numbers in registers. ab 5 Rev. 3 -7- Advanced Assembly, Branching, and Monitor Utilities 3) Use STRH or STR in order to save the result from a register to memory-why shouldn't you use STRB in this case? 0xF5-0x34 0xFE6B34-0x58CF21 0x2E68B3F4 +0x5C2A b. Subtraction of two single-byte numbers: c. Three-byte subtraction: d. Multi-byte addition:See Answer

TutorBin Testimonials

I found TutorBin Microprocessor And Microcontroller homework help when I was struggling with complex concepts. Experts provided step-wise explanations and examples to help me understand concepts clearly.

Rick Jordon

5

TutorBin experts resolve your doubts without making you wait for long. Their experts are responsive & available 24/7 whenever you need Microprocessor And Microcontroller subject guidance.

Andrea Jacobs

5

I trust TutorBin for assisting me in completing Microprocessor And Microcontroller assignments with quality and 100% accuracy. Experts are polite, listen to my problems, and have extensive experience in their domain.

Lilian King

5

I got my Microprocessor And Microcontroller homework done on time. My assignment is proofread and edited by professionals. Got zero plagiarism as experts developed my assignment from scratch. Feel relieved and super excited.

Joey Dip

5

TutorBin helping students around the globe

TutorBin believes that distance should never be a barrier to learning. Over 500000+ orders and 100000+ happy customers explain TutorBin has become the name that keeps learning fun in the UK, USA, Canada, Australia, Singapore, and UAE.