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

  Control design using matlab

Control Design using Matlab,  Please try and explain the characteristic of all the plots and graphs.   Import all the required data in word of simply write in the script itself.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

  Compute the economy sized svd

Compute the economy sized SVD of the reshaped A matrix.

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Open a named pipe and to read data from the pipe

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

  Mobile robot control and potential field

Write a MATLAB code to compute forces due to each obstacle and goal. Compute total force on vehicle at point(x,y).

  Write a script to solve the following systems of equations

Write a script to solve the following systems of equations using both matrix left division (\) and the inverse matrix method and Show that you have tested your MATLAB code appropriately

  Plot the lines using the inputted vector of x values and x

Write a function named solveSystem that has three inputs: two vectors consisting of coefficients [a b c] of two line equations of the form ax + by = c and a vector of x values.

  Explore the design of a recursive digital filter

In this simulation we are going to explore the design of a recursive digital filter which might be usedvin a digital radio station. The sampling frequency used in digital radio (DAB) is either 48 kHz or 24 kHz and for the purposes of this simulation,

  Design and explain a computer-based simulation model

Design and explain a computer-based simulation model which you will use to estimate the probability that among 25, 50, 75, 100, 500, or 1000 randomly chosen people, at least 2 people share the same birthday.

  Time domain design and analysis

To design a "custom" controller to reduce the vibrations of the seat and a PID controller to reduce the vibration of the seat

  Matlab code to solve for temperature and pressure variation

Write down the MATLAB code to solve for temperature and pressure variation throughout the expansion process and to evaluate work and heat produced in processes for variable values of n.

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