sample_exam2_A09_sol

sample_exam2_A09_sol - ECE2801 PRACTICE EXAM#2 Clocks...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE2801 PRACTICE EXAM #2 Clocks, Timers, ADC and SP1 Study HW3, HW4, Class Notes, User's Guide Ch 4, 13, 20, 15 1) Answer the questions below completely. (25 pts) a) Explain one advantage and one disadvantage of parallel interfaces between a CPU and its peripherals. AAVlLvH-kcse; Fqsier becquSQ a,” 5+5 in were] +V‘U‘5‘Fer +°<jc~lher em Same. clock edge, D‘smémh‘fig: Each b'a-lmos-é ’16ch own 2’86]?ch Con heal-Yon (idercomec-l, ware, {’cB +race\_ S harl- (1154101 at. b) Explain one advantage and one disadvantage of serial interfaces between a CPU d' ' h l. 32:82:33,225; Re+uires {sewer connec‘lions (3 “‘13 be+w€¢n CPU odié, Perighevaj. Cam donned lon3J154¢hce5. Slower because b145, Sew" sefanm‘lIaI/‘fl D75 AAVin‘CL‘Je ' (lions SQmQ Can he CHOW c) Explain the operation of a Timer in “up mode”. ‘4 firmer Coun+s From 0 +0 3+5 ”Minna.“ aban'l' "(l/ten Vese‘l’ to O and repeccis. mu 0 MD (1) True or False: Using Timers causes a big drain on CPU speed. Explain EASE. TVWQVS Awe Per‘vplxevaj devicesfle COOA'LV‘S 0*: G-+-LM€V has no impact on “ma C'PU. \fiqg onl‘fiimpac'l’ k-Hmer ha; 1:) 't-ls TSK_ e) What is the dynamic range of a 10 bit ADC? DR: ROJQOSH’ (Q‘ox '5 é0.:2 0913 2) Answer the questions using the Timer B configuration code below. Assume that the MSP430F449'S system clocks are running in their default configuration. (25 pts) cbV’ \0'\£\f , ta me void runtimerb(void) ’Vt “for 0? by" ’5. \y’ ‘o"5 { u/ Qt, l/ L/ U/ TBCTL = TBSSEL_1 + CNTL__O + MC__1 + ID_0; TBCCRO = 16384; TBCCTLO CCIE; } 3) Explain exactly how TimerBO is configured to run. Specifically what is the counter clock frequency, the counting mode, the counter size (bits), the value of the maximum count? Is counter’s interrupt enabled? Explain the operation of the counter when the program is executing b) Now assume TimerBO's interrupts are enabled and the clock source was ACLK , what would be the time between interrupts if “Continuous Mode” were selected? c) Set TimerBO's control registers to use SMCLK to count intervals 25 msec. d) How long until a clock based on the timer from part (0) would be off by 0.025 milliseconds? Is it fast or slow? 0‘) Ttmer w is Compsaured. +0 Coun‘t‘tm UpMoJe +0 6L WWX coovd— o?— ”DEV-L‘Fhe CAPLH' CUM—k 75 ”CI—K TV“?- LAPU‘V (Jock leéev \5 \. We +‘tmer will TM“ rape-d- The +m (Dermal/t (Interrupt-Scam be OHS-seconds BB in Cami—Knows mode We 'l'lwter (cowl-s Prom 0 3w 143 full COun+, OKFFFF ‘m‘l’h‘ts CASQ. Inc We ~\-lx~\e\/ Lloek'ts ACLK; 32274:? In‘tevrup‘is LOOUQ OC—CU‘Fr eve/w Z sec c) TBCTL=T3555L2+ CMTL-O + MC.\ +Ib-o‘ TBCCRO: Qéllq‘) I TBCC TLO: QC If; SMCLK= 1.0%374 MHZ kn: decal} 0.015s“ at: Lowg'n. Mfizé 2mm «was 1 l 1 ! t3 0.oa€se¢%=(o.oz§)« —([email protected]/1.ouw+4232x 1 #:95539 (Ln-Mural» 0’3, .02.; 5a be$m Clock IQ.) 0% lots .DZS'5€ MgE'S’M secods = 27 Mm [gsec :-> We. dock wk“ \02 Egg: EMF—k LWHWF” H- le asSwae 0.02? sec has elapsecl Mew On 1L3 aozqqqqolq sec. l a 3) A certain azimuthal heading sensor (i.e. electronic compass) has an analog output range of O to 2.2V. Assume the analog output from the heading sensor is input into the MSP430's 12-bit analog to digital converter, and that the ADC12 is configured using the code shown below. (35 pts) signed long readHeading() { unsigned int acheading; char de7 PGSEL |= BITZ; // set P6.2 = l for function mode ADCIZCTLO — SHTO_6 + SHT1_6 + REFON + REF2_5V + ADCIZON; ADCIZCTLl = SHP; ADClZMCTLZ = SREF_1 + INCH_2; //Enable and start (single) conversion ADCIZCTLO |= ADC1ZSC + ENC; while (ADC12CTL1 & ADCIZBUSY) dmy=l; acheading ADCIZMEMZ & OXOFFF; calc_dms(acheading); } a) What is the sensitivity (mV/degree) of heading sensor? b) What is the resolution ADC12 in volts? c) What is the resolution of the heading reading from the ADC12 in degrees (assume linear mapping between volts and degrees). d) What ADC count is associated with the sensors maximum output voltage. e) Implement the C function calc_dms( ) that converts the ADC12 output in ADC12MEM2 to degrees minutes and seconds (1 deg = 60 min, 1 min = 60 sec). 0 A current moves an underwater vehicle using this heading sensor off course by 2 meters as it traveled 1000 m. Would the heading sensor reading from the ADC12 be able to detect the change in course due to the current? 1000m >1 // ’ 2 m ---------- original heading ------> HM c) mew/[10H 6:. H WWI/deer“ tactic! is? Jegrees/IoH 45 2.2v 4“ = coun+~5 W ODOOMDV/bi't '65) void ca1c_dms(unsigned int achalue) { ll const float DEGperBIT unsigned dd, mm, ss; float deg, mins, sec; 0.09988; // degrees per deg = (float)achalue * DEGperBIT; dd = floor(deg); // integer part of the degre mins = (deg—dd)*60.0; // find minutes mm = floor(mins); // integer part of the minut sec = (mins-mm)*60.0; // find seconds 53 = floor(sec); // integer part of the second display_dms(dd,mm,ss); // some functions that die- } Gflky W58ul+ “ 9 C5 *ke chews: 0‘? keaé‘ms prom W OP‘VfiWKU & = sin" (ZM/oowA = O. ll€ degrees T’ka rCSolu‘Hon o4: Mme Remit“ sensor stages,“ 15 OOQQEK degree per $034 30 )LE_S ‘I’ke 595%.me 3E“ ole-Rd- Wad- “Hme. vekxcle ‘15 0%? - Cours~e 4) The MSP430 has 2 USARTs which can be configured in either asynchronous UART mode or synchronous SPI mode. (15 pts) 3. Sketch block diagram of an asynchronous serial interface between the MSP430 and one external peripheral. b. Assume the asynchronous link is running at 19200 baud is used to transmit transmit the text “Done”. If the link uses 8 bit characters with 1 start bit, 1 stop bit and even parity, how long will it take to transmit the whole word. c. Sketch an SP1 serial interface between the MSP430 and one external peripheral. TX: MS’P TranSMi‘l a) H30 R :_ MSP Reach/‘5 7 Hi>0 A) ‘ __‘\______ SCC. 3) MaOOO be“); €\9\>i"_ 142.00 EOK,C. l’\ Ckavqc‘le/z) 8 \o‘\-\.5 + Skckr‘t W Ska? + PQTHB :_ \\ bHs ...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern