What is the difference between static and global variables?

– Answer the following questions in a couple of sentences. [30 pts, 6 pts each]
• What is the difference between static and global variables?
• If you are severely limited by the physical space of the microcontroller you were asked to
design, would you choose Harvard or Von Neumann architecture?
• What is the advantage of RISC over CISC?
• What can go wrong if the BAUD rates of the sender and the receiver do not match?
• What does it mean to have an 8-bit processor? In other words, what does 8-bit signify in
such a system?
• They both represent variables that have a static location in memory. The main difference
is the scope of the variable. The scope of static variables (defined with the “static”
keyword) is a function whereas global variables are accessible by any function in a .c file.
• If you are severely limited in terms of space, Von Neumann architecture might be better
as it has a single memory unit for data and instruction memory.
• RISC instructions are shorter and simpler, thus requiring less complex hardware and each
instruction can complete very fast.
• There might be missing bits or unnecessarily repeating bits (data corruption) depending
on whichever side has higher/lower BAUD rate.
• It means that each address location holds 8 bits, including memory locations and
registers. Example: in your AVR device each register hold 8 bits of data.

 

3 – Serial I/O [40 pts]
Assume that we have the following USART module description on an 8-bit microcontroller:
• The USART module has two 8-bit registers: status register and data register.
• We have a variable, named USART_SR, to represent the status register.
• We have a variable, named USART_DR, to represent the data register.
• The individual bits of the status register (UART_SR) are designed as follows:
7th bit 6th bit 5th bit 4th bit 3rd bit 2nd bit 1st bit 0th bit
RBE – – TBF – –
• RBE bit (“Receive Buffer Empty”) is set to 1, when the receive buffer is empty, and to 0,
whenever the receive buffer is full, i.e. the received character is in the data register.
• TBF bit (“Transmit Buffer Full”) is set to 1, when there is unsent data in the transmit buffer
and to 0, when transmit buffer is empty, i.e. it is okay to write a new character to the data
register.
• USART_DR register works similar to the one in your AVR device, i.e. reading this register
means receiving a character from USART and writing to this register means transmitting a
character via USART. However, you need to make sure that appropriate buffer conditions
are in place before using this register (USART_DR).
Using the above description, write down a function, using the prototype below, that does the
following:
i. It continuously receives a character through serial I/O.
ii. It waits for 50 ms after receiving a character. You can assume that there is a
delay_ms function with the following prototype:
delay_ms(int time)
iii. If the received character is a lowercase letter, it converts it to uppercase and
transmits the converted character through serial I/O.
iv. If the received character is a numerical character, i.e. if the received character
belongs to {‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’}:
a) It transmits ‘0’ through serial I/O, if the numerical character represents an
even number.
b) It transmits ‘1’ through serial I/O, if the numerical character represents an
odd number.
v. It waits for another 50 ms if there is a transmission.
vi. It does not transmit anything through serial I/O, if the received character does not
belong to the groups mentioned in iii and iv.
You can assume that the USART module is initialized in some other part of the main code
(e.g. the BAUD rate, data frame properties, etc.). Regarding USART, you are only
responsible for implementing receive and transmit functionalities in the function below.

Get 20% Discount on This Paper
Pages (550 words)
Approximate price: -

Try it now!

Get 20% Discount on This Paper

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Ace Writing Center has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.

Essays

Essay Writing Services

At Ace Writing Center, Nowadays, students normally have extremely busy schedules. You will note that some of them have to take on some evening or weekend jobs in order to get some income that can help them to sustain in college or in the university. This can deny them a chance to write all the essays given. Others usually get bombarded with a lot of work by their lecturers. This can still delay such students from working on all their essays. However, some of them usually try to work on all these essays but end up delivering their work late. This can prevent them from graduating since most lecturers are strict on deadlines. If you want to write a business essay, the wise way is to hire an outstanding essay writing service like us, so that you can get the best results. If you are keen, you will note that many companies usually overcharge their customers. Some of them are there only to make money. And in reality, they really don’t care to build a long term commitment with students. You should not choose such companies. You should take your time and choose a reliable company to work with. Ace Writing Center is the ultimate solution for you. We have been offering our writing service for more than 7 years. This is a clear indication that you will get quality essay writing service. We have a wide range of writers who can work on any business essay that you might have. We believe in doing extensive research so that we can provide quality work to all our clients. .

Admissions

Admission and Business Papers

Have you ever had to write an admission essay for college? The majority of students face the same issues when applying to a university or college and many in such situations decide they need professional help to cope with this matter. They get in a situation when the deadline keeps coming closer but lack motivation to start because they are just not sure if their writing skills are strong enough. We have a solution for you! Ace Writing Center is the best admission essay writing service with a large professional team and years of experience in providing high-quality papers to students of all levels and faculties. The mission of our team is to help students make their dreams of entering a good college come true and that’s what we offer!.

Editing

Editing and Proofreading

Sometimes all the words for your paper just flow out of your mind and into your fingers. You type quickly at your keyboard and there they are, your beautiful words right there on the screen. But you have no idea how to polish it up. You may be wishing there was a paper writing service that offered this type of writing service. Look no more! Here at Ace Writing Center, we offer you an editing and proofreading option that you can't find anywhere else..

Coursework

College Essay Writing

In case you are familiar Ace Writing Center, you know the way to distinguish a better company from a cheap one exactly. First of all, poor service website does not have a sufficient support. We think support team is an essential part of success; it has to answer all clients’ questions and be a connecting link between clients and their writers. On our web-service you will get answers about anything you need and your writer will receive all your instructions, assignments and requirements exactly and swiftly. A writing service that we run has got a flexible pricing system that will save you from senseless wastes and many bonus systems that let you sparing money for something important for you.