quiz5_fall2009_key

quiz5_fall2009_key - BSET ATD0CTL2, #%10000000 BSET...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 383 - Microcomputers Fall 2009 – Quiz 5 Solutions Instructions: 1. Please write your name and student number in the upper right hand corner of the back of this sheet. 2. When you are finished answering the questions, fold the paper in half lengthwise with this side of the page to the inside of the fold. Problems: 1. What are the hexadecimal values of the following sampled data a. 8-bit ADC, sensor range [-20 80], sensor value 30: $80 b. 10-bit ADC, sensor range [-20 80], sensor value 30: $200 2. Finish the following code to collect a sample at the channel 7 of a 10-bit ADC with the 4-stage successive approximation.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: BSET ATD0CTL2, #%10000000 BSET ATD0CTL3, #%00100000 BCLR ATD0CTL4, #%10000000 MOVB #7 , ATD0CTL5 BRCLR ATD0STAT0, #%10000000 , * LDD ADR03H STD SENSOR_VALUE 3. Finish the following code that can provide an interrupt service each 1.5 ms (24 MHz main clock) ORG $2000 MOVW #$3000 , $3E4A ; Initialize interrupt vector BSET TSCR1 , #%10000000 ; Timer enable BSET MCCTL, #%11000110 ; Interrupt enable, Restart the counter ; Modulus enable, scaling down by 8 MOVW #4500 , MCCNT ; 3/16 ms (* 8) CLI ORG $3000 SEI INCA MOVW #4500 , MCCNT ; 3/16 ms (* 8) BSET MCFLG , #%10000000 ; Clear the flag CLI RTI...
View Full Document

This note was uploaded on 11/22/2011 for the course ECE 350 taught by Professor Staff during the Spring '08 term at Alabama.

Ask a homework question - tutors are online