Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Can you please solve this programming exercise?

Specification

You will be required to design, build and test a microcontroller based project. You will also be required to produce a technical report based on the project design, build and test. The project will be programmed using Assembly or Embedded C languages, whichever you are more confident writing. When choosing a project, you will need to consider the availability of hardware, the time you have available to you and your programming skills. You may search around the internet for some Microcontroller based project ideas.

An example of small scale Project:

Fig.1 represents a very simple application that can be developed using microcontrollers:

Fig. 1 Programmed Calculator

⢠There are three inputs: Input A, Input B and Select in the figure. There are four functionalities provided to the user i.e. addition, subtraction, multiplication and division.

⢠There is one output in the system (i.e. result) which will vary according to the functionality selected by the user.

⢠The select input decides the function to be executed by the microcontroller on Input A and Input B. The detailed functionality is explained in the table 1

Select Functionality Input A Input B Result

1 Sum x y x + y

2 Subtract x y x - y

3 Multiply x y x * y

4 Division x y x / y

Table 1

In this example we assume, the inputs are taken using push buttons on EB083 Combo Board shown in Fig 2 while the output is validated using seven segment display on EB083 Combo Board. However the students are open to:

⢠Program any functionality using the assembly/ C language in microcontroller. Do not stick to the same example explained above

⢠Use any interface for inputs. For example, the slide switches and switch matrix can also be used as a source for taking inputs from the user instead of push buttons

⢠Use any interface for showing output. For example, LEDâs and LCD can also be utilized as a source for displaying output instead of seven segment display

HEADERS should be:

#pragma config OSC = HS //set osc mode to HS high speed clock

#pragma config WDT = OFF // set watchdog timer off

#pragma config LVP = OFF // Low Voltage Programming Off

#pragma config DEBUG = OFF // Compile without extra Debug compile Code

/* Include Files */

#include <p18f4520.h> // Device used is the PICF4520

#include <delays.h> // Include the delays routines

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question