Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Do NOT use any C string library functions.

1. Assume the 8250 UART (the same UART as used in PCs) is connected to an ATmega2560 single board computer mapped as external data memory with a start address of FCC0 Hex. Write the following Arduino C language functions.

For those who are interested, the data memory map for the 2560 is shown in the Atmega2560 data manual - External Memory with Sector Select.

ASSUME THE 8250 UART IS ALREADY INITIALIZED (so you do not need to write UARTinit()).

a. kbhit(void): - will examine the RDA status bit and return a true (non-zero value) if RDA is true, otherwise it will return a false (0 value).
b. getchar(void): - will read one character from the serial port and return it.c.
c. putchar(char vname): - will write the character vname to the serial port as soon as TBE is true.

2. Write an Arduino C language function printstr(*unsigned char str0) which will print out a NULL terminated ASCII string using the serial I/O functions defined in Question 1 above. The input pointer str0 points to the first element of the string to be printed.

3. Write an ARDUINO C function called strlen() that determines the length of a null-terminated ASCII string. Pass a 16-bit address pointer to the first element of the string to the function. Return the length, excluding the null byte.

4. Write an ARDUINO C function to create a fixed length destination string by copying a source string and truncating or padding with spaces as needed. Pass three variables to the function: 1) the length of the output string, 2) a 16-bit address pointer to the first element of the source string, and 3) a 16-bit address pointer to the first element of the destination string. The function does not return any value.

5. Write an ARDUINO C function to compare two character strings and determine whether one is less than, greater than, or equal to the other. Assume the strings are null-terminated. Pass a 16-bit address pointer to the first element of the first string, and a 16-bit address pointer to the first element of the second string. Return -1 if the first is less than the second, return 0 if the strings are equivalent, and return + 1 if the first is greater than the second.

Attachment:- selection.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91596407
  • Price:- $95

Guranteed 48 Hours Delivery, In Price:- $95

Have any Question?


Related Questions in Computer Engineering

Question group work this weekbull introduce yourself to

Question: Group work this week: • Introduce yourself to your group • Start planning out the project with your group • The group should compile the following information into a draft document 1. What specific and detailed ...

The following is historical data on the us dollar -

The following is historical data on the U.S. dollar - Canadian dollar exchange rate: Date U.S./Canadian  Canadian/U.S. 1/20/2016 0.68 1.46 9/6/2018 0.76 1.32 Calculate the percentage change in the exchange rate over this ...

Analytic reportpurpose the purpose of this task is to

Analytic Report: Purpose: The purpose of this task is to provide students with practical experience in working in teams to write a Data Analytical report to provide useful insights, pattern and trends in the chosen/given ...

I really need help writing this c progam i have seen many

I really need help writing this C++ progam. I have seen many answers to this question on this site, but they are all deeply flawed. Design the following classes in C++. Person class is the base class for other classes. P ...

On june 23 2016 the brits voted to exit the eu the

On June 23, 2016, the Brits voted to exit the EU. The following were the daily values of an investment. June 23 24 Dollars 109.60 111.60 If returns were to accumulate at the same rate over an entire year (252 trading day ...

Video and disruption report assignmentoverviewfor this

Video and Disruption Report Assignment Overview For this assessment task, you will create a two-minute video and written proposal about the impact of a particular technology on an industry or field. The purpose of this a ...

Inside the oncreate method fill in the code so that we set

Inside the onCreate method, fill in the code so that we set the layout and GUI defined in activity_main.xml? public void onCreate( Bundle savedInstanceState ){ super.onCreate(savedInstanceState); // Your code goes here }

Why are standards needed in data communication and

Why are standards needed in data communication and networking? What are the advantages and disadvantages of standards? How do standards fit in with regulations at the federal, manufacturing, and organizational levels? Gi ...

Question suppose that a computer can execute 1 billion

Question : Suppose that a computer can execute 1 billion instructions/sec and that a system call takes 1000 instructions, including the trap and all the context switching. How many system calls can the computer execute p ...

Subject digital securityimagine a scenario that you go to a

Subject: Digital security Imagine a scenario that you go to a restaurant and pay the meal using your credit card. What communication parties are involved and what information is exchanged in order to complete this transa ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As