Silicon ChipComputer Bits - September 1992 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Low voltage lighting is not low wattage
  4. Feature: A Tutorial On PC-Based Data Acquisition by David Potter
  5. Project: Heavy-Duty 5A Drill Speed Controller by Leo Simpson
  6. Feature: Computer Bits by Mike Zenere
  7. Vintage Radio: Repairing an old Heatkit RF generator by John Hill
  8. Project: The Interphone Digital Telephone Exchange; Pt.2 by Jeff Monegal
  9. Project: A Multi-Sector Home Burglar Alarm; Pt.1 by Mike Zenere
  10. Serviceman's Log: Death rattles: a thorny problem by The TV Serviceman
  11. Project: A General-Purpose 3 1/2 Digit Panel Meter by Darren Yates
  12. Feature: Amateur Radio by Garry Cratt, VK2YBX
  13. Feature: The Story of Electrical Energy; Pt.20 by Bryan Maher
  14. Feature: Remote Control by Bob Young
  15. Back Issues
  16. Order Form
  17. Market Centre
  18. Advertising Index
  19. Outer Back Cover

This is only a preview of the September 1992 issue of Silicon Chip.

You can view 51 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Computer Bits (July 1989)
  • Computer Bits (July 1989)
  • Computer Bits (August 1989)
  • Computer Bits (August 1989)
  • Computer Bits (September 1989)
  • Computer Bits (September 1989)
  • Computer Bits (October 1989)
  • Computer Bits (October 1989)
  • Computer Bits (November 1989)
  • Computer Bits (November 1989)
  • Computer Bits (January 1990)
  • Computer Bits (January 1990)
  • Computer Bits (April 1990)
  • Computer Bits (April 1990)
  • Computer Bits (October 1990)
  • Computer Bits (October 1990)
  • Computer Bits (November 1990)
  • Computer Bits (November 1990)
  • Computer Bits (December 1990)
  • Computer Bits (December 1990)
  • Computer Bits (January 1991)
  • Computer Bits (January 1991)
  • Computer Bits (February 1991)
  • Computer Bits (February 1991)
  • Computer Bits (March 1991)
  • Computer Bits (March 1991)
  • Computer Bits (April 1991)
  • Computer Bits (April 1991)
  • Computer Bits (May 1991)
  • Computer Bits (May 1991)
  • Computer Bits (June 1991)
  • Computer Bits (June 1991)
  • Computer Bits (July 1991)
  • Computer Bits (July 1991)
  • Computer Bits (August 1991)
  • Computer Bits (August 1991)
  • Computer Bits (September 1991)
  • Computer Bits (September 1991)
  • Computer Bits (October 1991)
  • Computer Bits (October 1991)
  • Computer Bits (November 1991)
  • Computer Bits (November 1991)
  • Computer Bits (December 1991)
  • Computer Bits (December 1991)
  • Computer Bits (January 1992)
  • Computer Bits (January 1992)
  • Computer Bits (February 1992)
  • Computer Bits (February 1992)
  • Computer Bits (March 1992)
  • Computer Bits (March 1992)
  • Computer Bits (May 1992)
  • Computer Bits (May 1992)
  • Computer Bits (June 1992)
  • Computer Bits (June 1992)
  • Computer Bits (July 1992)
  • Computer Bits (July 1992)
  • Computer Bits (September 1992)
  • Computer Bits (September 1992)
  • Computer Bits (October 1992)
  • Computer Bits (October 1992)
  • Computer Bits (November 1992)
  • Computer Bits (November 1992)
  • Computer Bits (December 1992)
  • Computer Bits (December 1992)
  • Computer Bits (February 1993)
  • Computer Bits (February 1993)
  • Computer Bits (April 1993)
  • Computer Bits (April 1993)
  • Computer Bits (May 1993)
  • Computer Bits (May 1993)
  • Computer Bits (June 1993)
  • Computer Bits (June 1993)
  • Computer Bits (October 1993)
  • Computer Bits (October 1993)
  • Computer Bits (March 1994)
  • Computer Bits (March 1994)
  • Computer Bits (May 1994)
  • Computer Bits (May 1994)
  • Computer Bits (June 1994)
  • Computer Bits (June 1994)
  • Computer Bits (July 1994)
  • Computer Bits (July 1994)
  • Computer Bits (October 1994)
  • Computer Bits (October 1994)
  • Computer Bits (November 1994)
  • Computer Bits (November 1994)
  • Computer Bits (December 1994)
  • Computer Bits (December 1994)
  • Computer Bits (January 1995)
  • Computer Bits (January 1995)
  • Computer Bits (February 1995)
  • Computer Bits (February 1995)
  • Computer Bits (March 1995)
  • Computer Bits (March 1995)
  • Computer Bits (April 1995)
  • Computer Bits (April 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • Computer Bits (July 1995)
  • Computer Bits (July 1995)
  • Computer Bits (September 1995)
  • Computer Bits (September 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits (December 1995)
  • Computer Bits (December 1995)
  • Computer Bits (January 1996)
  • Computer Bits (January 1996)
  • Computer Bits (February 1996)
  • Computer Bits (February 1996)
  • Computer Bits (March 1996)
  • Computer Bits (March 1996)
  • Computer Bits (May 1996)
  • Computer Bits (May 1996)
  • Computer Bits (June 1996)
  • Computer Bits (June 1996)
  • Computer Bits (July 1996)
  • Computer Bits (July 1996)
  • Computer Bits (August 1996)
  • Computer Bits (August 1996)
  • Computer Bits (January 1997)
  • Computer Bits (January 1997)
  • Computer Bits (April 1997)
  • Computer Bits (April 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Computer Bits (July 1997)
  • Computer Bits (July 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits (September 1997)
  • Computer Bits (September 1997)
  • Computer Bits (October 1997)
  • Computer Bits (October 1997)
  • Computer Bits (November 1997)
  • Computer Bits (November 1997)
  • Computer Bits (April 1998)
  • Computer Bits (April 1998)
  • Computer Bits (June 1998)
  • Computer Bits (June 1998)
  • Computer Bits (July 1998)
  • Computer Bits (July 1998)
  • Computer Bits (November 1998)
  • Computer Bits (November 1998)
  • Computer Bits (December 1998)
  • Computer Bits (December 1998)
  • Control Your World Using Linux (July 2011)
  • Control Your World Using Linux (July 2011)
Articles in this series:
  • A Multi-Sector Home Burglar Alarm; Pt.1 (September 1992)
  • A Multi-Sector Home Burglar Alarm; Pt.1 (September 1992)
  • A Multi-Sector Home Burglar Alarm; Pt.2 (October 1992)
  • A Multi-Sector Home Burglar Alarm; Pt.2 (October 1992)
Items relevant to "A General-Purpose 3 1/2 Digit Panel Meter":
  • General-Purpose 3-1/2 Digit Panel Meter PCB pattern [04110921] (Free)
Articles in this series:
  • Amateur Radio (November 1987)
  • Amateur Radio (November 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (February 1988)
  • Amateur Radio (February 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (January 1989)
  • Amateur Radio (January 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (February 1990)
  • Amateur Radio (February 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (July 1990)
  • Amateur Radio (July 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (January 1991)
  • Amateur Radio (January 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (January 1992)
  • Amateur Radio (January 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (January 1993)
  • Amateur Radio (January 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (February 1994)
  • Amateur Radio (February 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (January 1995)
  • Amateur Radio (January 1995)
  • CB Radio Can Now Transmit Data (March 2001)
  • CB Radio Can Now Transmit Data (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • Stressless Wireless (October 2004)
  • Stressless Wireless (October 2004)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Dorji 433MHz Wireless Data Modules (January 2012)
  • Dorji 433MHz Wireless Data Modules (January 2012)
Articles in this series:
  • The Technology Letters, Pt.2 (January 1989)
  • The Technology Letters, Pt.2 (January 1989)
  • The Story Of Electrical Energy (July 1990)
  • The Story Of Electrical Energy (July 1990)
  • The Story Of Electrical Energy; Pt.2 (August 1990)
  • The Story Of Electrical Energy; Pt.2 (August 1990)
  • The Story Of Electrical Energy; Pt.3 (September 1990)
  • The Story Of Electrical Energy; Pt.3 (September 1990)
  • The Story Of Electrical Energy; Pt.4 (October 1990)
  • The Story Of Electrical Energy; Pt.4 (October 1990)
  • The Story Of Electrical Energy; Pt.5 (November 1990)
  • The Story Of Electrical Energy; Pt.5 (November 1990)
  • The Story Of Electrical Energy; Pt.6 (December 1990)
  • The Story Of Electrical Energy; Pt.6 (December 1990)
  • The Story Of Electrical Energy; Pt.7 (January 1991)
  • The Story Of Electrical Energy; Pt.7 (January 1991)
  • The Story Of Electrical Energy; Pt.8 (February 1991)
  • The Story Of Electrical Energy; Pt.8 (February 1991)
  • The Story Of Electrical Energy; Pt.9 (March 1991)
  • The Story Of Electrical Energy; Pt.9 (March 1991)
  • The Story Of Electrical Energy; Pt.10 (May 1991)
  • The Story Of Electrical Energy; Pt.10 (May 1991)
  • The Story Of Electrical Energy; Pt.11 (July 1991)
  • The Story Of Electrical Energy; Pt.11 (July 1991)
  • The Story Of Electrical Energy; Pt.12 (August 1991)
  • The Story Of Electrical Energy; Pt.12 (August 1991)
  • The Story Of Electrical Energy; Pt.13 (September 1991)
  • The Story Of Electrical Energy; Pt.13 (September 1991)
  • The Story Of Electrical Energy; Pt.14 (October 1991)
  • The Story Of Electrical Energy; Pt.14 (October 1991)
  • The Story Of Electrical Energy; Pt.15 (November 1991)
  • The Story Of Electrical Energy; Pt.15 (November 1991)
  • The Story Of Electrical Energy; Pt.16 (December 1991)
  • The Story Of Electrical Energy; Pt.16 (December 1991)
  • The Story Of Electrical Energy; Pt.17 (January 1992)
  • The Story Of Electrical Energy; Pt.17 (January 1992)
  • The Story Of Electrical Energy; Pt.18 (March 1992)
  • The Story Of Electrical Energy; Pt.18 (March 1992)
  • The Story Of Electrical Energy; Pt.19 (August 1992)
  • The Story Of Electrical Energy; Pt.19 (August 1992)
  • The Story of Electrical Energy; Pt.20 (September 1992)
  • The Story of Electrical Energy; Pt.20 (September 1992)
  • The Story Of Electrical Energy; Pt.21 (November 1992)
  • The Story Of Electrical Energy; Pt.21 (November 1992)
  • The Story Of Electrical Energy; Pt.22 (January 1993)
  • The Story Of Electrical Energy; Pt.22 (January 1993)
  • The Story of Electrical Energy (April 1993)
  • The Story of Electrical Energy (April 1993)
  • The Story Of Electrical Energy; Pt.24 (May 1993)
  • The Story Of Electrical Energy; Pt.24 (May 1993)
  • The Story Of Electrical Energy; Pt.24 (June 1993)
  • The Story Of Electrical Energy; Pt.24 (June 1993)
Articles in this series:
  • Remote Control (August 1992)
  • Remote Control (August 1992)
  • Remote Control (September 1992)
  • Remote Control (September 1992)
  • Remote Control (October 1992)
  • Remote Control (October 1992)
COMPUTER BITS BY MIKE ZENERE A look at the 68705 microcontroller By using the right technology, lighting controllers, music synthesisers, keypad entry modules and burglar alarms can be custom designed with relative ease. Next month, we will feature a home burglar alarm based on the 68705P3 microcontroller, so let's take a look at what's inside this very versatile chip. The 68705P3 is a complete microcomputer on a chip. It contains CPU, EPROM, RAM, 20 pins of bidirectional I/O, a 15-bit interval timer and a clock. This circuitry is all contained in a 28pin package, with no external address or data buses. To make full use of the 68705P3's features, we have to understand its capabilities in both hardware and software terms. Fig.1 shows a block diagram of the MCU (Micro Control Unit). At the heart of the chip is the CPU (Central Processing Unit), which is made up of both a controller and an XTAL TIMER Prescaler ALU (Arithmetic Logic Unit). All executable instructions are decoded by the ALU under the direction of the controller. The 68705P3 has several types of memory, the first being 112 bytes of RAM (Random Access Memory). This may not seem like a large amount at first glance, but remember that this area is used to hold stack data and to keep track of variables. The second type of memory is ROM (Read Only Memory). This is not usable by the programmer under normal conditions but is implemented EXTAL Timer / 8 RESET INT Vpp Counter T1mer Control Accumul ator A 8 CPU Inde x Pon A 1/0 L,nes PAO PA1 PA2 PA3 PA4 PA5 PA6 PA7 8 Register Control Da ta 01 r Pon B Reg Reg X 5 Reg Regist er cc CPU Stack 5 Pointer SP Data OH Reg Progr am Cou nte r 1804 X 8 EPROM 115 X 8 8001s trap ROM The 68705P3 has 20 I/O (input/output) lines, all of which are programmable as inputs or outputs. These I/O lines are grouped into three ports: A, B and C. Ports A and B are both eight bits wide, while port C is only four bits wide. All three ports are TTL compatible and differ in the following way: port A lines, when in the input mode, float high due to internal pull-up resistors, whereas port B lines are capable of sinking l0mA of current. This means that LEDs may be driven directly from port B. · Along with each port is an associated DDR (Data Direction Register). The DDR operates under program control and is used to tell the port whether its associated bits are inputs or outputs. The clocking source for the processor is quite versatile, and there are four options available. Fig.2(a) shows how the unit can be PB0 clocked by an external PB1 Pon P82 source, while Fig.2(b) 8 PB3 1/ 0 PB4 shows how · the clock frePB5 Lines Code Dat a Q ,r Input/output PB6 PB? Condition Port A Reg when the program needs to be burnt into the on-board EPROM (Erasable Programmable Read Only Memory). The 1804 bytes of EPROM are used to hold the program on a permanent basis so that even if power is removed, the program is not lost. 3 High PCH Port C Reg ALU Program Coun1er 8 Low PCL 112 X B RAM PC0 PC1 PC2 PC3 Port C 1/ 0 Lines Fig.I: block diagram of the 68705P3 microcontroller. It contains a CPU, 1804 bytes of EPROM, 112 bytes of RAM & 20 programmable I/O lines. SEPTEMBER1992 37 ,rno,17 •r___n . : . . CLOC; u , --l__J c[],. .fi] (c) 27Pf~ .,. (d) Fig.2: the unit can be clocked by an external source (a) or by an on-board oscillator. The on-board oscillator frequency can be set by an external resistor (b); by a link (c); or can be crystal controlled (d). qu en cy can be set by an external resistor. Fig 2(c) shows how the on-board oscillator is selected. Finally, Fig.2 (d) shows how a crystal is applied between pins 4 & 5 to obtain an accurate clock signal. Returning to Fig.1 again, we can see that the processor can be interrupted through the INT input. Normally, th e processor executes a desired program but, under certain circumstances, it may be required to halt normal operations and temporarily run a different program. This interrupt line is also quite flexible and is able to accept both analog and digital signals. This is accomplished by a Schmitt trigger which can detect the zero crossing points of an AC signal. PROGRiM COUNTER Other interrupts STACK POINTER There are two other ways of interrupting the processor: (1) by using a software interrupt instruction; and (2) by using an interrupt generated by the count out of the on-board interval timer. The interval timer and its optional prescaler are software selectable. Once the counter is loaded, it starts to decrement at the rate of the internal clock. When it reaches zero, an interrupt is generated which the processor may or may not acknowledge, depending upon the setting of internal flags. The prescaler is a 7-bit divider and is used to extend the count of the timer. Resetting of the processor can be accomplished in two ways. First, a lµF capacitor is connected from its RESET pin (pin 28) to ground. This provides sufficient time at power up for the oscillator to stabilise. The second way is to apply a digital (logic 1°1°1°1°1 1 1•1•1•1•1•1 1 1 CONDITION CODE REGISTER HALF-CARRY INTERRUPT MASK NEGATIVE-----' ZERO-----' CARRY------' Fig.3: this diagram shows the 68705 programming model, with the condition code register at .the bottom of the list. This register keeps track of certain operations and is acted upon during the course of the program. low) signal to the RESET line from an external circuit. Software overview The instruction set for the 68705 series of processors is well suited for bit manipulation and testing. Both the HITACHI COMPACT SERIES SCOPES C RT READOUT AND CURSOR SCOPES CRT READOUT SCOPES V-1065A DC to 100MHz V-665A DC to 60MHz V-1060 DC to 100MHz V-660 DC to 60MHz Dual c hannel, delayed sweep, CRT readout, cursor readout (not prov ided on t he V- 1060 and V- 660), frequency counter (not prov ided on the V- 1060 and V-660), sweep tim e autorang in g, trigger lock. Hi tachi Compact features CRT Readout, Sweep Ti me A uto rang in g and Trigge r Lock Functio ns. 'II ST LUCIA ELECTRONICS 'II 24 Campbell St. Bowen Hills V212 AT $719 + TAX (V212 NOT SHOWN) AND "FLUKE" SCOPE METER'S FROM $1459 + TAX. <at> HITACHI 38 S ILI CON CHIP Q 4006. Tel: (07) 252 7466 Fax (07) 252 2862 ECONOMIC ELECTRON/CS: 22 Campbell St. Bowen"Hills Q 4006. P.O. Box 481, Fortitude Valley 4006. Tel: /07) 252 3762. Fax /07) 252 5778. SOUTHPORT ELECTRONIC SHOP: Shop 1, 10 Welch St. Southport Q 4215. Tel: /075) 32 3632. Fax: /075) 51 0543. accumulator and the index registers are eight bits wide, while the program counter is 11 bits wide. This gives the MCU a total address range of 2048 locations. This number includes all ROM, RAM, EPROM, 1/0 ports and DDRs. The stack pointer is also 11 bits wide but is only capable of obtaining_ a depth of 32 bytes as the top 6 bits are fixed. This might seem like a small number but is sufficient for most applications. TABLE 1: 68705 MEMORY $000 Port A $001 Port B $002 Port C (low order nibble only) $003 Not used $004 Data direction register, Port A $005 Data direction register, Port B $006 Data direction register, Port C (low order nibble only) $007 Not used Programming model $008 Timer data register Fig.3 shows the 68705 programming model with the condition code register at the bottom of the list. This register keeps track of certain operations and is acted upon during the course of the program. The first bit informs us if a CARRY has resulted from adding two BCD (Binary Coded Decimal) numbers. The second bit lets us tell the CPU to ignore any interrupts. The third bit tells us if a negative number was stored in the accumulator, while the fourth bit tells us if the value of the accumulator was 0. Finally, the fifth bit informs us if a CARRY was required for the last operation. The entire memory map is shown in Table 1. Notice how all of the RAM, 1/0 ports, timer registers and DDRs reside in page 0, while the EPROM starts in page 1. At the end of memory, there are four vectors and each has its own individual use. These four vectors are: (1) RESET - when power is first applied. (2) INT - when there is a change of state on pin 2. (3) SWI-when the instruction SWI (software interrupt) is encountered in the program. (4) TIV ~ when the internal timer times out. When any of the above four conditions are met, the processor loads its program counter with the data contained in the two locations associated with that interrupt and continues execution from that point. $009 Timer control register $00A Not used $00B Program control register $DOC - $00F Not used $010- $07F RAM $080 -$783 EPROM $784 Mask options register $785- $7F7 Bootstrap ROM (EPROM burner program) $7F8-$7F9 Timer interrupt vector $7FA- $7FB External interrupt vector $7FC-$7FD SWI interrupt vector $?FE - $?FF Reset vector Address modes There is a total of 10 address modes that the 68705P3 can use. Because the range is rather extensive we will only look at a few of the more commonly used ones. Immediate: the first one we come across is the immediate addressing mode, which deals with constants. For example, LDA 30 loads the accumulator with the value 30. Direct: the direct addressing mode is used to load variables rather than constants. Therefore, LDA 30 instructs the processor to load the accumulator with the contents of location 30. In this mode, only page zero is accessible as the effective address is specified by a single byte. Extended: the extended addressing mode is similar to the direct addressing mode except that two bytes are used to form the effective address. Thus , LDA 700 instructs the processor to load the accumulator with the contents of location 700. The disadvantage with this is that execution time is slower and the instruction takes up an extra byte of memory. Inherent: in this addressing mode, there is no effective address. These instructions are used when all of the required information is already in the CPU. As an example, the instruction CLR X would load the index register with all zeros; ie, it would be cleared. Indexed: there are three types of indexed addressing modes accessible to the programmer. (1) Type a: indexed - no offset. The instruction LDA,X instructs the processor to load the accumulator with the contents of the address pointed to by the index register. (2) Type b: indexed - 8-bit offset. With this instruction, the contents of the index register are added to the 8bit offset to give a final address from which the data is manipulated; eg, LDA 40,X. (3) Type c: indexed - 16-bit offset. This 2-byte indexed form of addressing allows complete coverage of the entire address range. For example , the instruction LDA 700,X results in the number 700 being added to the contents of the index register, and then the accumulator is loaded from this final location. Bit manipulation & testing The instruction set for the 68705 series of chips has all of the usual commands as well as some very powerful and interesting bit instructions. The first two we are going to look at are Bit Set and Bit Clear. For example, BSET 3,DRA sets bit 3 . of data register A to logic 1, while BCLR 7,7F sets bit 7 of RAM location 7F to logic 0. The next two unique instructions are Branch If Bit Set and Branch If Bit Clear. Both of these instructions test the designated bit and branch accordingly. For example, BRSET 7,60,20 is decoded as "test bit 7 of location 60 and if set then branch forward 20 locations and continue program execution there". Programming Once the designer has decided on the type of application, the software can be written. Because most people have a PC, a fast and accurate way to produce the necessary code is to use a cross assembler. Basically, this is a language translator which runs on a computer and converts normal ASCII code into a language that the 68705 will understand. The next step is to download this information (hex code) into a 2716 EPROM. Once this has been done , the data is then transferred byte by byte into the EPROM aboard the microcontroller using a 68705 programmer board. SC SEPTEMBER 1992 39