UMEÅ UNIVERSITET Tillämpad fysikoch elektronik Datorteknik/NE Tentamen Tentamen i Inbyggda System ( Embedded System ) Datum: 2008-05-09 Tid: 09.00-13.00 Skrivsal: 6 Hjälpmedel: miniräknare 11 frågor, 30 poäng 11 questions, 30 points 18 poäng krävs för VG 18 points is required for the grade very well Answers may be given in swedish or in english
1. The manufacturer of the radio module that you used in the first project give some suggestions for how to put the transmitted data packet together to make the transmission as safe as possible. Name at least three requirements that should be met for the packet. ( 3p ) 2. There are some different tools available for debugging an embedded system e.g. a simulator and an emulator. Explain the difference between those two debugging tools ( 2p ) 3. Kompilatorn/länkaren delar in programminnet ( flash ) i ett antal sektioner för olika typer av kod/data. Beskriv vilken typ av kod/data som finns i följande sektioner. ( 4p ) a).vectors b).progmem.data c).init d).text 4. Give at least two hints how to reduce code size in flash memory. ( 2p ) 5. A pin of one of the ports of an AVR microcontroller is attached to a device that gives a capacitive load to ground of 200 pf. The pin is switched from output, low level, to input with enabled pullup resistor. Use the attached datasheet to calculate an approximate time of delay before the PIN reaches high ( > 3 Volts ) level. ( 2p ) - t/r*c Uc = Vcc * ( 1 e )
6. Hur fort kommer motorn att snurra (inte alls, halvfart, helfart), och om den snurrar; Vilket håll? Modulationsfrekvensen är >> än motorns resonansfrekvens, så du kan räkna på medelvärdet av strömmarna genom motorn. (2p) P-kanal +V P-kanal A A N-kanal B M C N-kanal D B C 0 D 7. You have one NPN transistor and one twin contact relay. ( 3p ) Draw a schematic diagram how to connect those components to control a DC-motor going forward, backward and stopped. 8. För att realisera en bra EMC-design på en elektronisk apparat måste krav uppfyllas på att såväl emission som immunity hålls vid a störningsnivåer. Förklara vad de två engelska orden innebär. Beskriv åtminstone fem olika åtgärder som bör/kan vidtagas på en elektronikkonstruktion (inbyggt system) för att uppfylla kraven på god EMC-design. ( 5p ) 9a. I2C är ett patenterat protokoll från Philips och är inbyggt i en hel del periferikretsar. Antag att jag skall ansluta en ATMEL microcontroller till en sådan enhet. Har jag något hårdvarustöd för protokollet i microcontrollern? Beskriv. ( 1p ) b) SPI bussen är i grunden av typen 1 master/1 slave och kommunikationen är synkron och sker i full duplex. Beskriv översiktligt hur kommunikationen sker i ATMELS mer kraftfulla controllers ( gärna figur ). ( 1p )
10. Följande assemblerrutin är hämtad från manualen för ATMega88, den visar hur man skriver till det interna EEPROM-minnet. Modifiera denna assemblerrutin så att den kan kompileras tillsammans med en funktion skriven i C som anropar assemblerrutinen. Följande deklaration finns i C-programmet extern void EEPROM_write(unsigned int addr, unsigned char data); ( 2p ) EEPROM_write: ; Wait for completion of previous write sbic EECR,EEPE rjmp EEPROM_write ; Set up address (r18:r17) in address register out EEARH, r18 out EEARL, r17 ; Write data (r16) to Data Register out EEDR,r16 ; Write logical one to EEMPE sbi EECR,EEMPE ; Start eeprom write by setting EEPE sbi EECR,EEPE ret Function call conventions: Arguments - allocated left to right, r25 to r8. All arguments are aligned to start in even-numbered registers (odd-sized arguments, including char, have one free register above them). This allows making better use of the movw instruction on the enhanced core. If too many, those that don t fit are passed on the stack. Return values: 8-bit in r24 (not r25!), 16-bit in r25:r24, up to 32 bits in r22-r25, up to 64 bits in r18-r25. 8-bit return values are zero/sign-extended to 16 bits by the caller (unsigned char is more efficient than signed char - just clr r25). Arguments to functions with variable argument lists (printf etc.) are all passed on stack, and char is extended to int 11. You want to indicate high or low level of pin PB0 of the 2323 using a LED, the current through the LED should be at least 4 ma. The output ( PB0 ) must drive an input of the U2A gate. That means that low and high levels must be within legal limits, close to 0V and close to 5 V. How do you connect the LED and any additional component. The forward voltage across the LED is 1.8 V. Datasheet for the 2323 on next page. ( 3p ) +5v 0 4 2 3 1 U1 GND X1 X2 RES VCC PB0 INT/PB1 PB2 8 5 6 7 ut in 1 2 U2A 3 CD4001B AT90S2323