Design simple interface hardware

Assignment Help MATLAB Programming
Reference no: EM1367258

Select a suitable microcontroller from the PIC18 family, design simple interface hardware, write and test some C programs (subroutines) to operate the hardware interface and then document the hardware and software as a proposed design. Software is to be written in C using the MPLAB X IDE.

You are required to prepare

1. A report in PDF format which includes: 

a brief introduction (100 – 150 words) outlining the design requirements based on the specification. 

the hardware design (250 – 300 words) explaining the key elements of the design and how they meet the specification, plus include a single page circuit diagram of the proposed hardware. You must specify all part numbers and the values of any discrete components used (ie. resistors, capacitors, crystals). Show any calculations you make to check the scaling and resolution of analog input values. 

The software interface subroutines (250 – 300 words) briefly explaining each of the subroutines and how they meet the specification, plus include a copy of the C source code showing all the subroutines. 

A brief analysis of the testing of the software (250 – 300 words) explaining what is working and isn’t working, plus include a few screen captures of the Oshonsoft or MPLAB X simulator showing the software under-going testing. 

2. A copy of the program source file(s) as:  

a ZIP file containing all the files in an MPLAB X project (directory) you created for the assignment 

Part 1. Write a C subroutine called initports to initialise the I/O ports you have chosen in your hardware design for the button inputs, alarm and LED outputs and the seven segment display.

Part 2. Write a C subroutine called initadc to initialise the ADC ready to read any sensor input.

Part 3. Write a C function called sensor which accepts a parameter ‘s', starts a conversion on the analog channel specified by ‘s', scales that converted value to the range 0 to 1000ppm and returns the scaled sensor value as an integer. This function is to return -1 if a sensor error is detected.

Part 4. Write a C function called buttons to read the status of all buttons and return an integer whose value is 0 if no button is pressed, 1 for the Exit button, 2 for the Up button, 3 for the Down button and 4 for the Enter button. Assume only one button is active at any instant.

Part 5. Write a C subroutine called leds that accepts a parameter ‘n', where the value ‘n' (between 0 and 7) is used to control the 3 LED indicators Run, Enter and Fault. A value of n=4 will turn on the Run LED, n=2 will turn on the Enter LED, n=1 will turn on the Fault LED, n=0
will turn all LEDs off. Assume only one LED is on at any instant.

Part 6. Write a C subroutine called alarm that accepts a parameter ‘a', to control the alarm relay, where a=1 turns the relay off (triggering the alarm) and a=0 turns the relay on (no alarm)

Part 7. Write a C subroutine called display that accepts a parameter ‘c', to display the gas concentration ‘c' onto the 4 digit seven segment display. The display is not multiplexed.

Part 8. Write a main C program calls all the subroutines in some logical sequence so that their functions can be tested on a simulator. The main program should include multiple loops to test each possible sensor input, each button press, each LED output, the control of the relay output and show a range of values on the seven segment display.

Reference no: EM1367258

Questions Cloud

Elements of power-self image and knowledge : Consider the elements of power, self-image, knowledge, and problem-solving that can serve as impediments.
Business formation codes : Explain the process for obtaining an annual filing report for a corporation currently registered in California
How fast would the police officer be travelling : A car speeds past a stationary police officer while travelling 115km/h. The officer immediately begins pursuit at a constant acceleration of 10.20 km/h/s (note the mixed units), just as the driver passes the officer.
Explain network security management-flow diagram : Network Security Management-flow diagram, assets and detail of functions. I have completed the assets and flow diagrams and interfaces. Start systems engineering on for MIIS, based on prior homework assignments:
Design simple interface hardware : Evaluate the capability in selecting and configuring a microcontroller unit designing simple interface hardware and writing subroutines to operate those interfaces
Compute number of units and unit price : Consider a market characterized by the following inverse demand and supply functions: PX = 10 - 2QX and PX = 2 + 2QX?
Health care service-quality or standards : How can we measure the fact that health care service is meeting that quality or standards, (other than surveys)? What sources of evidence do we rely?
Find out the greatest horizontal range of the rocket : A crate is sliding down a ramp that is inclined at the angle of 33° above the horizontal. The coefficient of kinetic friction between the crate and the ramp surface is 0.479. Find the acceleration of the moving crate.
Corporate or government agency policy on instant messaging : What specific questions must a corporate or government agency policy on "Employee use of Instant Messaging (IM) using corporate computers" address?

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd