
15
TLC2543 to MC68HC11 Microcontroller Interface
Microcontroller Features
All members of the MC68HC11 family of microcontrollers contain an SPI. As is the case for the TMS370, the user is
able to set the idle level of the serial clock of the 68HC11. This eliminates the need for an external inverter to be used
to invert the microcontroller’s serial clock output prior to its arrival at the TLC2543’s serial clock input.
The 68HC11D0, 68HC11D3 and 68HC711D3 versions do not contain an on-board ADC. One of these three devices may
prove to be the most cost effective choice when used with the TLC2543. All other versions contain either an 8- or 10-bit
resolution ADC.
Interface Circuit
Figure 12 shows the circuit diagram of the interface between the 68HC11 and the TLC2543. The microcontroller device
type used to illustrate this interface is the 48-pin dual-in-line version of the MC68HC811E2.
The master in slave out (MISO), master out slave in (MOSI) and serial clock (SCK) terminals of the SPI are available
as the alternative, user selectable, functions of port D pins PD2, PD3, and PD4 respectively. When the SPI is configured
to operate as a master, the SS/PD5 terminal can be used as an output to drive the chip select (CS) terminal of the
TLC2543. This leaves all other bidirectional I/O ports of the microcontroller uncommitted and available for other uses.
Note that no extra glue logic is required to implement the interface.
NOTES: A. Configured for single chip mode of operation
B. Maximum SPI data rate = crystal frequency/8
V
CC
I/O CLOCK
DATA INPUT
DATA OUT
CS
TLC2543 MC68HC811E2
SCK0/PD4
MISO/PD2
MOSI/PD3
SS
/PD5
V
CC
V
SS
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
ADC Mode
Channel
Number
5 V
22 pF
22 pF
10 M
GND
5 V
MODB
V
SS
Figure 12. TLC2543 to MC68HC811E2 Microcontroller Interface
Software
The listing of the program which was written to coordinate and control the interface between the TLC2543 and the
68HC811E2 is shown in List 3. The software consists of the main program and two subroutines named TLC2543 and
STORE. TLC2543 begins by providing the ADC’s chip select pulse. It then reads in channel/mode data via the port C
parallel I/O port and subsequently sends this data to the TLC2543 via the MOSI terminal of the SPI. At the same time,
the first byte of the result from the previous analog-to-digital conversion is received at the MISO terminal of the SPI.
Kommentare zu diesen Handbüchern