Главная » Просмотр файлов » Микроконтроллер Motorola 68HC11

Микроконтроллер Motorola 68HC11 (1086181), страница 15

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

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

The 15 maskableinterrupts are generated by on-chip peripheral systems. These interrupts are recognized when the global interrupt mask bit (I) in the condition code register (CCR) isclear. The three nonmaskable interrupt sources are illegal opcode trap, software interrupt, and XIRQ pin. Refer to Table 5-4, which shows the interrupt sources and vectorassignments for each source.MOTOROLA5-8RESETS AND INTERRUPTSM68HC11 E SERIESTECHNICAL DATATable 5-4 Interrupt and Reset Vector AssignmentsVector AddressFFC0, C1 – FFD4, D5FFD6, D7Interrupt SourceReservedSCI Serial SystemCCRMask BitLocalMask——I• SCI Receive Data Register FullRIE• SCI Receiver OverrunRIE• SCI Transmit Data Register EmptyTIE• SCI Transmit CompleteTCIE• SCI Idle Line DetectILIEFFD8, D9SPI Serial Transfer CompleteISPIEFFDA, DBPulse Accumulator Input EdgeIPAIIFFDC, DDPulse Accumulator OverflowIPAOVIFFDE, DFTimer OverflowITOIFFE0, E1Timer Input Capture 4/Output Compare 5II4/O5IFFE2, E3Timer Output Compare 4IOC4IFFE4, E5Timer Output Compare 3IOC3IFFE6, E7Timer Output Compare 2IOC2IFFE8, E9Timer Output Compare 1IOC1IFFEA, EBTimer Input Capture 3IIC3IFFEC, EDTimer Input Capture 2IIC2IFFEE, EFTimer Input Capture 1IIC1IFFF0, F1Real-Time InterruptIRTIIFFF2, F3IRQ (External Pin)INoneFFF4, F5XIRQ PinXNoneFFF6, F7Software InterruptNoneNoneFFF8, F9Illegal Opcode TrapNoneNoneFFFA, FBCOP FailureNoneNOCOPFFFC, FDClock Monitor FailNoneCMEFFFE, FFRESETNoneNoneFor some interrupt sources, such as the SCI interrupts, the flags are automaticallycleared during the normal course of responding to the interrupt requests.

For example,the RDRF flag in the SCI system is cleared by the automatic clearing mechanism consisting of a read of the SCI status register while RDRF is set, followed by a read of theSCI data register. The normal response to an RDRF interrupt request would be to readthe SCI status register to check for receive errors, then to read the received data fromthe SCI data register. These two steps satisfy the automatic clearing mechanism without requiring any special instructions.5.4.1 Interrupt Recognition and Register StackingAn interrupt can be recognized at any time after it is enabled by its local mask, if any,and by the global mask bit in the CCR. Once an interrupt source is recognized, theCPU responds at the completion of the instruction being executed.

Interrupt latencyM68HC11 E SERIESTECHNICAL DATARESETS AND INTERRUPTSMOTOROLA5-95varies according to the number of cycles required to complete the current instruction.When the CPU begins to service an interrupt, the contents of the CPU registers arepushed onto the stack in the order shown in Table 5-5. After the CCR value is stacked,the I bit and the X bit, if XIRQ is pending, are set to inhibit further interrupts.

The interrupt vector for the highest priority pending source is fetched, and execution continuesat the address specified by the vector. At the end of the interrupt service routine, thereturn from interrupt instruction is executed and the saved registers are pulled from thestack in reverse order so that normal program execution can resume. Refer to SECTION 3 CENTRAL PROCESSING UNIT for further information.Table 5-5 Stacking Order on Entry to Interrupts5Memory LocationCPU RegistersSPPCLSP – 1PCHSP – 2IYLSP – 3IYHSP – 4IXLSP – 5IXHSP – 6ACCASP – 7ACCBSP – 8CCR5.4.2 Non-Maskable Interrupt Request (XIRQ)Non-maskable interrupts are useful because they can always interrupt CPU operations. The most common use for such an interrupt is for serious system problems, suchas program runaway or power failure.

The XIRQ input is an updated version of the NMI(nonmaskable interrupt) input of earlier MCUs.Upon reset, both the X bit and I bit of the CCR are set to inhibit all maskable interruptsand XIRQ. After minimum system initialization, software can clear the X bit by a TAPinstruction, enabling XIRQ interrupts. Thereafter, software cannot set the X bit. Thus,an XIRQ interrupt is a non-maskable interrupt.

Because the operation of the I-bit-related interrupt structure has no effect on the X bit, the internal XIRQ pin remains unmasked. In the interrupt priority logic, the XIRQ interrupt has a higher priority than anysource that is maskable by the I bit. All I-bit-related interrupts operate normally withtheir own priority relationship.When an I-bit-related interrupt occurs, the I bit is automatically set by hardware afterstacking the CCR byte. The X bit is not affected. When an X-bit-related interrupt occurs, both the X and I bits are automatically set by hardware after stacking the CCR.A return from interrupt instruction restores the X and I bits to their pre-interrupt requeststate.5.4.3 Illegal Opcode TrapBecause not all possible opcodes or opcode sequences are defined, the MCU includes an illegal opcode detection circuit, which generates an interrupt request.

WhenMOTOROLA5-10RESETS AND INTERRUPTSM68HC11 E SERIESTECHNICAL DATAan illegal opcode is detected and the interrupt is recognized, the current value of theprogram counter is stacked. After interrupt service is complete, reinitialize the stackpointer so repeated execution of illegal opcodes does not cause stack underflow. Leftuninitialized, the illegal opcode vector can point to a memory location that contains anillegal opcode.

This condition causes an infinite loop that causes stack underflow. Thestack grows until the system crashes.The illegal opcode trap mechanism works for all unimplemented opcodes on all fouropcode map pages. The address stacked as the return address for the illegal opcodeinterrupt is the address of the first byte of the illegal opcode. Otherwise, it would bealmost impossible to determine whether the illegal opcode had been one or two bytes.The stacked return address can be used as a pointer to the illegal opcode so the illegalopcode service routine can evaluate the offending opcode.5.4.4 Software InterruptSWI is an instruction, and thus cannot be interrupted until complete. SWI is not inhibited by the global mask bits in the CCR.

Because execution of SWI sets the I mask bit,once an SWI interrupt begins, other interrupts are inhibited until SWI is complete, oruntil user software clears the I bit in the CCR.5.4.5 Maskable InterruptsThe maskable interrupt structure of the MCU can be extended to include additional external interrupt sources through the IRQ pin. The default configuration of this pin is alow-level sensitive wired-OR network. When an event triggers an interrupt, a softwareaccessible interrupt flag is set. When enabled, this flag causes a constant request forinterrupt service. After the flag is cleared, the service request is released.5.4.6 Reset and Interrupt ProcessingFigure 5-1 and Figure 5-2 illustrate the reset and interrupt process. Figure 5-1 illustrates how the CPU begins from a reset and how interrupt detection relates to normalopcode fetches.

Figure 5-2 is an expansion of a block in Figure 5-1 and illustrates interrupt priorities. Figure 5-3 shows the resolution of interrupt sources within the SCIsubsystem.M68HC11 E SERIESTECHNICAL DATARESETS AND INTERRUPTSMOTOROLA5-115HIGHESTPRIORITYPOWER-ON RESET(POR)DELAY 4064 E CYCLESEXTERNAL RESETCLOCK MONITOR FAIL(WITH CME = 1)LOWESTPRIORITYCOP WATCHDOGTIMEOUT(WITH NOCOP = 0)5LOAD PROGRAM COUNTERWITH CONTENTS OF$FFFE, $FFFF(VECTOR FETCH)LOAD PROGRAM COUNTERWITH CONTENTS OF$FFFC, $FFFD(VECTOR FETCH)LOAD PROGRAM COUNTERWITH CONTENTS OF$FFFA, $FFFB(VECTOR FETCH)SET BITS S, I, AND XRESET MCUHARDWARE1ABEGIN INSTRUCTIONSEQUENCEYBIT X INCCR = 1?NXIRQPIN LOW?YN2ASTACK CPUREGISTERSSET BITS I AND XFETCH VECTOR$FFF4, $FFF5FLOW OUT OF RESET P1Figure 5-1 Processing Flow out of Reset (1 of 2)MOTOROLA5-12RESETS AND INTERRUPTSM68HC11 E SERIESTECHNICAL DATA2AYBIT I INCCR = 1?NANY I-BITINTERRUPTPENDING?YSTACK CPUREGISTERSNFETCH OPCODEYSTACK CPUREGISTERSILLEGALOPCODE?SET BIT I IN CCRNFETCH VECTOR$FFF8, $FFF9WAIYINSTRUCTION?5STACK CPUREGISTERSNYSTACK CPUREGISTERSSWIINSTRUCTION?NNSET BIT I IN CCRFETCH VECTOR$FFF6, $FFF7YRESTORE CPUREGISTERSFROM STACKRTIINSTRUCTION?NEXECUTE THISINSTRUCTIONANYINTERRUPTPENDING?YSET BIT I IN CCRRESOLVE INTERRUPTPRIORITY AND FETCHVECTOR FOR HIGHESTPENDING SOURCESEE FIGURE 5Ð21AFLOW OUT OF RESET P2Figure 5-1 Processing Flow out of Reset (2 of 2)M68HC11 E SERIESTECHNICAL DATARESETS AND INTERRUPTSMOTOROLA5-13BEGINX BITIN CCRSET ?YESNOXIRQ PINLOW ?YESSET X BIT IN CCRFETCH VECTOR$FFF4, FFF5NOHIGHESTPRIORITYINTERRUPT?NOIRQ ?YESFETCH VECTORYESFETCH VECTOR$FFF2, FFF3NO5RTII = 1 ?YESNOREAL-TIMEINTERRUPT?YESFETCH VECTOR$FFF0, FFF1YESFETCH VECTOR$FFEE, FFEFYESFETCH VECTOR$FFEC, FFEDYESFETCH VECTOR$FFEA, FFEBYESFETCH VECTOR$FFE8, FFE9NOYESIC1I = 1 ?NOTIMERIC1F ?NOYESIC2I = 1 ?NOTIMERIC2F ?NOYESIC3I = 1 ?NOTIMERIC3F ?NOYESOC1I = 1 ?NOTIMEROC1F ?NO2A2BINT PRIORITY RES P1Figure 5-2 Interrupt Priority Resolution (1 of 2)MOTOROLA5-14RESETS AND INTERRUPTSM68HC11 E SERIESTECHNICAL DATA2A2BYOC2I = 1?YYYYTOI = 1?YYYFETCH VECTOR$FFE2, $FFE3FLAGOC5F = 1?YFETCH VECTOR$FFE0, $FFE1YFETCH VECTOR$FFDE, $FFDFYFETCH VECTOR$FFDC, $FFDDYFETCH VECTOR$FFDA, $FFDBYFETCH VECTOR$FFD8, $FFD95FLAGTOF = 1?FLAGPAOVF = 1FLAGPAIF = 1?FLAGSSPIF = 1? ORMODF = 1?NNNYNNSCIINTERRUPT?SEE FIGURE5Ð3FLAGOC4F = 1?NNSPIE = 1?FETCH VECTOR$FFE4, $FFE5NNPAII = 1?YNNPAOVI = 1?FLAGOC3F = 1NNOC5I = 1?FETCH VECTOR$FFE6, $FFE7NNOC4I = 1?YNNOC3I = 1?FLAGOC2F = 1?YFETCH VECTOR$FFD6, $FFD7FETCH VECTOR$FFF2, $FFF3ENDINT PRI RES P2Figure 5-2 Interrupt PriorityResolution (2 of 2)M68HC11 E SERIESTECHNICAL DATARESETS AND INTERRUPTSMOTOROLA5-15BEGINFLAGRDRF = 1?YNOR = 1?YY5TIE = 1?RE = 1?YTE = 1?YNYTCIE = 1?NIDLE = 1?YNNNTC = 1?YNNTDRE = 1?RIE = 1?YNYYILIE = 1?NNRE = 1?YNNOVALID SCI REQUESTVALID SCI REQUESTINT SOURCE RESFigure 5-3 Interrupt Source Resolution Within SCI5.5 Low Power OperationBoth STOP and WAIT suspend CPU operation until a reset or interrupt occurs.

TheWAIT condition suspends processing and reduces power consumption to an intermediate level. The STOP condition turns off all on-chip clocks and reduces power consumption to an absolute minimum while retaining the contents of the entire RAM array.5.5.1 WAITThe WAI opcode places the MCU in the WAIT condition, during which the CPU registers are stacked and CPU processing is suspended until a qualified interrupt is detected. The interrupt can be an external IRQ, an XIRQ, or any of the internally generatedinterrupts, such as the timer or serial interrupts. The on-chip crystal oscillator remainsactive throughout the WAIT standby period.MOTOROLA5-16RESETS AND INTERRUPTSM68HC11 E SERIESTECHNICAL DATAThe reduction of power in the WAIT condition depends on how many internal clock signals driving on-chip peripheral functions can be shut down.

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

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

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

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