{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw7_sol_s10 - EEL LWLM WM#1 So‘kxknmg [email protected] Qer‘m i...

Info iconThis preview shows pages 1–4. 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 Document Right 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 Document Right Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EEL LWLM WM #1 -. So‘kxknmg H @731 Qer‘m; i % : AAA‘CCSS ‘\A&wév\3 QK’C ()QO\Q\W qxpfiog ’MZ’ A0 I 5000 4p; Q??? [ML / A0 NZL i i H g.‘ R‘AQ -\\\OJoooO/Oooo;oooo 4m :33} [Mix] mtg «A /‘ Cos k coat in: kenoac , a i \ Ada 1" \ \ « is N “« \ i M,E/[email protected]\ exam“; Ea; a 2 (/9—571 Which memory types, dynamic or static, requires refreshing? Dynamic memory 1‘ 9—7 A 16 megabyte memory is to be designed using lMeg x 1—bit chips. V - How many RAM chips will be required? — 128 How many address lines will be used on each chip? — 20 How many address line are required for the entire memory? — 24 Hammowk TF7 Frag/Low [Oil ;Juan Bij-Kebbe ;HW#7 ;A student would like to use their DSP board to trigger a camera for time lapsed photography. ;Specifically they are photographing the growth of a Cypress tree nub over a years time by taking photos ;every 30 days. The camera trigger is connected to GPIO0 and requires a low—high-low pulse to trigger a ;snapshot. Create a program that uses polling on the Timerl flag to generate this trigger every 30 days. ;Show all required initialization code and do not use an interrupt. .global _c_int00 ;This assembler directive allows _c_int00 to be a ;global variable. This tells the linker where your ;program (.text code) begins and where to boot from. ;**************************************************************************************** GPAMUXl .set 0X6F86 GPATOGGLE .set 0x6FC6 GPADIR .set 0X6F8A GPADAT .set 0X6FCO INT13_VECT .set 0x00001A ;VECTOR FOR TIMERl INTERUPT, VMAP = 0 TIMREGPG .set @xC00>>6 ;START OF TIMER REGISTER PAGE TIMERlPRD .set 0x0COA ;HOLDS PERIOD OF COUNTER TIMERlPRDH .set OXOCDB ;HOLDS PERIOD OF COUNTER [HIGH] TIMERlTCR .set 0XOCOC ;TIMER CONTROL REGISTER TIMERlPR .set 0x0COE ;MSB CURRENT PRESCALLER COUNT, PRESCALE AMOUNT [LOW BYTES] TIMERlPRH .set DXOCOF ;MSB CURRENT PRESCALLER COUNT, PRESCALE AMOUNT [HIGH BYTES] ;we need 25920005 so that in 30 days, the camera will fire the flash. ;This needs to be multimplied times 7.5MHz. So 25920005*7.5*10A6Hz= l.944*10A13 (in decimal) ;1.944e13 = 0x11AE3A4B6000. So, if we make the prescale = 19440 (dec), 0x4BB® ;the period becomes 1*10A9= 0X3B9ACA00 PERIODL .set 0xCA00 ;16 BIT LOWER COUNT VALUE PERIODH .set 0x389A ;16 BIT UPPER COUNT VALUE PRESCALEL .set 0xEF ;8 BIT LOWER PRESCALE VALUE, because it is (Prescale +1)*Period. PRESCALEH .set 0x43 ;8 BIT UPPER PRESCALE VALUE ;**************************************************************************************** .text ;program section, see the command linker file, program code ;should be placed in the text section which starts at 0x9000 -c_int00: LC INIT_CPU ;INITIALIZE CPU (OBJMODE, DISABLE WATCHDOG) LC INIT_0UTPUTO ‘;INITIALIZE LED (OUTPUT, MUX = 00) LC INITETIMER1_INT ;INTITIALIZE TIMER (PRS = 132h, TIM = F FFFFh, ENABLE INTS) 0R IER,#0X1000 ;ENABLE INT13 (BIT 12 IN IER) MUST BE DONE WITH AN 0R CLRC INTM ;ENABLE GLOBAL INTS CHECK MOV ARO,#TIMER1TCR MOV AL,*ARO ;bring the value of TIMERlTCR AND AL,#0x8000 ;mask the highest bit CMP AL,#0x0000 ;if it is 0, the timer got to 0. B TOGGLE,EQ ;so it goes to toggle the bit, and fire the flash B CHECK,UNC ;if not we need to keep checking TOGGLE MOV ARl, #GPATOGGLE ;LOAD ARl WITH ADDRESS OF GPIOD MOV *ARl, #1 ;TOGGLE GPI00 3 times, so that it goes 1, 0 and then 1 MOV *ARl, #1; MOV *ARl, #1 TSET *ARO,#15 ;sets the 15 bit high, to clear the flag, B CHECK,UNC ;goes back up to the check INIT_CPU: PUSH DP SETC OBJMODE ;allow 32 bit mov instructions EALLOW ;allow write access to GPIO regs MOVZ DP,#0x7029>>6 ;turn off that pesky watchdog timer MOV @7029h,#0x68 POP DP LRET INIT_OUTPUTO: PUSH ARO PUSH ARl MOV ARO,#0 ;Set Mux for I/O purposes MOV AR1,#GPAMUX1 [ l l i i E 1 E § 1 z 1 i l 1 l MOV *AR1,[email protected] MOV ARO,#0x1 ;Set GPIOO as an output MOV AR1,#GPADIR MOV *AR1,[email protected] POP ARl POP ARO LRET INIT_TIMER1_INT: PUSH DP ;SAVE NEEDED REGISTER CLRC VMAP ;SET INTERUPT VECTORS TO BEGINING 0F MEMORY MAP ;INSTEAD OF THE END. THIS ALLOWS USER TO WRITE THE ;ADDRESS OF THE ISR DIRECTLY INTO THE INTERUPT VECTOR, ;SINCE THIS IS RAM INSTEAD OF ROM (WHICH IS AT THE END) MOV DP, #TIMREGPG ;SET DATA PAGE TO TIMER REGISTERS MOV @TIMERlPRD, #PERIODL ;SET PERIOD (2 INSTRUCTIONS) MOV @TIMERlPRDH, #PERIODH MOV @TIMERIPR, #PRESCALEL ;SET PRESCALER (2 INSTRUCTIONS) MOV @WIMERlPRH, #PRESCALEH TSET @WIMERlTCR, #14 ;SET BIT 14 TO ENABLE TIMERl TSET @TIMERlTCR, #5 ;LOAD PRESCALER AND PERIOD MOVL XARO, #INT13_VECT ;NEED TO LOAD INT VECTOR WITH ISR ADDRESS MOV *[email protected]++, #TOGGLE ;LOAD LOWER BYTE (LITTLE ENDIAN) MOV *XARO, #TOGGLE>>16 ;LOAD UPPER BYTE POP DP ;RESTORE REGISTER LRET E i ...
View Full Document

{[ snackBarMessage ]}