1. Measure the CO2 sensor, which gives an analog output of 0 to 1.0V
2. A value of more than 0.5V represents a dangerous level of CO2 (0.0V means no CO2)
3. In the case of a dangerous condition, an alert must be given in the form of illuminating an
external LED connected to any GPIO pin.
4. The sampling rate of the sensor must be 1kHz.
5. Use must use an ATTINY84 Microcontroller, which is also an 8-bit AVR processor similar (but
different) to our 32u4 (datasheet attached).
1. Take a few minutes to review the datasheet to familiarize yourself with the available GPIO pins,
available timers, and ADC setup. Review the address mappings in section 22 as well. For this part of
the exam, you can not use known registers like PORTB etc. You must use unsigned char pointers to
the correct addresses.
2. Write a function called void SetupTimer() that sets up any timer to function as a 1kHz timer (no
PWM generation, no pins connected). The timer should reset every 1ms. Be sure to set up the
appropriate registers in section 11.9 of the datasheet.
3. Write a function called void SetupLED() which sets up the selected GPIO pin (you can select any
appropriate pin) for the LED alert.
4. Write a function called void SetupADC() which sets up the ADC to the appropriate MUX channel (you
can choose any one you want). Set up the ADC to use a prescaler of 16, and use your timer overflow
as an Auto Trigger Source for the ADC. See section 16.13.4 (Table 16.7)
5. Write the setup function that calls your functions described above.
6. Write the loop function that reads the ADC and performs the logic to illuminate the LED
appropriately. Don't make the LED flicker if the ADC hovers around 0.5V!
7. Sketch the schematic that shows which pins you used and the interconnect diagram of the LED,
ATTINY, and the CO2 sensor.
8. Now, using Platform IO, start a new project and use the board "Generic ATTINY84". Import the code
you developed in 1. through 7., but now you can use the defined registers like PORTA etc. Submit
the .cpp file with your code.
Using the ADALP2000 analog parts kit / breadboard, construct the R-L voltage divider circuit using a 1k2 resistor and 10 mH inductor (code 103) as shown below. With the ADALM2000 SCOPY signal generator, adjust the input voltage (Vin) to 4.0 volts peak- to-peak (2.0 volts peak) at a frequency (f) of 60 kHz AC signal. Using the oscilloscope function of the SCOPY, display on your computer, both the input (Vin) and output (Vout) voltage waveforms on the same screen. Use the ADALM2000's 1+ and 1- wires to measure the voltage across Vin and the 2+ and 2-wires to measure the voltage across Vout. Note that once the circuit is connected to the signal source, the measured value of Vin on the oscilloscope will be slightly less that 4V p-p (2 V peak). This is due to the internal resistance of the SCOPY. For your calculations, use the measured value of Vin rather than 2.0V peak. Set Vin scaling for 500 mV/div and Vout scaling for 200 mV/div. Assume that the input voltage (Vin) is reference (Z = 0º). Remember that for a 60 kHz signal, the period, t = 1/f = 1/(60 x 10³) = 16.67 usec. Therefore, a 90° phase shift would result in a time difference (At) of 4.18 usec. Set the time-base scale on the SCOPY to 2.0 usec / div. Measure the time difference between the zero crossings of the two voltage sinewaves as the voltages are going positive in order to compute the phase angle difference (40) most accurately. Attach a picture of your circuit mounted on the breadboard as well as a screenshot from SCOPY showing both input and output voltage waveforms to this page. What At between the two waveforms and output voltage amplitude did you measure? Calculate the phase angle shift from At: Vout degrees (peak) (15 points) At= Is the output voltage (Vou) leading or lagging the input voltage (Vin)? Justify your answer by referencing the screenshot of the input/output waveforms. (2 points) Use hand calculations to verify your Vout measurement on a second piece of paper. What is the % error for the amplitude and phase shift measurements? (3 points) V₁ L + RV
Given a memory with a 14-bit address and an 8-bit word size: How many bytes can be stored in this memory? If this memory was constructed from Ik x 1 RAMs, how many memory chips would be required? How many bits would be used for chip select?
5. Practice Exercises 5.1 Multiplexer Design and implement an 8-1 Multiplexer using a case statement. 5.2 Array Adder Design and implement an Array Adder. Depending on an input bit named 'op', if: • op is 1: Add together two integer arrays with addition and stores the result in a third array. • op is 0: Subtract one integer array from the other and store the result in a third array. You can assume all three arrays are hardcoded as signals. 5.3 Array-Mapped Increment Design and implement an Array-Mapped Increment circuit that takes an integer named "x" as input and adds "x" to all elements in an integer array. If an array value exceeds 9, that array element is reset to zero. You may assume that the integers are hardcoded signals. 6. Deliverables Practical demonstration of the sample exercises will be requested during the lab and instructor may ask for their code to be submitted on Moodle. Complete work of the practice exercises must be submitted on Moodle by the specified deadline. Provide the following for all designs: 1. Complete VHDL code. 2. Flow Summary and Successful Compilation. 3. RTL Viewer. 4. Power Consumption. 5. ModelSim simulation for the designs.
Changes to this answer. Question 2 A microcontroller (not the Tiva) has a 19-bit-wide address bus. What is the theoretical maximum address space it can address? Give your answer in MegaBytes (not bytes, kilobytes, or gigabytes). Moving to the next question prevents changes to this answer. Question 2 of points Save Ar
Use the C2000 microcontroller and set up pins as GPIOS for LEDs. Toggle LED2 and LED4 every 1000000 loops in background. Submit the only main.c please. Remember to put comments to explain your code. < To Do Assignment Details Elec Machines and Drives Lab 002