An 80C31-Controlled Power Supply

Similar documents
Lecture 1. Course Overview and The 8051 Architecture

8051 Microcontroller

POWER SAVER METER USING MICROCONTROLLER TO SAVE ELECTRICITY UPTO 30-40%

SECURE DIGITAL ACCESS SYSTEM USING IBUTTON

Embedded World Television, Radio, CD player, Washing Machine Microwave Oven Card readers, Palm devices

Lab #2: Building the System

UNIT 3 THE 8051-REAL WORLD INTERFACING

Embedded Systems and Software

The Microcontroller Idea Book

DEV-1 HamStack Development Board

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

EB-51 Low-Cost Emulator

Three criteria in Choosing a Microcontroller

ET2640. Unit 5:ADVANCED I/O TECHNIQUES Pearson Education, Inc. Pearson Prentice Hall Upper Saddle River, NJ 07458

1/Build a Mintronics: MintDuino

EMBEDDED SYSTEMS COURSE CURRICULUM

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

8051 Microcontroller

Keywords Digital IC tester, Microcontroller AT89S52

CEIBO FE-5111 Development System

Professional Radio GM Series. Controlhead Service Information

Bolt 18F2550 System Hardware Manual

2. (2 pts) If an external clock is used, which pin of the 8051 should it be connected to?

Microcontrollers. Principles and Applications. Ajit Pal +5 V 2K 8. 8 bit dip switch. P2 8 Reset switch Microcontroller AT89S52 100E +5 V. 2.

CHAPTER 5. Voltage Regulator

TEMIC 51T (Temic) EMULATION

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

How to Implement I 2 C Serial Communication Using Intel MCS-51 Microcontrollers

8051 microcontrollers

12v Power Controller Project Board

DTMF BASED HOME AUTOMATION

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system.

Owner s Hardware Service Manual Frank Control Computer System


RTC Interface 89C51 DS M. Krishna Kumar MAM/M7/LU17/V1/ Vcc VCC 5 SDA P1.0 6 SCL P KHz 3 BAT 3.

DSP240-LPI Inverter Controller Card. Technical Brief

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families

80C51FA/83C51FA EVENT-CONTROL CHMOS SINGLE-CHIP 8-BIT MICROCONTROLLER Automotive

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

History and Basic Processor Architecture

DOCUMENT REVISION HISTORY 1:

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52

8051 INTERFACING TO EXTERNAL MEMORY

Unit I. Introduction Microcontrollers and Embedded processors Overview of the 8051 Inside the 8051 Addressing Modes

ElectronFlux USB Module

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

ST Sitronix ST7565R. 65 x 132 Dot Matrix LCD Controller/Driver. Ver 1.7 1/ /06/01

Question Bank Microprocessor and Microcontroller

Architecture of Computers and Parallel Systems Part 6: Microcomputers

Thursday, September 15, electronic components

Microcontroller and Embedded Systems:

3 PHASE FAULT ANALYSIS WITH AUTO RESET FOR TEMPORARY FAULT AND TRIP FOR PREMANENT

SN8200 LI+ DUAL BATTERY CONTROLLER

INTRODUCTION. Mechanical Considerations APPLICATION NOTE Z86E21 THERMAL PRINTER CONTROLLER ZILOG

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

Embedded Applications. COMP595EA Lecture03 Hardware Architecture

PART. Maxim Integrated Products 1

SYLLABUS OF ADVANCED CARD LEVEL & CHIP LEVEL TRAINING ( DESKTOP AND LAPTOP )

Engr. A. N. Aniedu Electronic and Computer Engineering Nnamdi Azikiwe University, Awka

8. SED1565 Series. (Rev. 1.2)

Sencer Yeralan and Helen Emery Gainesville, Florida January 2000

80C31BH, 80C51BH, 80C51BHP, 87C51 SPECIFICATION UPDATE

80C51GB, 83C51GB, 87C51GB SPECIFICATION UPDATE

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

SH69P55A EVB. Application Note for SH69P55A EVB SH69P55A EVB SH69V55A

Variable Power Supply Digital Control Circuit Diagram Using Lm317

TEXAS INSTRUMENTS ANALOG UNIVERSITY PROGRAM DESIGN CONTEST MIXED SIGNAL TEST INTERFACE CHRISTOPHER EDMONDS, DANIEL KEESE, RICHARD PRZYBYLA SCHOOL OF

END-TERM EXAMINATION

ELECTRONICS MANUFACTURE-The In-Circuit Test sequence

Chapter 1: Basics of Microprocessor [08 M]

Vladimir Tsarkov Electrical Engineering

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

ST Sitronix ST7565R. 65 x 132 Dot Matrix LCD Controller/Driver. Ver 1.3 1/ /11/25

HAND-HELD THERMOCOUPLE THERMOMETER SERVICE MANUAL. CATALOG NUMBERS , and , and PROPRIETARY

TS04. 4-Channel Self Calibration Capacitive Touch Sensor SPECIFICATION V2.0

MICROCONTROLLER BASED SMART FAN SYSTEM

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

Lecture (02) PIC16F84 (I)

Microprocessors/Microcontrollers

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

EVAL-ADT7516. SPI -/I 2 C -Compatible, Temperature Sensor, 4-Channel ADC and Quad Voltage Output DAC FEATURES APPLICATIONS

Fig 1. Block diagram of a microcomputer

AVR Intermediate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

Type Version Ordering Code Package PEB 2025-N V 1.5 Q67100-H6300 P-LCC-28-R (SMD) PEB 2025-P V 1.5 Q67100-H6241 P-DIP-22

PIC Microcontroller Introduction

OPERATIONAL UP TO. 300 c. Microcontrollers Memories Logic

NT7532 V X132 RAM-Map LCD Controller/Driver. Preliminary

With a digital input we can read two states, a high or low. A switch can be open or closed.

BASIC INTERFACING CONCEPTS

Memory Expansion. Lecture Embedded Systems

Home Security System with Remote Home Automation Control

DS1306. Serial Alarm Real Time Clock (RTC)

Doc: page 1 of 8

Two-wire. Jumper for 12V. J2 Enable Adjust D/A1. Super PLC Warning: Warranty Void if this label is damaged 62256LP-12 CMOS RAM 4.

Table of Contents. Table of Contents Microcomputers Microcontroller Technology using the 32-Bit ARM Cortex M3

How Nohau supports the Philips 8051MX Microcontroller

Transcription:

THE MAGAZINE FOR COMPUTER APPLICATIONS An 80C31-Controlled Power Supply Even if you re a novice, it s pretty easy to control the power supplied to the circuits you re working on. In this article, Noel introduces us to a 80C31-controlled power supply, which is a circuit that enables you to monitor and alter voltage and current levels. FEATURE ARTICLE Noel Rios e very engineer, technician, and hobbyist needs a stable power supply to power up the circuits they re working on. However, it would be nice if you could vary the potential to accommodate many circuits. It also would be pleasant if you could vary the current supplied to the circuit, which would limit the power delivered in case something is wrong. The circuit featured here is an 80C31-controlled power supply that has voltage and current limits that you can change to suit your needs (see Photo 1). Its voltage ranges from 0 to 22 V, and its current ranges from 0 to 2.5 A. In most power supplies, you turn a knob to adjust the voltage and current. The 80C31 CPS, however, has a keypad for entering the voltage and current, as well as Set Voltage and Set Current buttons so you can change the voltage and current immediately by moving through a few menus. Additionally, you can monitor the voltage and current delivered by the power supply with the 80C31 CPS s built-in voltmeter and ammeter. The voltage and current is displayed using an LCD. CIRCUIT DESCRIPTION The brain of the circuit is the popular 80C31 microcontroller, which is the version of the 80C51 without ROM. The 80C31 is a widely available (it s produced by several manufacturers) and high-quality microcontroller for embedded design considering its instruction set and price. The 80C31 has 128 bytes of RAM, two external interrupt pins, two timer/counters, and serial ports (see Figure 1). It has 32 I/O pins, but doesn t have ROM, so some of the ports (namely ports 0 and 2) are used for the address bus and data bus. A few of the pins of port 3 are also used to interface to other devices like ADCs and DACs. The pins serve as read and write signals for proper bus operation like the read cycle and write cycle. So, after interfacing the ROM, ADCs, and DACs, you re left with 14 I/O pins. Port 1 is used to interface and read the keypad. Some of the pins in port 3 are used for the Set Voltage and Set Current buttons, while others are used to control the relay and analog switches to read the voltage and current to be fed to the ADC. U2 74HC373 is a transparent (see Figure 2). It s used to obtain the address because the address bus and data bus are multiplexed on port 0 to conserve pins coming out of the IC. The address is obtained after the Photo 1 Take a look at the front panel of the 80C31- controlled power supply. www.circuitcellar.com CIRCUIT CELLAR Issue 144 July 2002 1

*PSEN ALE*PROG *EAV PP RST V CC V SS XTAL1 RAM address B Timing and Control PD Instruction Oscillator XTAL2 RAM ACC TMP2 PSW Port 1 Port 1 P1.0 P1.7 address enable, or ALE, is asserted. U3 is an 8 KB 8 UV EPROM (27C64) that stores the program that sets the voltage and current and reads the ADC. I chose the 27C64 EPROM because it s inexpensive, available, and the firmware will fit in it. You can actually use larger EPROMs like the 27C512, but they re a waste of space, money, and time because you ll have to wire the added address pins. The 4K 8 EPROM can also be used but it s hard to obtain. U4 ADC0820 is a successive approximation analog-to-digital converter that converts an analog input voltage to an 8-bit equivalent value. It s fast and provides the necessary handshaking pins to interface to the three-bus architecture without glue logic. U4 ADC0820 also converts the analog voltage to an 8-bit equivalent value. U7 CD4053 is a triple one-of-two switch. It is used to select between the voltage and current. Wondering why I said current? Using a high-side current detector, the current flowing through a sense resistor is converted into a suitable voltage to be read by the ADC. U5 and U6 AD7524 are digital-toanalog converters. They convert a digital value to an equivalent analog current. They re chosen because they provide the hardware needed to interface to the system bus. In addition, they re fast and behave like RAM memory. U9 LM358 and the adjustable resistors form a pair of current-to-voltage P0.0 PO.7 Port 0 Port 0 ALU TMP1 Port 2 SFRs timers P2.0 P2.7 Port 2 Stack pointer ROM/EPROM Port 3 Port 3 P3.0 P3.7 Program address Buffer PC increment Program counter DPTRs multiple Figure 1 The 80C31 has 128 bytes of RAM, two external interrupt pins, two timer/counters, and serial ports. converters. U8 74HC138 is an address decoder that s used to access the ADC, DAC, and LCD. The MOVX memory space is divided into 8 parts of 8 KB each. I used this scheme so that you 8 16 Figure 2 In the digital portion of the power supply, U2 74HC373 is a transparent used to obtain the address. 2 Issue 144 July 2002 CIRCUIT CELLAR www.circuitcellar.com

Photo 2 Here s a view from above the 80C31-controlled power supply. The digital part is constructed using point-to-point wiring. I used a ready-made PCB for the analog part. can also insert an 8-KB RAM just in case it s needed. Actually, the MOVX instruction generates the read and write signals whenever it s executed, so you can read and write to external devices connected to the bus. LCD1 is an LCD module based on the popular HD44780. It s interfaced to the three-bus system using four NAND gates. Because the LCD is slow, the busy flag is read after an operation to see if it is busy or not. Failing to poll the busy flag will result in erratic operation or no display at all. In order to interface the LCD properly, you ll often need two signals at one time to perform an operation. Namely, the decoded signal like a chip select signal and the read signal for a read operation. The two signals must be turned on at the same time for a proper read operation. The same principle applies to the write cycle. C9 and R4 form the RC time delay for proper reset. The specifications require several clock cycles during which the reset is high until the clock generator is stable. D2 serves to discharge the capacitor after the power is removed. C5 to C14 serve as an immediate source of voltage because the supply rail drops as a result of the internal switching of the transistors. The voltage drop is caused by the inductances in the wire or traces of the PCB. And as you know, the current cannot change immediately when there is an inductor present in the circuit. Rectifier diodes D2, D3, D5, and D7 1N5400 convert alternating current to pulsating DC (see Figure 3). C1 filters the pulsating DC to smooth DC. C7, C8, D17, and D18 are configured as a charge pump that serves as a source for the negative voltage needed by the high-side current detector. Zener diode D1, R1, R6, and Q1 provide a constant current source for the thermal sensor. Q8 serves as a thermal sensor and limits the base current to the series pass transistor after it reaches a certain temperature. The collector current increases as the junction temperature increases even if the base current is constant. This works in theory, but it has not been tested because I don t have a themocouple themometer. I did use, however, a 4 4 heavy-duty heatsink. D12, D13, C4, and C5 form a split supply power source that s used to power the logic circuit, ADC reference, and the negative supply for the DAC reference. U1 78L05 and U3 79L05 serve as pre-regulators for the voltage references. U2 7805 is the voltage regulator for the logic circuit. Note that the 1-A variety is used because this also powered the EPROM emulator used during development of the firmware, which consumed a great amount of electricity. C2, C3, and C6 are filter capacitors used to make the regulators more stable. R5, R27, and D4 LM336-2.5 form the ADC voltage reference. The variable resistor R27 trims the voltage to 2.55 V. R20 and D14 LM336-2.5 form the voltage reference needed by the DAC ICs. R26 is used to bias the Darlington transistor, which is a series pass element comprised of Q5 and Q6, which form the Darlington transistor. The series pass element Figure 3 When looking at the analog portion of the power supply, you notice that the rectifier diodes convert alternating current to pulsating DC. www.circuitcellar.com CIRCUIT CELLAR Issue 144 July 2002 3

acts as a variable resistor to change the output of the power supply. R10, R21, R22, R23, R24, and U7 MC4741 act as a high-side current detector. Essentially, it s a subtractor that gives a voltage in proportion to the ratio of the resistor and voltage difference. The current moving across R10 produces a voltage drop that s detected by the subtractor, and then it s amplified according to the ratio of the resistances. A 2.5-A current produces a 2.5-V potential. This potential is compared to the voltage generated by the DAC. The comparator U5 LM358 controls the series pass element in order to regulate the current output of the power supply. R11 and R15 are a sampling element of the output voltage. The two resistors form a voltage divider and scale the voltage by 10. Thus, a 23-V potential becomes 2.3 V. The comparator U5 LM358 compares this potential to the voltage generated by the DAC and in addition to controlling the series pass element, which regulates the output voltage of the power supply. D15 and D16 isolate the two opamps. D8, D9, D10, and D11 protect the analog switch and ADC when there is an error and the sampled voltage or current rises above 5 V or drops below zero. C10 and C11 serve as filter caps to smooth the sampled voltages. R14 and R18 limit the current from the sampling points. R28, R29, D19, and D20 act as a regulator to limit the voltage going to U7 MC4741. If the circuit is unloaded, the B+ potential can reach as high as 31 V. And if this reaches U7, it will suffer electrical overstress, or EOS. The firmware, which can be downloaded from the Circuit Cellar web site, is written in assembly language using a Metalink assembler. One thing to note is why the reference is 2.55 V. The reason is that the ADC and DAC values go from zero to 255. Therefore, if you use 2.55 V you won t need to compute the values needed to obtain a desirable voltage or the reading obtained by the ADC. With this scheme, you can simply read the ADC and move the decimal point. For example, a 100 reading from the ADC is equivalent to a 10-V potential. And with an 8-bit value, the resolution of the voltage is 100 mv and the resolution of the current is 10 ma. To program a 1-A current you can send 100 to the current DAC. To program 1 V, simply send 10 to the voltage DAC. CONSTRUCTION AND ASSEMBLY You can construct the digital part of the power supply by using point-topoint wiring. I built a PCB for the analog component, however, the one I made was not that great because its only purpose was to verify if the circuit works (see Photo 2). For the digital part, I used ordinary IC sockets and wrapping wire to connect the circuit. You should also use IC sockets so you can remove the IC if it s defective. Before inserting the ICs, be sure to look for the presence of 5 V at the V CC pins. Also, check if the ground pins are indeed grounded. It s a good idea to use different colored wires so you can trace the signals of different pins. If you re going to make a PCB for the analog part, try to be sure the sampling network is close to the output connector or pads. Make the traces wide for nets carrying power from pulsating AC to DC. To calibrate the power supply, burn the calibrate program into to the 27C64 EPROM and then power up the circuit. Adjust variable resistors R2 and R3 until you read 2.55 V on pins 1 and 7 of U9 LM358. Also, adjust variable resistor R27 until you get a reading of 2.55 V going to pin 12 of U4 ADC0820. Key in 5.0 for voltage and adjust variable resistor R11 of the analog portion until you get a 5-V reading. TROUBLESHOOTING The only way you ll know if the circuit is wired correctly is if you can see messages coming out of the LCD module. The program will work even if the ADC or DACs are absent from the circuit. However, this is not the case with the LCD module. The program will hang if the LCD module is not present with dps.bin or dps.hex loaded in the 27C64 EPROM. This is because the BUSY pin of the LCD module is polled to check if the LCD is busy or not. If the circuit doesn t work, then check for the presence of 5 V at the V CC pins. You should also look to see if the ground pins are connected to ground, and if the reset circuit works. Use a logic probe or an oscilloscope to verify this. Additionally, always make sure the crystal and pins X1 or X2 of the microcontroller are in good shape. If there s no output on the LCD, then reassess your wiring. You should also watch for the activity of enable E, RS, and R/W pins. Adjust variable resistor R1 for good contrast so you can see the characters. If Enable E is not pulsating, inspect the NAND gate (U10). Check if the *RD and *WR signals are pulsating at the pins of the NAND gate. Another good idea is to verify whether or not the LCD is being selected. To do this, probe pin 12 of the U8 address decoder U8. Key in 5.0 for voltage. If the reading is zero, look to see if the VRDG from the analog portion is connected to the digital portion, which can be confirmed by inspecting pin 12 of the U7 CD4053. You should read 0.5 on a multimeter. You should always make sure that you wired the U4 ADC0820 correctly. Look for the *RD signal, *WR signal, and chip select pulse at the pins of U4. Key in 0.05 for current and connect a 4.7-Ω, 5-W resistor across the output terminals. The reading for current should be 0.05 A on the LCD. If it isn t, check for a 0.05-V reading on a multimeter on pin 13 of the U7 CD4053. If that doesn t work, check if the IRDG signal from the analog part is connected to the digital part. The U7 MC4741 of the analog part should be wired correctly and the IC itself should be in good shape. If both voltage and current readings are the same, see if the SELECT signal at pin 11 of U7 CD4053 of the digital portion is pulsing. If during the calibration phase there is not 2.55 V at the U9 LM358, even if you adjust variable resistors R2 and R3, then inspect your DAC wiring. Scan for the presence of *WR pulse at the pins of the U5 and U6 AD7524. In addition, you should check to see if the chip select signals are pulsating at pin 12 of U5 and U6 of the 4 Issue 144 July 2002 CIRCUIT CELLAR www.circuitcellar.com

AD7524. If they aren t, take a peek at the 74HC138 address decoder U8. And don t forget to verify the condition of the LM358 U9. If you don t find 2.55 V at pin 12 of ADC0820 U4, then make sure the LM336-2.5 D4 is wired correctly. Finally, if you don t have 2.5 V at pin 15 of U5 and U6 of the AD7524, check the wiring of LM336-2.5 D14. If the programmed voltage and current are not correct, even if the voltage DAC and current DAC have correct outputs, take a look at the LM358 U5 of the analog part. USING THE POWER SUPPLY To achieve an output of 700 mv, key in.7. For an output of 5 V, use 5.0. It will detect the number of keystrokes needed by the position of the decimal point. Therefore, to output 10 ma you need to press 0.01 or.01; and to output 500 ma, use 0.50 or.50. To output 1 A you ll have to key in 1.00, and so on. Remember to press the Set Voltage button first in order to set the voltage, and then press the Set Current button to program the current. RESOURCES Intel Corp., Embedded Microcontrollers 1986 DataBook, Intel, Mt. Prospect, IL, 1995. Philips Semiconductor, Philips 80C51 Family Databook, Philips, Sunnyvale, CA, 1994. SOURCE 80C31 Microcontroller Intel Corp. (602) 554-8080 www.intel.com ADDITIONAL USES The 80C31-controlled power supply has many uses. You can power numerous circuits on your workbench or charge a 6-V gel cell for constant voltage charging and to limit the peak current. In addition, you ll find that you can use the 80C31 to charge your NiCd batteries by setting the voltage higher than the battery potential and the current to 50 ma. I Noel A. Rios is an electronics and communications engineer. He has worked with semiconductor and electronics companies like Microcircuits, IMI, Allegro, and ASTEC. His interests include computers, embedded control, power conversion, test and measurement, and GPIB control. You may reach him at nar@edsamail.com.ph. SOFTWARE To download the firmware, go to ftp.circuitcellar.com/pub/circuit_ Cellar/2002/144/. Circuit Cellar, the Magazine for Computer Applications. Reprinted by permission. For subscription information, call (860) 875-2199, subscribe@circuitcellar.com/ subscribe.htm. www.circuitcellar.com CIRCUIT CELLAR Issue 144 July 2002 5