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

  Filtering – biomedical application

Prepare a filter that removes noise produced by electronic medical equipment.

  Impact of zigbee on telecommunication systems

Report on Impact of zigbee on telecommunication systems

  Compare with the true value

compare with the true value of 6.737947 x 10 -3  . Use 20 terms to evaluate each series and compute true and approximate relative errors as terms are added.

  Matlab program to compute how much money will accumulate

Write a MATLAB program to compute how much money will accumulate in 5 years in the account and in any CDs you buy. Run the program for two different savings interest rates: 4 percent and 5 percent.

  Write project report and provide cross-synthesis

Write project report and provide Cross-synthesis.

  Recall the velocity of the falling parachutist

Question: Recall the velocity of the falling parachutist can be computed by  V(t) = gm(1-e -c/mx )/c,  Use first order error analysis to estimate the error of v at t=6. If g=9.8 and m=50 but c=12.5 +_ 1.5

  Calculate the distance between cities

Calculate the distance between cities

  Matlab – discrete time simulation

MATLAB – Discrete time simulation, solve  Discrete time syetm problem,  DT kalman filter problem,  Steady state DT kalman filter problem

  Develop a well-structured function

Develop a well-structured function to compute v as a function of t. Then use this function to generate a table of v versus t for t = -5 to 50 at increments of 0.5.

  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.

  Write a functions

The function range basis takes a matrix A as input, and outputs a basis (again written as columns) for the range space of A.

  Least squares

For homework consider the points (0,0), (1,2), (2,3), (3,9), ( 4,17), (5,24), (6,37). (1) Use Matlab to find the least squares best fit with a line.  Turn in A, y and c and a plot like the one above.  Also (2) use Matlab to find the least square best..

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