<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=MFP_MK68901</id>
	<title>MFP MK68901 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=MFP_MK68901"/>
	<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=MFP_MK68901&amp;action=history"/>
	<updated>2026-05-26T10:06:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=MFP_MK68901&amp;diff=14888&amp;oldid=prev</id>
		<title>&gt;Tompee at 11:53, 1 November 2008</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=MFP_MK68901&amp;diff=14888&amp;oldid=prev"/>
		<updated>2008-11-01T11:53:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:53, 1 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l523&quot;&gt;Line 523:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 523:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Timers A and B.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Timers A and B.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Programming]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>&gt;Tompee</name></author>
	</entry>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=MFP_MK68901&amp;diff=14887&amp;oldid=prev</id>
		<title>&gt;Simonsunnyboy at 17:38, 23 June 2006</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=MFP_MK68901&amp;diff=14887&amp;oldid=prev"/>
		<updated>2006-06-23T17:38:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
MK68901 MFP (Multi-Function Peripheral)&lt;br /&gt;
---------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Introduction&lt;br /&gt;
&lt;br /&gt;
The MK68901 MFP (Multi-Function Peripheral) is a combination of many of the&lt;br /&gt;
necessary peripheral functions in a microprocessor system. Included are:&lt;br /&gt;
&lt;br /&gt;
        Eight parallel I/O lines&lt;br /&gt;
        Interrupt controller for 16 sources&lt;br /&gt;
        Four timers&lt;br /&gt;
        Sungle channel full duplex USART&lt;br /&gt;
&lt;br /&gt;
The use of the MFP in a system can significantly reduce chip count, thereby&lt;br /&gt;
reducing system cost. The MFP is completely 68000 bus compatible, and 24&lt;br /&gt;
directly addressable internal registers provide the necessary control and&lt;br /&gt;
status interface to the programmer.&lt;br /&gt;
&lt;br /&gt;
The MFP is a derivative of the MK3801, a Z80 family peripheral.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Register MAP&lt;br /&gt;
&lt;br /&gt;
Address   Abbreviation   Register Name&lt;br /&gt;
Port #&lt;br /&gt;
&lt;br /&gt;
0         GPIP           General purpose I/O&lt;br /&gt;
1         AER            Active edge register&lt;br /&gt;
2         DDR            Data direction register&lt;br /&gt;
&lt;br /&gt;
3         IERA           Interrupt enable register A&lt;br /&gt;
4         IERB           Interrupt enable register B&lt;br /&gt;
5         IPRA           Interrupt pending register A&lt;br /&gt;
6         IPRB           Interrupt pending register B&lt;br /&gt;
7         ISRA           Interrupt in-service register A&lt;br /&gt;
8         ISRB           Interrupt in-service register B&lt;br /&gt;
9         IMRA           Interrupt mask register A&lt;br /&gt;
A         IMRB           Interrupt mask register B&lt;br /&gt;
B         VR             Vector register&lt;br /&gt;
&lt;br /&gt;
C         TACR           Timer A control register&lt;br /&gt;
D         TBCR           Timer B control register&lt;br /&gt;
E         TCDCR          Timers C and D control registers&lt;br /&gt;
F         TADR           Timer A data register&lt;br /&gt;
10        TBDR           Timer B data register&lt;br /&gt;
11        TCDR           Timer C data register&lt;br /&gt;
12        TDDR           Timer D data register&lt;br /&gt;
&lt;br /&gt;
13        SCR            Sync character register&lt;br /&gt;
14        UCR            USART control register&lt;br /&gt;
15        RSR            Receiver status register&lt;br /&gt;
16        TSR            Transmitter status register&lt;br /&gt;
17        UDR            USART data register&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Interrupts&lt;br /&gt;
&lt;br /&gt;
The General Purpose I/O-Interrupt Port (GPIP) provides eight I/O lines that&lt;br /&gt;
may be operated either as inputs or outputs under software control. In&lt;br /&gt;
addition, each line may generate an interrupt on either a positive going edge&lt;br /&gt;
or a negative going edge of the input signal.&lt;br /&gt;
&lt;br /&gt;
The GPIP has three associated registers. One allows the programmer to specify&lt;br /&gt;
the Active Edge for each bit that will trigger an interrupt. Another register&lt;br /&gt;
specifies the Data Direction (input or output) associated with each bit. The&lt;br /&gt;
third register is the actual data I/O register used to input or output data&lt;br /&gt;
to the port. These three registers are illustrated below.&lt;br /&gt;
&lt;br /&gt;
General Purpose I/O Registers&lt;br /&gt;
&lt;br /&gt;
                    Active Edge Register&lt;br /&gt;
Port 1 (AER)  GPIP GPIP GPIP GPIP GPIP GPIP GPIP GPIP   1=Rising&lt;br /&gt;
               7    6    5    4    3    2    1    0     0=Falling&lt;br /&gt;
&lt;br /&gt;
                    Data Direction Register&lt;br /&gt;
Port 2 (DDR)  GPIP GPIP GPIP GPIP GPIP GPIP GPIP GPIP   1=Output&lt;br /&gt;
               7    6    5    4    3    2    1    0     0=Input&lt;br /&gt;
&lt;br /&gt;
                    General Purpose I/O Register&lt;br /&gt;
Port 3 (GPIP) GPIP GPIP GPIP GPIP GPIP GPIP GPIP GPIP&lt;br /&gt;
               7    6    5    4    3    2    1    0&lt;br /&gt;
&lt;br /&gt;
The Active Edge Register (AER) allows each of the General Purpose Interrupts&lt;br /&gt;
to produce an interrupt on either a 1-0 transition or a 0-1 transition.&lt;br /&gt;
Writing a zero to the appropriate bit of the AER causes the associated input&lt;br /&gt;
to produce an interrupt on the 1-0 transition, while a 1 causes the interrupt&lt;br /&gt;
on the 0-1 transition. The edge bit is simply one input to an exclusive-or&lt;br /&gt;
gate, with the other input coming from the input buffer and the output going&lt;br /&gt;
to a 1-0 transition detector. Thus, depending upon the state of the input,&lt;br /&gt;
writing the AER can cause an interrupt-producing transition, which will cause&lt;br /&gt;
an interrupt on the associated channel, if that channnel is enabled. One&lt;br /&gt;
would than normally configure the AER before enabling interrupts via IERA an&lt;br /&gt;
IERB. Note: changing the edge bit, with the interrupt enabled, may cause an&lt;br /&gt;
interrupt on that channel.&lt;br /&gt;
&lt;br /&gt;
The Data Direction Register (DDR) is used to define I0-I7 as input or as&lt;br /&gt;
outputs on a bit by bit basis. Writing a zero into a bit of the DDR causes&lt;br /&gt;
the corresponding Interrupt I/O pin to be a Hi-Z Input. Writing a one into a&lt;br /&gt;
bit of the DDR causes the corresponding pin to be configured as a push-pull&lt;br /&gt;
output. When data is written into the GPIP, those pins defined as inputs will&lt;br /&gt;
remain in the Hi-Z state while those pins defines as outputs will assume the&lt;br /&gt;
state (high or low) of their corresponding bit in the PIP. When the GPIP is&lt;br /&gt;
read, the data read will come directly from the corresponding bit of the GPIP&lt;br /&gt;
register for all pins defines as output, while the data read on all pins&lt;br /&gt;
defined as inputs will come from the input buffers.&lt;br /&gt;
&lt;br /&gt;
Each individual functions in the MK68901 is provided with a unique interrupt&lt;br /&gt;
vector that is presented to the system during the interrupt acknowledge&lt;br /&gt;
cycle. The interrupt vector returned during the interrrupt acknowledge cycle&lt;br /&gt;
is shown below.&lt;br /&gt;
&lt;br /&gt;
Interrupt Vector&lt;br /&gt;
         V7   V6   V5   V4   V3   V2   V1   V0&lt;br /&gt;
         \-----------------/\----------------/&lt;br /&gt;
                  |                  |&lt;br /&gt;
                  |                  ------------ Vector bits 3-0 supplied&lt;br /&gt;
                  |                               by the MFP based upon the interrupting&lt;br /&gt;
                  |                               channel.&lt;br /&gt;
                  |&lt;br /&gt;
                  ------------------------------- 4 most significant bits. Copied&lt;br /&gt;
                                                  from the vector register.&lt;br /&gt;
Vector Register&lt;br /&gt;
         V7   V6   V5   V4    S    *    *    *&lt;br /&gt;
         \-----------------/  |&lt;br /&gt;
                  |           |&lt;br /&gt;
                  |           ------------------- S In-Service Register Enable&lt;br /&gt;
                  |&lt;br /&gt;
                  ------------------------------- Upper 4 bits of the Vector Register&lt;br /&gt;
                                                  Written into by the user.&lt;br /&gt;
&lt;br /&gt;
There are 16 vector addresses generated internally by the MK68901, one for&lt;br /&gt;
each of the 16 interrupt channels.&lt;br /&gt;
&lt;br /&gt;
The Interrupt Control Registers provide control of interrupt processing for&lt;br /&gt;
all I/O facilities of the MK68901. These registers allow the programmer to&lt;br /&gt;
enable or disable any or all of the 16 interrupts, providing masking for any&lt;br /&gt;
interrupts, and provide access to the pending and in-service status of the&lt;br /&gt;
interrupts. Optional end-of-interrupt modes are availble under software&lt;br /&gt;
control.&lt;br /&gt;
&lt;br /&gt;
Interrupt Control Registers&lt;br /&gt;
&lt;br /&gt;
                    Interrupt Enable Registers&lt;br /&gt;
Port 3 (IERA) GPIP  GPIP TIMER  RCV   RCV  XMIT   XMIT TIMER&lt;br /&gt;
               7     6     A    Full  Err  Empty  Err    B&lt;br /&gt;
&lt;br /&gt;
Port 4 (IERB) GPIP  GPIP TIMER TIMER  GPIP  GPIP  GPIP  GPIP&lt;br /&gt;
               5     4     C     D     3     2     1     0&lt;br /&gt;
&lt;br /&gt;
                    Interrupt Pending Registers&lt;br /&gt;
Port 5 (IPRA) GPIP  GPIP TIMER  RCV   RCV  XMIT   XMIT TIMER&lt;br /&gt;
               7     6     A    Full  Err  Empty  Err    B&lt;br /&gt;
Port 6 (IPRB) GPIP  GPIP TIMER TIMER  GPIP  GPIP  GPIP  GPIP&lt;br /&gt;
               5     4     C     D     3     2     1     0&lt;br /&gt;
                         Writing 0: Clear&lt;br /&gt;
                         Writing 1: Unchanged&lt;br /&gt;
&lt;br /&gt;
                    Interrupt In-Service Registers&lt;br /&gt;
Port 7 (ISRA) GPIP  GPIP TIMER  RCV   RCV  XMIT   XMIT TIMER&lt;br /&gt;
               7     6     A    Full  Err  Empty  Err    B&lt;br /&gt;
Port 8 (ISRB) GPIP  GPIP TIMER TIMER  GPIP  GPIP  GPIP  GPIP&lt;br /&gt;
               5     4     C     D     3     2     1     0&lt;br /&gt;
&lt;br /&gt;
                    Interrupt Mask Registers&lt;br /&gt;
Port 9 (IMRA) GPIP  GPIP TIMER  RCV   RCV  XMIT   XMIT TIMER&lt;br /&gt;
               7     6     A    Full  Err  Empty  Err    B&lt;br /&gt;
Port A (IMRB) GPIP  GPIP TIMER TIMER  GPIP  GPIP  GPIP  GPIP&lt;br /&gt;
               5     4     C     D     3     2     1     0&lt;br /&gt;
                    1: UnMasked    0: Masked&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Interrupt Control Register Definitions&lt;br /&gt;
&lt;br /&gt;
Priority   Channel   Description&lt;br /&gt;
Highest     1111      General Purpose Interrupt 7(I7)&lt;br /&gt;
            1110      General Purpose Interrupt 6(I6)&lt;br /&gt;
            1101      Timer A&lt;br /&gt;
            1100      Receive Buffer Full&lt;br /&gt;
            1011      Receive Error&lt;br /&gt;
            1010      Transmit Buffer Empty&lt;br /&gt;
            1001      Transmit Error&lt;br /&gt;
            1000      Timer B&lt;br /&gt;
            0111      General Purpose Interrupt 5(I5)&lt;br /&gt;
            0110      General Purpose Interrupt 4(I4)&lt;br /&gt;
            0101      Timer C&lt;br /&gt;
            0100      Timer D&lt;br /&gt;
            0011      General Purpose Interrupt 3(I3)&lt;br /&gt;
            0010      General Purpose Interrupt 2(I2)&lt;br /&gt;
            0001      General Purpose Interrupt 1(I1)&lt;br /&gt;
Lowest      0000      General Purpose Interrupt 0(I0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Interrupts may be either polled or vectored. Each channel may be individually&lt;br /&gt;
enabled or disabled by writing a one or a zero in the appropriate bit of the&lt;br /&gt;
Interrupt Enable Registers (IERA,IERB). When disabled, an interrupt channel&lt;br /&gt;
is completely inactive. Any internal or external action which would normally&lt;br /&gt;
produce an interrupt on that channel is ignored and any pending interrupt on&lt;br /&gt;
that channel will be cleared by disabling that channel. Disabling and&lt;br /&gt;
interrupt channel has no effect on the corresponding bit in Interrupt&lt;br /&gt;
in-Service Registers (ISRA,ISRB); thus, if the In-Service Registers are used&lt;br /&gt;
and an interrupt is in service on that channel when the channel is disabled,&lt;br /&gt;
it will remain in service until cleared in the normal manner. IERA and IERB&lt;br /&gt;
are also readable.&lt;br /&gt;
&lt;br /&gt;
When an interrupt is received on an enabled channel, its corresponding bit in&lt;br /&gt;
the pending register will be set. When that channel is acknowledged it will&lt;br /&gt;
pass its vector, and the corresponding bit in the Interrupt Pending Register&lt;br /&gt;
(IPRA or IPRB) will be cleared. IPRA and IPRB are readable; thus by polling&lt;br /&gt;
IPRA and IPRB, it can be determind whether a channel has a pending interrupt.&lt;br /&gt;
IPRA and IPRB are also writeable and a pending interrupt can be cleared&lt;br /&gt;
without going through the acknowledge sequence by writing a zero to the&lt;br /&gt;
appropriate bit. This allows any one bit to be cleared, without altering any&lt;br /&gt;
other bits, simply by writing all ones except for the bit position to be&lt;br /&gt;
cleared on IPRA or IPRB. Thus a full polled interrupt scheme is possible.&lt;br /&gt;
Note: writing a one to IPRA, IPRB has no effect on the interrupt pending&lt;br /&gt;
register.&lt;br /&gt;
&lt;br /&gt;
The interrupt mask registers (IMRA and IMRB) may be used to block a channel&lt;br /&gt;
from making an interrupt request. Writing a zero into the corresponding bit&lt;br /&gt;
of the mask register will still allow the channel to receive and interrupt&lt;br /&gt;
and latch it into its pending bit (if that channel is enabled), but will&lt;br /&gt;
prevent that channel from making an interrupt request. If that channel is&lt;br /&gt;
causing an interrupt request at the time the corresponding bit in the mask&lt;br /&gt;
register is cleared, the request will cease. If no other channel is making a&lt;br /&gt;
request, INTR will go inactive. If the mask bit is re-enabled, any pending&lt;br /&gt;
interrupt is now free to resume its request unless blocked by a higher&lt;br /&gt;
priority request for service. IMRA and iMRB are also readable.&lt;br /&gt;
&lt;br /&gt;
A conceptual circuit of an interrupt&lt;br /&gt;
&lt;br /&gt;
       Edge       Enable                     Mask&lt;br /&gt;
    Register    Register                   Register              S-Bit&lt;br /&gt;
       |           |                          |                    |&lt;br /&gt;
       |           |                          ----|---\            --|---\ |------------|&lt;br /&gt;
       |           o-----|---\ |-----------|      |    |---o---------|    ||S Interrupt |&lt;br /&gt;
       ---\\--\    |     |    ||S Pending Q|------|---/    |       --|---/ |   Service  |&lt;br /&gt;
          ||   |---|-----|---/ |     R     |               |       |       |------------|&lt;br /&gt;
 I7-------//--/    |           |-----------|               |       |&lt;br /&gt;
                   |                 |                 Interrupt   |&lt;br /&gt;
                 -----             /---\                Request    |&lt;br /&gt;
                 \   /             |   |                           |&lt;br /&gt;
                  \ /              /---\                           |&lt;br /&gt;
                   o                | |                            |&lt;br /&gt;
                   |                | |                            |&lt;br /&gt;
                   ------------------ -----------------------------o------ Pass Vector&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are two end-of-interrupt modes: the automatic end-of-interrupt mode and&lt;br /&gt;
the software end-of-interrupt mode. The mode is selected by writing a one or&lt;br /&gt;
a zero to the S bit of the Vector Register (VR). If the S bit of the VR is a&lt;br /&gt;
one, all channels operate in the software end-of-interrupt mode. If the S bit&lt;br /&gt;
is a zero, all channels operate in the automatic end-of-interrupt mode, and a&lt;br /&gt;
reset is held on all in-service bits. In the automatic end-of-interrupt mode,&lt;br /&gt;
the pending bit is cleared when that channel passes its vector. At that&lt;br /&gt;
point, no further history of that interrupt remains in the MK68901 MFP. In&lt;br /&gt;
the software end-of-interrupt mode, the in-service bit is set and the pending&lt;br /&gt;
bit is cleared when the channel passes its vector. With the in-service bit&lt;br /&gt;
set, no lower priority channel is allowed to request an interrupt or to pass&lt;br /&gt;
its vector during an acknowledge sequence, however, a lower priority channel&lt;br /&gt;
may still receive and interrupt and latch it into the pending bit. A higher&lt;br /&gt;
priority channel may stillrequest an interrupt and be acknowledged, The in-service bit of a particular&lt;br /&gt;
channel may be cleared by writing a zero to the corresponding bit in ISRA or&lt;br /&gt;
ISRB. Typically, this will be done at the conclusion of the interrupt routine&lt;br /&gt;
just before the return. Thus no lower priority channel will be allowed to&lt;br /&gt;
request service until the higer priority channel is complete, while channels&lt;br /&gt;
of still higher priority will be allowed to request service. While the&lt;br /&gt;
in-service bit is set, a second interrupt on that channel may be received and&lt;br /&gt;
latched into the pending bit, though no service request will be made in&lt;br /&gt;
response to the second interrupt until the in-service bit is cleared. ISRA&lt;br /&gt;
and ISRB may be read at any time. Only a zero may be written into any bit of&lt;br /&gt;
ISRA and ISRB; thus the in-service may be cleared in software but cannot be&lt;br /&gt;
set in software. This allows any one bit to be cleared, without altering any&lt;br /&gt;
other bits, simply by writing all ones except for the bit position to be&lt;br /&gt;
cleared to ISRA or ISRB, as with IPRA and IPRB.&lt;br /&gt;
&lt;br /&gt;
Each interrupt channel responds with a discrete 8-bit vector when&lt;br /&gt;
acknowledged. The upper four bits of the vector are set by writing the upper&lt;br /&gt;
four bits of the VR. The four low order bits (bit 3-bit 0) are generated by&lt;br /&gt;
the interrupt channel.&lt;br /&gt;
&lt;br /&gt;
To acknowledge an interrupt, IACK goes low, the IEI input must go low (or be&lt;br /&gt;
tied low) and the MK68901 MFP must have acknowledgeable interrupt pending.&lt;br /&gt;
The daisy chaining capability requires that all parts in a chain have a&lt;br /&gt;
command IACK. When the command IACK goes low all parts freeze and prioritize&lt;br /&gt;
interrupts in parallel. Then priority is passed down the chain, via IEI and&lt;br /&gt;
IEO, until a part which has a pending interrupt is reached. The part with&lt;br /&gt;
the pending interrupt, passes a vector, does not propagate IEO, and generates&lt;br /&gt;
DTACK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Timers&lt;br /&gt;
&lt;br /&gt;
There are four timers on the MK68901 MFP. Two of the timers (Timer A and&lt;br /&gt;
Timer B) are full function timers which can perform the basic delay function&lt;br /&gt;
and can also perform event counting, pulse width measurement and waveform&lt;br /&gt;
generation. The other two timers (Timer C and Timer D) are delay timers only.&lt;br /&gt;
One or both of these timers can be used to supply the baud rate clocks for&lt;br /&gt;
the USART. All timers are prescaler/counter timers with a common independent&lt;br /&gt;
clock input (XTAL1, XTAL2). In addition, all timers have a time-out output&lt;br /&gt;
function that toggles each time the timer times out.&lt;br /&gt;
&lt;br /&gt;
The four timers are programmed via three Timer Control Registers and four&lt;br /&gt;
Timer Data Registers. Timers A and B are controlled bu the control registers&lt;br /&gt;
TACR and TBCR, respectively, and by the data registers TADR and TBDR. Timers&lt;br /&gt;
C and D are controlled by the control register TCDCR and two data registers&lt;br /&gt;
TCDR and TDDR. Bits in the control registers allow the selection of&lt;br /&gt;
operational mode, prescale, and control, while data registers are used to&lt;br /&gt;
read the timer or write into the time constant register. Timer A and B input&lt;br /&gt;
pins, TAI and TBI, are used for the event and pulse width modes for timers A&lt;br /&gt;
and B.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Timer Data Registers (A,B,C and D)&lt;br /&gt;
&lt;br /&gt;
     Port F (TADR)    D7   D6   D5   D4   D3   D2   D1   D0&lt;br /&gt;
&lt;br /&gt;
     Port 10 (TBDR)   D7   D6   D5   D4   D3   D2   D1   D0&lt;br /&gt;
&lt;br /&gt;
     Port 11 (TCDR)   D7   D6   D5   D4   D3   D2   D1   D0&lt;br /&gt;
&lt;br /&gt;
     Port 12 (TDDR)   D7   D6   D5   D4   D3   D2   D1   D0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Timer A and B Control Register&lt;br /&gt;
&lt;br /&gt;
     Port C (TACR)    *    *    *  Reset AC3  AC2  AC1  AC0&lt;br /&gt;
&lt;br /&gt;
     Port D (TBCR)    *    *    *  Reset BC3  BC2  BC1  BC0&lt;br /&gt;
&lt;br /&gt;
              C3  C2  C1  C0&lt;br /&gt;
               0   0   0   0   Timer Stopped&lt;br /&gt;
               0   0   0   1   Delay Mode, /4 Prescale&lt;br /&gt;
               0   0   1   0   Delay Mode, /10 Prescale&lt;br /&gt;
               0   0   1   1   Delay Mode, /16 Prescale&lt;br /&gt;
               0   1   0   0   Delay Mode, /50 Prescale&lt;br /&gt;
               0   1   0   1   Delay Mode, /64 Prescale&lt;br /&gt;
               0   1   1   0   Delay Mode, /100 Prescale&lt;br /&gt;
               0   1   1   1   Delay Mode, /200 Prescale&lt;br /&gt;
               1   0   0   0   Event Count Mode&lt;br /&gt;
               1   0   0   1   Pulse Width Mode, /4 Prescale&lt;br /&gt;
               1   0   1   0   Pulse Width Mode, /10 Prescale&lt;br /&gt;
               1   0   1   1   Pulse Width Mode, /16 Prescale&lt;br /&gt;
               1   1   0   0   Pulse Width Mode, /50 Prescale&lt;br /&gt;
               1   1   0   1   Pulse Width Mode, /64 Prescale&lt;br /&gt;
               1   1   1   0   Pulse Width Mode, /100 Prescale&lt;br /&gt;
               1   1   1   1   Pulse Width Mode, /200 Prescale&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Timer C and D Control Register&lt;br /&gt;
&lt;br /&gt;
     Port E (TCDCR)   *   CC2  CC1  CC0   *   DC2  DC1  DC0&lt;br /&gt;
&lt;br /&gt;
                  C2  C1  C0&lt;br /&gt;
                   0   0   0   Timer Stopped&lt;br /&gt;
                   0   0   1   Delay Mode, /4 Prescale&lt;br /&gt;
                   0   1   0   Delay Mode, /10 Prescale&lt;br /&gt;
                   0   1   1   Delay Mode, /16 Prescale&lt;br /&gt;
                   1   0   0   Delay Mode, /50 Prescale&lt;br /&gt;
                   1   0   1   Delay Mode, /64 Prescale&lt;br /&gt;
                   1   1   0   Delay Mode, /100 Prescale&lt;br /&gt;
                   1   1   1   Delay Mode, /200 Prescale&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the timer stopped, no counting can occur. The timer contents will remain&lt;br /&gt;
unaltered while the timer is stopped (unless reloaded by writing the Timer&lt;br /&gt;
Data Register), but any residual count in the prescaler will be lost.&lt;br /&gt;
&lt;br /&gt;
In the delay mode, the prescaler is always active. A count pulse will be&lt;br /&gt;
applied to the main timer unit each time the prescribed number of timer clock&lt;br /&gt;
cycles has elapsed. Thus, if the prescaler is programmed to divide by ten, a&lt;br /&gt;
count pulse will be applied to the main counter every ten cycles of the timer&lt;br /&gt;
clock.&lt;br /&gt;
&lt;br /&gt;
Each time a count pulse is applied to the main counter, it will decrement&lt;br /&gt;
its contents. The main counter is initially loaded by writing to the Timer&lt;br /&gt;
Data Register. Each count pulse will cause the current count to decrement.&lt;br /&gt;
When the timer has decremented down to '01', the next count pulse will not&lt;br /&gt;
cause it to decrement to '00'. Instead the next count pulse will cause the&lt;br /&gt;
timer to be reloaded from the Timer Data Register. Additionally, a 'Time Out'&lt;br /&gt;
pulse will be produced. This Time Out pulse is coupled to the timer interrupt&lt;br /&gt;
channel, and, if that channel is enabled an interrupt will be produced. The&lt;br /&gt;
Time Out pulse is also coupled to the timer output pin and will cause the pin&lt;br /&gt;
to change states. The output will remain in this new state until the next&lt;br /&gt;
Time Out pulse occurs. Thus the output will complete one full cycle each two&lt;br /&gt;
Time Out pulses.&lt;br /&gt;
&lt;br /&gt;
If, for example, the prescaler were programmed to divide by ten, and the&lt;br /&gt;
Timer Data Register were loaded will 100(decimal), the main counter would&lt;br /&gt;
decrement once for every ten cycles of the timer clock. A Time Out pulse will&lt;br /&gt;
occur(hence an interrupt if that channel is enabled) every 1000 cycles of the&lt;br /&gt;
timer clock, and the timer output will complete one full cycle every 2000&lt;br /&gt;
cycles of the timer clock.&lt;br /&gt;
&lt;br /&gt;
The main counter is an 8-bit binary down counter. If may be read at any time&lt;br /&gt;
by reading the Timer Data Register. The information read is the information&lt;br /&gt;
last clocked into the timer read register when the DS pin had last gone high&lt;br /&gt;
prior to the current read cycle. When written, data is loaded into the Timer&lt;br /&gt;
Data Register, and the main counter, if the timer is stopped. If the Timer&lt;br /&gt;
Data Register is written while the timer is running, the new word is not&lt;br /&gt;
loaded into the timer until it counts through H01. However, if the timer is&lt;br /&gt;
written while it is counting through H01, an indeterminate value will be&lt;br /&gt;
written into the time constant register. This may be circumvented by ensuring&lt;br /&gt;
that the daata register is not written when the count is H01.&lt;br /&gt;
&lt;br /&gt;
If the main counter is loaded with 01, a Time Out Pulse will occur every&lt;br /&gt;
time the prescaler presents a count pulse to the main counter. If loaded&lt;br /&gt;
with 00, a Time Out pulse will occur after every 256 count pulses.&lt;br /&gt;
&lt;br /&gt;
Changing the prescale value with the timer running can cause the first Time&lt;br /&gt;
Out pulse to occur at an indeterminate time, (no less than one nor more than&lt;br /&gt;
200 timer clock cycles times the number in the time constant register), but&lt;br /&gt;
subsequent Time Out pulses will then occur at the correct interval.&lt;br /&gt;
&lt;br /&gt;
In addition to the delay mode described above, Timers A and B can also&lt;br /&gt;
function in Pulse Width Measurement mode or in the Event Count mode. In&lt;br /&gt;
either of these two modes, an auxilary count signal is required. The auxilary&lt;br /&gt;
control input for Timer A is TAI, and for Timer B, TBI is used. The interrupt&lt;br /&gt;
channels associated with I4 and I3 are used for TAI and TBI, respectively, in&lt;br /&gt;
Pulse Width mode.&lt;br /&gt;
&lt;br /&gt;
The pulse width measurement mode functions much like the delay mode. However,&lt;br /&gt;
in this mode, the auxiliary control signal on TAI or TBI acts as an enable to&lt;br /&gt;
the timer. When the control signal on TAI or TBI is inactive, the timer will&lt;br /&gt;
be stopped. When it is active, the prescaler and main counter are allowed to&lt;br /&gt;
run. Thus the width of the active pulse on TAI or TBI is determined by the&lt;br /&gt;
number of timer counts which occur while the pulse allows the timer to run.&lt;br /&gt;
The active state of the signal on TAI or TBI is dependent upon the associated&lt;br /&gt;
Interrupt Channels edge bit (GPIP4 for TAI and GPIP3 for TBI, see Active Edge&lt;br /&gt;
Register). If the edge bit associated with the TAI or TBI input is a one, it&lt;br /&gt;
will be active high, thus the timer will be allowed to run when the input is&lt;br /&gt;
at a high level. If the edge bit is a zero, the TAI or TBI input will be&lt;br /&gt;
active low. As previously stated, the interrupt channel (I3 or I4) associated&lt;br /&gt;
with the input still functions when the timer is used in the pulse width&lt;br /&gt;
measurement mode. However, if the timer is programmed for the pulse width&lt;br /&gt;
measurement mode, the interrupt caused by transitions on the associated TAI&lt;br /&gt;
or TBI input will occur on the opposite transition.&lt;br /&gt;
&lt;br /&gt;
A conceptual circuit of the MFP timer in the pulse width measurement mode&lt;br /&gt;
&lt;br /&gt;
                            |-----|&lt;br /&gt;
                            | TAI |&lt;br /&gt;
                            |-----|&lt;br /&gt;
                               |&lt;br /&gt;
                               -----------|---\&lt;br /&gt;
  Timer A                                 |    |----&lt;br /&gt;
  Pulse Width Mode ------------o----------|---/    |&lt;br /&gt;
                               |                   |---\---\      |-----------|&lt;br /&gt;
                               |                        |   |-----| Interrupt |&lt;br /&gt;
           |----|              |   |\              |---/---/      |  Channel  |&lt;br /&gt;
           | I4 |-------|      ----| o----|---\    |              |-----------|&lt;br /&gt;
           |----|       |          |/     |    |----&lt;br /&gt;
                        ------------------|---/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                        ------------------|---\&lt;br /&gt;
           |----|       |          |\     |    |----&lt;br /&gt;
           | I3 |-------|      ----| o----|---/    |&lt;br /&gt;
           |----|              |   |/              |---\---\      |-----------|&lt;br /&gt;
                               |                        |   |-----| Interrupt |&lt;br /&gt;
  Timer B                      |                   |---/---/      |  Channel  |&lt;br /&gt;
  Pulse Width Mode ------------o----------|---\    |              |-----------|&lt;br /&gt;
                                          |    |----&lt;br /&gt;
                               -----------|---/    &lt;br /&gt;
                               |&lt;br /&gt;
                            |-----|&lt;br /&gt;
                            | TBI |&lt;br /&gt;
                            |-----|&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, if the edge bit associated with the TAI input (AER-GPIP 4) is a&lt;br /&gt;
one, an interrupt would normally be generated on the 0-1 transition of the I4&lt;br /&gt;
input signal. If the timer associated with this input (Timer A) is placed in&lt;br /&gt;
the pulse width measurement mode, the interrupt will occur on the 1-0&lt;br /&gt;
transition of the TAI signal instead. Because the edge bit (AER-GPIP4) is a&lt;br /&gt;
one, Timer A will be allowed to count while the input is high. When the TAI&lt;br /&gt;
input makes the high to low transition, Timer A will stop, and it is at this&lt;br /&gt;
point that the interrupt will occur (assuming that the channel is enabled).&lt;br /&gt;
This allows the interrupt to signal the CPU that the pulse being measured has&lt;br /&gt;
terminated this Timer A may now be read to determine the pulse width. (Again&lt;br /&gt;
note that I3 and I4 may still be used for I/O when the timer is in the pulse&lt;br /&gt;
width measurement mode). If Timer A is re-programmed for another mode,&lt;br /&gt;
interrupts will again occur on the transition, as normally defined by the&lt;br /&gt;
edge bit. Note that, like changing the edge bit, placing the timer into or&lt;br /&gt;
taking it out of pulse width mode can produce a transition on the signal to&lt;br /&gt;
the interrupt channel and may cause an interrupt. If measuring consecutive&lt;br /&gt;
pulses, it is obvious that one must read the contents of the timer and&lt;br /&gt;
reinitalize the main counter by writing to the timer data register. If the&lt;br /&gt;
timer data register is written while the pulse is going to the active state,&lt;br /&gt;
the write operation may result in an indeterminate value being written into&lt;br /&gt;
the main counter. If the timer is written after the pulse goes active, the&lt;br /&gt;
timer counts from the previous contents, and when it counts through H01, the&lt;br /&gt;
correct value is written into the timer. The pulse width then includes counts&lt;br /&gt;
from before the timer was reloaded.&lt;br /&gt;
&lt;br /&gt;
In the event count mode, the prescaler is disabled. Each time the control&lt;br /&gt;
input on TAI or TBI makes an active transition as defined by the associated&lt;br /&gt;
Interrupt Channel's edge bit, a count pulse will be generated, and the main&lt;br /&gt;
counter will decrement. In all other respects, the timer functions as&lt;br /&gt;
previously described. Altering the edge bit while the timer is in the event&lt;br /&gt;
count mode can produce a count pulse. The interrupt channel associated with&lt;br /&gt;
the input (I3 for TBI or I4 for TAI) is allowed to function normally. To&lt;br /&gt;
count transitions reliably, the input must remain in each state (1/0) for a&lt;br /&gt;
length of time equal to four perioids of the timer clock; thus signals of a&lt;br /&gt;
frequency up to one fourth of the timer clock can be counted.&lt;br /&gt;
&lt;br /&gt;
The manner in which the timer output pins toggle states has previously been&lt;br /&gt;
described. All timer outputs will be forced low by a device RESET. The output&lt;br /&gt;
associated with Timers A and B will toggle on each Time Out pulse regardless&lt;br /&gt;
of the mode the timers are programmed to. In addition, the outputs from&lt;br /&gt;
Timers A and Timers B can be forced low at any time by writing a 1 to the&lt;br /&gt;
reset location in TACR and TBCR, respectively. The output will be forced to&lt;br /&gt;
the low state during the WRITE operation, and at the conclusion of the&lt;br /&gt;
operation, the output will again be free to toggle each time a Time Out pulse&lt;br /&gt;
occurs. This feature will allow waveform generation.&lt;br /&gt;
&lt;br /&gt;
During reset, the Timer Data Registers and the main counters are not reset.&lt;br /&gt;
Also, if using the reset option on Timers A or B, one must make sure to keep&lt;br /&gt;
the other bits in the correct state so as not to affect the operation of&lt;br /&gt;
Timers A and B.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>&gt;Simonsunnyboy</name></author>
	</entry>
</feed>