pracExam2sol

pracExam2sol - galujr‘ons ECE2801 PRACTICE EXAM #1 - A...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: galujr‘ons ECE2801 PRACTICE EXAM #1 - A Term 200$ Clocks, Timers, ADC and SP1 > ' — r » - ' ‘I Study HW3, HW‘I & Bonuz QuizB: Class Notes, User's Guide Ch 4, 13, 20, 15 Work all problems with your note sheet first THEN look at solutions! 1) Answer the questions below completely. (25 pts) a) Explain one advantage and one disadvantage of parallel interfaces between a CPU and its peripherals. AAV‘i—vvluse; Fas-ler beau,“ all 52+5 in more] ifoens‘l’er 4°90“er on Same. clock edge. DlS‘LdUan'kLfle: Eo‘ck 5’! 'i' Imus“ h‘WC- 0L0" e/edr'. (J Con ’lfiflfion (idercomecl, WKV'C, f'cs +rac-e\_ s ho¢+ éjts‘hm can b) Explain one advantage and one disadvantage of serial interfaces between a CPU and its peripherals. _ AJVCLA‘LCL‘je'. Rea-'Uires radar conned'ws (a “"0 bet-’80“ CPU 0.14:1. peripheral. Cam conned Ionic/15449166. Slower becau3< E145 Sen‘t' Se¢m+Ia//‘j D75 AAVcUAi‘Q‘JC' q [043 Scuva Con In 9 CHOW c) Explain the operation of a Timer in “up mode”. A ‘hmevf‘ Coun‘i's FrDM 0 +0 Fifi—5 mM2MUM Gaun‘l' {hen Vese‘i’ {:0 O and, Vfipea,“& (1) True or False: Using Timers causes a big drain on CPU speed. Explain Fake“ TV‘MVS awe peripkevoj Aevlce$.fl€ COOAi’MrD 07C CL‘l‘KMer has no impac‘t on ‘HVQ C?U. \T’He onl‘filmpac‘l' aim” lea—5 1:: 't-ls TSK. e) What is the dynamic range of a 10 bit ADC? DR: RO./Qoi3m<2w\ '3 é0.Q d5 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) void runtimerb(void) { TBCTL = TBSSEL_1 + CNTL_0 + MC_l + ID_0; TBCCRO = 16384; TBCCTLO = CCIE; } a) 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 (c) would be off by 0.025 milliseconds? Is it fast or slow? 0) TiMfly’ w ‘15 cokafiUrei +0 COUVV"\1\ M046 +0 Q Mom coon+ oC— \(D‘$%‘I.T\\e inpo+ Chit—k 75 ACLK LAPDAV &‘\V1A~QV I\S +.\M€V 4. COO-m up $¢owx 0 +016; Eq‘i cum} fienerkle cm tn'llerruF We“ Vepe‘d“ The “Fume barman interrup‘still +0 146 COUA‘l) OKFFFF ivx‘H’ClS case. I‘F +ln€ Acme“ Clock-ts ACLK; 3274,? Iniev‘ruois beau ‘OCCUTV eve/VA Z sec i 1 3 <12? I C) TECTL=TBSSEL_Z+ CMTL-O + MC.\ +ID-O\ ’ TBCCKO: aggllq; ’ i TY5CQ TLO= QCIE; 1 SMCLK= Loussn MHZ 5% (id-Li} 0.0RSSec 9k Lownguz-E 292w cows ‘cg 0.0R§ser—%=(o.oz€§k - (Ream/1.0%.“: 4c /><=é$'$?>(p (ARV-(LL: 0’3 .02? Sec. beRw-La. Clock M 034 10% .ozgse )(938’.L| senods = 27 mm zgsec. :9 We. Cloak box“ ‘09 En:ng Ln’rfrwp’r H— w\\l aswme 0.02? sec has elapsed Mew (Mk3 aozqcmqom sec. 3) A certain azimuthal heading sensor (i.e. electronic compass) has an analog output range of 0 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 dmy; PGSEL |= BITZ; // set P6.2 = l for function mode ADC12CTLO = SHTO_6 + SHT1_6 + REFON + REF2_5V + ADC120N; ADC12CTL1 = SHP; ADC12MCTL2 = SREF__1 + INCH_2; //Enable and start (single) conversion ADC12CTLO |= ADCIZSC + ENC; while (ADClZCTLl & ADCIZBUSY) dmy=l; acheading = ADC12MEM2 & 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). f) 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 7" ‘ 2 m -------- -- original heading MM <3 wok—'1"? fiat ASSUM‘KS Ahmech mapping 5:480" ov=> 0 Je rees “A 2.2V => 350‘ resold-Hm : 25V 2212 c.6lomvgbfir :OOQQ is? Jeerees/bH Q. l) "WV/61%“a \bIO mV/bH' H QB 2.1V _. 4“ "' caun+~5 0.0006a/DV/b.‘l‘. 6;) void calc_dms(unsigned int achalue) “ { const float DEGperBIT = 0.09988; // degrees per unsigned dd, mm, 55; float deg, mins, sec; 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 $5 = floor(sec); // integer part of the second display_dms(dd,mm,ss); // some functions that dis- } Waxy V6 SUH' , (9 C5 We chums: 04" Heaé‘ms Prom W Dr‘xfi‘lmqfl & = sfm‘l (ZM/Doom\ : 0.115 degrees Tke rcSolo‘hoA 04: +k€ £94.41“ gensmr SKUS‘MM 1'5 ($04qu olefireeg pew bR-l So xgs We sg‘sifim Gin ole-Rd— ‘chL-L ‘HNQ vekxcle Ks o¥~¥~<ours~e 4) The MSP430 has 2 USARTs which can be configured in either asynchronous UART mode or synchronous SPI mode. (15 pts) a. 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 SPI serial interface between the MSP430 and one external peripheral. 0% ms? Tmnmx-l )6 H30 ‘ __L_____ SCC. \33 M1000 bow: {B‘ssr‘ {42,00 EM k ClNMQCle/a <3 \o‘As + mart s sic? + (swab :_\\ bHs Z..| (n \Dx-xs/clnotr\ {and :_ 15%;}: 23,321.33 ...
View Full Document

Page1 / 7

pracExam2sol - galujr‘ons ECE2801 PRACTICE EXAM #1 - A...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online