Главная » Просмотр файлов » Сигнальный МП Motorola DSP56002

Сигнальный МП Motorola DSP56002 (1086189), страница 57

Файл №1086189 Сигнальный МП Motorola DSP56002 (Сигнальный МП Motorola DSP56002) 57 страницаСигнальный МП Motorola DSP56002 (1086189) страница 572018-01-12СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 57)

The INV bit determines whether 0-to-1 transitions (INV=0) or 1-to-0 transitions(INV=1) will decrement the counter. Figure 7-14 illustrates Timer Mode 7 when INV=0,and Figure 7-15 illustrates Timer Mode 7 when INV=1.Freescale Semiconductor, Inc...7.6TIMER/EVENT COUNTER BEHAVIOR DURING WAIT and STOPDuring the execution of the WAIT instruction, the timer clocks are active and the timer activity continues undisturbed. If the timer interrupt is enabled when the final event occurs,an interrupt will be generated and serviced.It is recommended that the timer be disabled before executing the STOP instruction because during the execution of the STOP instruction, the timer clocks are disabled and thetimer activity will be stopped. If, for example, the TIO pin is used as input, the changesPeriodic Event (First Event)Periodic EventTEClockTCRNCounterMN+1NN+1N+2M-1MM+1M+2InterruptTIOFigure 7-10 Period Measurement Mode (INV=0)MOTOROLADSP56002 TIMER AND EVENT COUNTERFor More Information On This Product,Go to: www.freescale.com7 - 15Freescale Semiconductor, Inc.OPERATING CONSIDERATIONSthat occur while in STOP will be ignored.7.7OPERATING CONSIDERATIONSThe value 0 for the Timer Count Register (TCR) is considered a boundary case and affects the behavior of the timer under the following conditions:Freescale Semiconductor, Inc...•If the TCR is loaded with 0, and the counter contained a non-zero value before theTCR was loaded, then after the timer is enabled, it will count 224 events, generate aninterrupt, and then generate an interrupt for every new event.Periodic Event (First Event)Periodic EventTEClockTCR NCounterMN+1NN+1N+2M-1MM+1M+2InterruptTIOFigure 7-11 Period Measurement Mode (INV=1)7 - 16DSP56002 TIMER AND EVENT COUNTERFor More Information On This Product,Go to: www.freescale.comMOTOROLAFreescale Semiconductor, Inc.SOFTWARE EXAMPLES•If the TCR is loaded with 0, and the counter contained a zero value prior to loading,then after the timer is enabled, it will generate an interrupt for every event.•If the TCR is loaded with 0 after the timer has been enabled, the timer will be loadedwith 0 when the current count is completed and then generate an interrupt for everynew event.Freescale Semiconductor, Inc...7.8SOFTWARE EXAMPLES7.8.1General Purpose I/O InputThe following routine can be used to read the TIO input pin:MOVEP#$000040,X:TCSR;clear TC2-TC0, set GPIO;and clear INV for GPIO input hereFirst EventWrite Preload (N)Last EventTETIO (Event)N+1NTCRCounterNN+1FFFFFFFF00InterruptFigure 7-12 Standard Time Counter Mode, External Clock (INV=0)MOTOROLADSP56002 TIMER AND EVENT COUNTERFor More Information On This Product,Go to: www.freescale.com7 - 17Freescale Semiconductor, Inc.SOFTWARE EXAMPLESJSET#DI,X:TCSR,here;spin here until TIO is setFreescale Semiconductor, Inc...7.8.2General Purpose I/O OutputThe following routine can be used to write the TIO output pin:MOVEP#$000140,X:TCSR;clear TC2-TC0, set GPIO and;set DIR for GPIO output, set TIO to 0BSETNOP#DO,X:TCSR;set TIO to 1Write Preload (N)First EventLast EventTETIO (Event)N+1NTCRCounterNN+1FFFF0FFFF 0InterruptFigure 7-13 Standard Timer Mode, External Clock (INV=1)7 - 18DSP56002 TIMER AND EVENT COUNTERFor More Information On This Product,Go to: www.freescale.comMOTOROLAFreescale Semiconductor, Inc.SOFTWARE EXAMPLESNOPBCLR#DO,X:TCSR;set TIO to 0This routine generates a pulse on the TIO pin with the duration equal to 8 CLK (assumingno wait states, no external bus conflict, etc.)Freescale Semiconductor, Inc...7.8.3Timer Mode 0, Input Clock, GPIO Output, and No Timer OutputThe following program illustrates the standard timer mode with simultaneous GPIO.

Thetimer is used to activate an internal task after 65536 clocks; at the end of the task the TIOpin is toggled to signal end of task.ORGJSRORGP:$3CTASKP:MAIN_BODY;this is timer interrupt vector address;go and execute task (long interrupt)First EventWrite Preload (N)Last EventTETIO (Event)TCRCounterNNN-10NInterruptFigure 7-14 Standard Timer Mode, External Clock (INV=0)MOTOROLADSP56002 TIMER AND EVENT COUNTERFor More Information On This Product,Go to: www.freescale.com7 - 19Freescale Semiconductor, Inc.SOFTWARE EXAMPLESMOVEPFreescale Semiconductor, Inc...BSETMOVEPBSETANDIBSET#$000042,X:TCSR ;enable timer interrupts and enable GPIO; (input!) and set DO =0 to have stable data#DIR,X:TCSR;change DIR to output (clean 0, no spikes)#$00FFFF,X:TCR ;load 64k -1 into the counter#IPL,X:IPR;enable IPL for timer#$CF,MR;remove interrupt masking in status register#TE,X:TCSR; timer enable......; application program.....task.....; task instructions....end_of_taskWrite Preload (N)First EventLast EventTETIO (Event)TCRNCounterNN-10NInterruptFigure 7-15 Standard Timer Mode, External Clock (INV=1)7 - 20DSP56002 TIMER AND EVENT COUNTERFor More Information On This Product,Go to: www.freescale.comMOTOROLAFreescale Semiconductor, Inc.SOFTWARE EXAMPLESBSETBCLRRTI#DO,X:TCSR#DO,X:TCSR;set TIO to signal end of task;clear TIO;return to main programFreescale Semiconductor, Inc...7.8.4Pulse Width Measurement Mode (Timer Mode 4)The following program illustrates the usage of the timer module for input pulse widthmeasurement.

The width is measured in this example for the low active period of theinput pulse on the TIO pin and is stored in a table (in multiples of the chip operating clockdivided by 2).ORGpulse_width DSX:$100$100ORGP:$3CMOVEP X:TCR,X:(r0)+NOP;define buffer in X memory internal;measure up to 256 pulses;this is timer interrupt vector address;store width value in table;second word of the short interrupt....ORGP:MAIN_BODY.....MOVE #PULSE_WIDTH,r0 ;r0 points to start of tableMOVE #$FF,M0;modulo 100 to wrap around on end of tableMOVEP #$000026,X:TCSR ;enable timer interrupts, mode 4 and set INV;to measure the low active pulseBSET #IPL,X:IPR;enable IPL for timerANDI#$CF,MR;remove interrupt masking in status registerBSET #TE,X:TCSR;timer enable......; do other tasks.....7.8.5Period Measurement Mode (Timer Mode 5)The following program illustrates the usage of the timer module for input period measurement.

The period is measured in this example between 0 to 1 transitions of the input signalon TIO and is stored in a table (in multiples of the chip operating clock divided by 2).periodtempMOTOROLAORGDSDSX:$100$100$1;define buffer in X memory internal;measure up to 256 pulses;temporary storageDSP56002 TIMER AND EVENT COUNTERFor More Information On This Product,Go to: www.freescale.com7 - 21Freescale Semiconductor, Inc.SOFTWARE EXAMPLESORGJSRP:$3CMEASUREORGP:MAIN_BODY;this is timer interrupt vector address;long interrupt to measure period....Freescale Semiconductor, Inc........MOVE #0,X:TEMPMOVE #PERIOD,r0MOVE #$FF,M0MOVEP #$00002A,X:TCSRBSET #IPL,X:IPRANDI #$CF,MRBSET #TE,X:TCSR;clear temporary storage;r0 points to start of table;modulo 100 to wrap around on end of table;enable timer interrupts, mode 5;enable IPL for timer;remove interrupt masking in status register;timer enable......; do other tasks.....measureMOVEP X:TCR,A;read new counter valueMOVE X:TEMP,X0;retrieve former read value (initially zero)SUBX0,A A,X:TEMP ;compute delta (i.e.

new -old) and store the;new read value in tempMOVE A,X:(R0)+;store period value in tableRTI7 - 22DSP56002 TIMER AND EVENT COUNTERFor More Information On This Product,Go to: www.freescale.comMOTOROLAFreescale Semiconductor, Inc.APPENDIX AFreescale Semiconductor, Inc...BOOTSTRAPANDROM CODE0100101001011010101010101011011010 01010010100101110101010101001011110000100010101010010001000101010111010100110101000110101011001011001110100011000100101001011010111010101010010111 1010101010110110110100101001011010101010101011011001010010100101110 0010 010100101001011101011010101010010111100010101010010001000101010111011100010101010010001000101010111011011011101101001101001010101010101010001101010110010110011101000100 1010100011010101 100101100111010010101101011010100110110101011010101010101011011001 001001010010110101101001010101001010101001010101010010010100101101010101010101101101010101010010111010100101001011111010101010010111 010100101001011110001010101001000100010101011101001010101010101010100000101011001011000101010100100010001010101110110101000110101011001011001110100010010100101101010101010101101101010100011010101100101100111010010001010101001000100010101011101101011011101101001101001010110101010100101110101001010010111010010100101101010101010101101101010100011010101100101100111010010001010101001000100010101011101010101010101010100101110101001010010111101101110110100110100101011010100011010101100101100111010010001010101001000100010101011101010101010100011010101100101100111010010001010101001000100010101011101101101110110100110100101011010100011010101100101100111010001010MOTOROLAFor More Information On This Product,Go to: www.freescale.comA-1Freescale Semiconductor, Inc.SECTION CONTENTSINTRODUCTION .

Характеристики

Тип файла
PDF-файл
Размер
2,17 Mb
Тип материала
Высшее учебное заведение

Список файлов учебной работы

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6547
Авторов
на СтудИзбе
300
Средний доход
с одного платного файла
Обучение Подробнее