1 BACKGROUND The new generation of enhanced mid core PICs such as the 16F1847 and the 12F1840 have an inbuilt temperature sensor. This sensor consists of a current source which flows through four diodes in series and the voltage drop across the diodes which is proportional to temperature can be measured by internally connecting the sensor to the ADC and determining the temperature based on the ADC value In this assignment the temperature sensor is used to create a simple thermometer application and to create an alarm should the sensor go outside the set value. Assignment Details 1) Determine the register settings needed to switch the sensor on and connect the temperature sensor to the ADC. Using appropriate values for Vref+ and Vref- display the ADC count value on the 7 segment display. 2) With reference to Microchip Application Note AN1333, “Use and Calibration of the Internal Temperature Indicator” (DS01333) determine an appropriate algorithm to convert from the ADC value to the temperature in degrees centigrade and implement it using a lookup table or otherwise. Display this value on the 7 segment display. Additional marks will be given for accuracy, calibration and averaging the temperature readings to give a more accurate, and a more stable temperature reading. . 2 In order to meet the specification the following will be required. i) Selection of appropriate microcontroller to meet the requirement of the task. ii) Development of an assembly language program to control the operation of the embedded system. iii) Thorough testing to ensure correct operation of the system. iv) Produce a project report to evidence all of the above. Follow Report Requirements (20 pages max) 1) Introduction – Clearly state the scope and aims and objectives of the project: Include Aims and Objectives, i.e. break down the project into smaller attainable aims and objectives for example one objective could be to develop a program to control the LED display. If all objectives are met then the overall project should have been completed. 2) Theory – Include any relevant theory 3) Procedure, Results Discussion – The report should show a methodical, systematic design approach. The microcontroller kits in the laboratory can be used as the hardware platform, however circuit diagrams should be included in the report and explanations of operation is expected. 4) Include flowcharts and detailed explanations of software development. Include appropriate simulation screen shots. Show and discuss results e.g. ADC program, LED program, etc. Include final/complete program. Were results as expected, do they compare favourably with simulated results, what could be done to improve the operation and accuracy of the system? 5) Conclusion – Reflect back on the original aims and objectives. Were they met if not why not? What further work could be carried out to meet aims and objectives etc? 3 Marks ALLOCATION Marks are allocated for the given activities as follows: MARK (%) PROJECT WORK 60 PROJECT REPORT 30 PRESENTATION MARK 10 ______ Total 100 The marks awarded for the microcontrollers in embedded system module will be made up as follows:- PROJECT MARK Have all of the specifications been met? Correct Register settings to switch on sensor and connect temperature sensor to ADC 5% Display two different characters on the 7 segment display 5% Display the ADC count value on the 7 segment display 10% Display the temperature on the seven segment display 20% Calibration 10% Accuraccy 10% Total 60% REPORT MARK Introduction and Theory 5% Procedure, Results and Discussion 20% Report Presentation 5% Total 30% PRESENTATION (POWER POINT) & DEMO Demonstration 10% Total 10% TOTAL 100% 4 Schematic for the Assignment Seven Segment Display Code ;************************************************ ;Appropriate values to illuminate a seven segment display ;with numbers 0 – 9 are extracted from a look up table ;and output on PORTB. ;A software delay is incorporated between displaying ;successive values so that they can be observed. ;(This program is useful demonstrating software delays, ; and look up tables. ; ;************************************************ ; list p=16F1937A #include <p=16f1937.inc> ; ; ****** PROGRAM EQUATES ****** ; temp equ 0x20 value equ 0x21 outer equ 0x22 RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7 a b c d e f g dp RA1 RA0 +5V 16F84 VDD Vss 220Ω x 8 CA2 CA1 100K x 2 5K6 5K6 +5V +5V a b c d e f g a b c d e f g middle equ 0x23 inner equ 0x24 w equ 0 f equ 1 ; ; ; ****** MAIN PROGRAM ****** ; org 0x00 banksel PORTB clrf PORTB banksel ANSELB clrf ANSELB clrf ANSELA banksel TRISB movlw 0x00 ;Set port b all outputs movwf TRISB movlw 0x00 ;Set port a all inputs movwf TRISA banksel PORTB ; movlw 0x00 movwf PORTB ;turn off display ; ; ; **** DISPLAY COUNT SEQUENCE *** ; display movlw 0x00 ;Use value as a counter ie movwf value ;value is incremented every begin movf value,w ;time a value is extracted from table bsf PORTA,0 ;turn on LSB display call get ;call subroutine to get value movwf PORTB ;output value to portb call wait ;call delay subroutine incf value ;increment counter btfsc value,3 ;test to see if counter = %1010 btfss value,1 ;if not get next value, if yes goto begin ; goto display ;go to display again ; ; **** LOOK UP TABLE FOR VALUES **** ; get brw ;look up table to illuminate retlw 0xc0 ;the numbers 0 – 9 on seven segment retlw 0xf9 ;display (outputs from port are retlw 0xa4 ;active low retlw 0xb0 retlw 0x99 retlw 0x92 retlw 0x82 retlw 0xf8 retlw 0x80 retlw 0x90 ; ; **** TIME DELAY ROUTINE **** ; ( THREE NESTED LOOPS ) ; wait ;delay subroutine movlw 0x02 ;-outer loop movwf outer ; wait3 movlw 0 xff ; -middle loop movwf middle wait2 movlw 0xff ;-inner loop movwf inner wait1 decfsz inner,f goto wait1 ;-inner loop decfsz middle,f goto wait2 ;-middle loop decfsz outer,f goto wait3 ;-outer loop return end

1 BACKGROUND The new generation of enhanced mid core PICs such as the 16F1847 and the 12F1840 have an inbuilt temperature sensor. This sensor consists of a current source which flows through four diodes in series and the voltage drop across the diodes which is proportional to temperature can be measured by internally connecting the sensor to the ADC and determining the temperature based on the ADC value In this assignment the temperature sensor is used to create a simple thermometer application and to create an alarm should the sensor go outside the set value. Assignment Details 1) Determine the register settings needed to switch the sensor on and connect the temperature sensor to the ADC. Using appropriate values for Vref+ and Vref- display the ADC count value on the 7 segment display. 2) With reference to Microchip Application Note AN1333, “Use and Calibration of the Internal Temperature Indicator” (DS01333) determine an appropriate algorithm to convert from the ADC value to the temperature in degrees centigrade and implement it using a lookup table or otherwise. Display this value on the 7 segment display. Additional marks will be given for accuracy, calibration and averaging the temperature readings to give a more accurate, and a more stable temperature reading. . 2 In order to meet the specification the following will be required. i) Selection of appropriate microcontroller to meet the requirement of the task. ii) Development of an assembly language program to control the operation of the embedded system. iii) Thorough testing to ensure correct operation of the system. iv) Produce a project report to evidence all of the above. Follow Report Requirements (20 pages max) 1) Introduction – Clearly state the scope and aims and objectives of the project: Include Aims and Objectives, i.e. break down the project into smaller attainable aims and objectives for example one objective could be to develop a program to control the LED display. If all objectives are met then the overall project should have been completed. 2) Theory – Include any relevant theory 3) Procedure, Results Discussion – The report should show a methodical, systematic design approach. The microcontroller kits in the laboratory can be used as the hardware platform, however circuit diagrams should be included in the report and explanations of operation is expected. 4) Include flowcharts and detailed explanations of software development. Include appropriate simulation screen shots. Show and discuss results e.g. ADC program, LED program, etc. Include final/complete program. Were results as expected, do they compare favourably with simulated results, what could be done to improve the operation and accuracy of the system? 5) Conclusion – Reflect back on the original aims and objectives. Were they met if not why not? What further work could be carried out to meet aims and objectives etc? 3 Marks ALLOCATION Marks are allocated for the given activities as follows: MARK (%) PROJECT WORK 60 PROJECT REPORT 30 PRESENTATION MARK 10 ______ Total 100 The marks awarded for the microcontrollers in embedded system module will be made up as follows:- PROJECT MARK Have all of the specifications been met? Correct Register settings to switch on sensor and connect temperature sensor to ADC 5% Display two different characters on the 7 segment display 5% Display the ADC count value on the 7 segment display 10% Display the temperature on the seven segment display 20% Calibration 10% Accuraccy 10% Total 60% REPORT MARK Introduction and Theory 5% Procedure, Results and Discussion 20% Report Presentation 5% Total 30% PRESENTATION (POWER POINT) & DEMO Demonstration 10% Total 10% TOTAL 100% 4 Schematic for the Assignment Seven Segment Display Code ;************************************************ ;Appropriate values to illuminate a seven segment display ;with numbers 0 – 9 are extracted from a look up table ;and output on PORTB. ;A software delay is incorporated between displaying ;successive values so that they can be observed. ;(This program is useful demonstrating software delays, ; and look up tables. ; ;************************************************ ; list p=16F1937A #include ; ; ****** PROGRAM EQUATES ****** ; temp equ 0x20 value equ 0x21 outer equ 0x22 RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7 a b c d e f g dp RA1 RA0 +5V 16F84 VDD Vss 220Ω x 8 CA2 CA1 100K x 2 5K6 5K6 +5V +5V a b c d e f g a b c d e f g middle equ 0x23 inner equ 0x24 w equ 0 f equ 1 ; ; ; ****** MAIN PROGRAM ****** ; org 0x00 banksel PORTB clrf PORTB banksel ANSELB clrf ANSELB clrf ANSELA banksel TRISB movlw 0x00 ;Set port b all outputs movwf TRISB movlw 0x00 ;Set port a all inputs movwf TRISA banksel PORTB ; movlw 0x00 movwf PORTB ;turn off display ; ; ; **** DISPLAY COUNT SEQUENCE *** ; display movlw 0x00 ;Use value as a counter ie movwf value ;value is incremented every begin movf value,w ;time a value is extracted from table bsf PORTA,0 ;turn on LSB display call get ;call subroutine to get value movwf PORTB ;output value to portb call wait ;call delay subroutine incf value ;increment counter btfsc value,3 ;test to see if counter = %1010 btfss value,1 ;if not get next value, if yes goto begin ; goto display ;go to display again ; ; **** LOOK UP TABLE FOR VALUES **** ; get brw ;look up table to illuminate retlw 0xc0 ;the numbers 0 – 9 on seven segment retlw 0xf9 ;display (outputs from port are retlw 0xa4 ;active low retlw 0xb0 retlw 0x99 retlw 0x92 retlw 0x82 retlw 0xf8 retlw 0x80 retlw 0x90 ; ; **** TIME DELAY ROUTINE **** ; ( THREE NESTED LOOPS ) ; wait ;delay subroutine movlw 0x02 ;-outer loop movwf outer ; wait3 movlw 0 xff ; -middle loop movwf middle wait2 movlw 0xff ;-inner loop movwf inner wait1 decfsz inner,f goto wait1 ;-inner loop decfsz middle,f goto wait2 ;-middle loop decfsz outer,f goto wait3 ;-outer loop return end

No expert has answered this question yet. You can browse … Read More...
Biomedical Signal and Image Processing (4800_420_001) Assigned on September 12th, 2017 Assignment 4 – Noise and Correlation 1. If a signal is measured as 2.5 V and the noise is 28 mV (28 × 10−3 V), what is the SNR in dB? 2. A single sinusoidal signal is found with some noise. If the RMS value of the noise is 0.5 V and the SNR is 10 dB, what is the RMS amplitude of the sinusoid? 3. The file signal_noise.mat contains a variable x that consists of a 1.0-V peak sinusoidal signal buried in noise. What is the SNR for this signal and noise? Assume that the noise RMS is much greater than the signal RMS. Note: “signal_noise.mat” and other files used in these assignments can be downloaded from the content area of Brightspace, within the “Data Files for Exercises” folder. These files can be opened in Matlab by copying into the active folder and double-clicking on the file or using the Matlab load command using the format: load(‘signal_noise.mat’). To discover the variables within the files use the Matlab who command. 4. An 8-bit ADC converter that has an input range of ±5 V is used to convert a signal that ranges between ±2 V. What is the SNR of the input if the input noise equals the quantization noise of the converter? Hint: Refer to Equation below to find the quantization noise: 5. The file filter1.mat contains the spectrum of a fourth-order lowpass filter as variable x in dB. The file also contains the corresponding frequencies of x in variable freq. Plot the spectrum of this filter both as dB versus log frequency and as linear amplitude versus linear frequency. The frequency axis should range between 10 and 400 Hz in both plots. Hint: Use Equation below to convert: Biomedical Signal and Image Processing (4800_420_001) Assigned on September 12th, 2017 6. Generate one cycle of the square wave similar to the one shown below in a 500-point MATLAB array. Determine the RMS value of this waveform. [Hint: When you take the square of the data array, be sure to use a period before the up arrow so that MATLAB does the squaring point-by-point (i.e., x.^2).]. 7. A resistor produces 10 μV noise (i.e., 10 × 10−6 V noise) when the room temperature is 310 K and the bandwidth is 1 kHz (i.e., 1000 Hz). What current noise would be produced by this resistor? 8. A 3-ma current flows through both a diode (i.e., a semiconductor) and a 20,000-Ω (i.e., 20-kΩ) resistor. What is the net current noise, in? Assume a bandwidth of 1 kHz (i.e., 1 × 103 Hz). Which of the two components is responsible for producing the most noise? 9. Determine if the two signals, x and y, in file correl1.mat are correlated by checking the angle between them. 10. Modify the approach used in Practice Problem 3 to find the angle between short signals: Do not attempt to plot these vectors as it would require a 6-dimensional plot!

Biomedical Signal and Image Processing (4800_420_001) Assigned on September 12th, 2017 Assignment 4 – Noise and Correlation 1. If a signal is measured as 2.5 V and the noise is 28 mV (28 × 10−3 V), what is the SNR in dB? 2. A single sinusoidal signal is found with some noise. If the RMS value of the noise is 0.5 V and the SNR is 10 dB, what is the RMS amplitude of the sinusoid? 3. The file signal_noise.mat contains a variable x that consists of a 1.0-V peak sinusoidal signal buried in noise. What is the SNR for this signal and noise? Assume that the noise RMS is much greater than the signal RMS. Note: “signal_noise.mat” and other files used in these assignments can be downloaded from the content area of Brightspace, within the “Data Files for Exercises” folder. These files can be opened in Matlab by copying into the active folder and double-clicking on the file or using the Matlab load command using the format: load(‘signal_noise.mat’). To discover the variables within the files use the Matlab who command. 4. An 8-bit ADC converter that has an input range of ±5 V is used to convert a signal that ranges between ±2 V. What is the SNR of the input if the input noise equals the quantization noise of the converter? Hint: Refer to Equation below to find the quantization noise: 5. The file filter1.mat contains the spectrum of a fourth-order lowpass filter as variable x in dB. The file also contains the corresponding frequencies of x in variable freq. Plot the spectrum of this filter both as dB versus log frequency and as linear amplitude versus linear frequency. The frequency axis should range between 10 and 400 Hz in both plots. Hint: Use Equation below to convert: Biomedical Signal and Image Processing (4800_420_001) Assigned on September 12th, 2017 6. Generate one cycle of the square wave similar to the one shown below in a 500-point MATLAB array. Determine the RMS value of this waveform. [Hint: When you take the square of the data array, be sure to use a period before the up arrow so that MATLAB does the squaring point-by-point (i.e., x.^2).]. 7. A resistor produces 10 μV noise (i.e., 10 × 10−6 V noise) when the room temperature is 310 K and the bandwidth is 1 kHz (i.e., 1000 Hz). What current noise would be produced by this resistor? 8. A 3-ma current flows through both a diode (i.e., a semiconductor) and a 20,000-Ω (i.e., 20-kΩ) resistor. What is the net current noise, in? Assume a bandwidth of 1 kHz (i.e., 1 × 103 Hz). Which of the two components is responsible for producing the most noise? 9. Determine if the two signals, x and y, in file correl1.mat are correlated by checking the angle between them. 10. Modify the approach used in Practice Problem 3 to find the angle between short signals: Do not attempt to plot these vectors as it would require a 6-dimensional plot!

Whatsapp +919911743277