System Resources

In a typical system there are various parts, the choice of which depends on what the design goal of the system is. There must be a serial interface to allow the downloading of the program into the DS5000. There also must be an oscillator to supply the DS5000 with a clock source. To permit trouble shooting problems, we need a way to break out of any program that is currently executing, and examine various locations in the DS5000 to help in the debugging process. To view the states of various pins on the DS5000 we also need a logic probe. These are the parts that we will have on the basic processor board of our system. There will also be a power supply to provide +5 volts for the system, and a connector to take all the pins of the DS5000 off of the basic board so that they can be connected to a proto board to allow us to connect up what ever we want to the DS5000. Also there will be a connector that can be connected to an X10 interface to allow us to use any of the inexpensive X10 modules that can be found at various suppliers like Radio Shack.

If I wasn't clear about this before, the idea I am working from is to have the basic processor board and a proto area connected to it to allow connecting any parts we want to the DS5000. A proto board is just a matrix of holes, with connectors, on .1" centers that a chip, or a part, can be plugged into and wire jumpers used to interconnect that chip to the appropriate DS5000 pins. These proto boards come in a variety of sizes and shapes. They are available at Radio Shack and other consumer stores that handle electronic parts. They work very well for temporary construction, or proto typing, of circuits, hence the name, proto boards. This will allow us to add things as we go along in this course and eventually have a prototype system that will be able to do lots of things. It, however, won't be a finished product, but merely a prototype. It won't be in a case, and the proto board doesn't allow for much in the way of mechanical vibration stability. But it will serve as a training platform and to allow you to design your own projects in the future.

In addition to the basic processor board and the proto boards, we will be using an A/D converter and a 4 line by 20 character liquid crystal display (LCD). We will also have a 4 by 4 keyboard. This will be the extent of our training system.

I'm sure, at least for some of you, that all this jargon is fairly meaningless. But I will now start explaining it in further detail.

First, all microprocessors need a system clock to drive them. This is not a clock like the one beside your bed but, instead, an oscillator that produces a very stable frequency of pulses. These pulses are applied the the micro on the clock-input pin. What happens with it inside the micro is not important other than to say that without a clock, the micro won't work at all. We will be using an oscillator that is in it's own chip package, that doesn't require any support parts to operate. Just apply power to it and connect it to the DS5000 and we're done with the clock.

Next we need an interface that allows us to download a program to the DS5000. This is implemented with a chip from Maxim called the MAX232 chip. It has 2 transmitters and 2 receivers inside it. To digress just a moment, we've talked about 1's and 0's in our earlier lessons. Then they were just numbers. But when looking at the pins of the DS5000, they are really voltage levels. Ideally a 0 is 0 volts and a 1 is +5 volts. But in real life a zero is close to 0 volts and a 1 is close to +5 volts. In the DS5000 specs, a 0 is any voltage less than about .8 volts and typically about .1 volts or less and a 1 is any voltage greater than about 2 volts and typically about 4.8 volts. These are called logic levels. Levels between .8 volts and 2 volts are indeterminate and usually indicate a bad chip or an open connection.

But a serial port uses a different set of levels to transmit and receive with. They conform to the levels set out in the specs for RS-232C where a 0 is close to -5 volts and a 1 is close to +5 volts. To connect the serial port from a PC to the DS5000 we must convert these levels from one spec to the other. This is the job of the MAX232 chip. It can take the RS-232 levels in from the PC, through one of it's receivers, and convert them to logic levels to the DS5000. It can also take logic levels out of the DS5000, through one of it's transmitters, and convert them to RS-232 levels to the PC. In our system, a serial connection requires 3 wires, a transmit, a receive, and a ground or common. The transmit out of the DS5000's serial port goes through a transmitter of the MAX232 chip through a connecting cable and into the receive of the PC's serial port. The transmit out of the PC's serial port goes through a connecting cable through a receiver in the MAX232 chip and into the receive of the DS5000's serial port. The ground or common on the PC's serial port is connected to the ground of the DS5000. This completes the serial port connections. There are 4 external capacitors connected to the MAX232 chip that allow it to function properly but my idea here is not to go into the field of electronics and capacitors. Just know that they are needed for proper operation of the MAX232 chip.

The next chip in our arsenal is a hex inverter chip. It gets the name hex from the fact that there are 6 gates inside. Each one is an inverter. An inverter inverts what ever level is at the input pin and puts that out on it's output pin. In other words, if a 1 is on the input, a 0 will be on the output. Conversly if a 0 is on the input, a 1 will be on the output. How this chip is used would be difficult for me to explain to you in terms that you would understand. So just accept for now that we need it to complete the system.

The last chip, besides the DS5000, is the power supply regulator. It takes a voltage of about 9 Volts DC and outputs a very stable +5 volts DC for the system power. The +5 volts is normally referred to as Vcc, a term from the transistor days, but still used today.

I must take care not to get too deep into electronics here, because that is a another course in itself. So some of what I tell you, you'll just have to accept on blind faith. Maybe you will decide to get further into electronics on your own. That's how I started out. Computers came later for me. You, on the other hand, are getting the cart before the horse. I will impart on you some aspects of electronics as they come up, but I will try, for your sakes, to keep it to a bare minimum. After all, this course is for people who have very little knowlege of computers or electronics. To keep your interest level up on the micro side, I must avoid getting too deep on the electronics side. This will make it impossible to explain everything I would like to. But, like I've said earlier, chips are like Tinker Toys, you just connect them together and go. In most case, not a lot of electronics knowlege is needed, just the knowlege of how to connect them together ... logic.

There is another device commonly used in micros called an A/D converter. A micro only understands 1's and 0's and to allow a micro to look at a varying voltage level, an analog to digital converter must be used. It does just what the name implies, it converts a varying voltage (analog) level into a corresponding digital number. The one we will use is a National Semiconductor ADC0808. It has 8 analog inputs and gives an 8 bit value out as a result of the conversion. It accepts a voltage in the range of 0 volts to +5 volts. If the voltage is 0 the digital value will be 00h. If the voltage is +5, the digital value will be FFh. This means that there can be 256 levels, including 0, that can be measured by the micro. Doing a little math, this means that each one bit change in the digital value is equal to a .02 volt or 20 millivolt change in the analog voltage. So as an example, if there is a .02 volt level into the A./D, there will be a count of 01h as a result. If there is a 2 volt input, there would be a count of 64h (100).

An example of an analog input is a temperature sensor. A temperature sensor outputs a voltage that is directly proportional to the ambient temperature. The one we will use is made by National Semiconductor called an LM34. It gives a .01 volt per degree farenheit output. For instance, if the temperature is 100 degrees, the ouput will be 1 volt (100 times .01). Another example could be a potentiometer or variable resistor. The volume control on your radio is a potentiometer. Another example might be to measure the voltage of a battery. Another is to measure light intensity to determin when it's night or day. A microphone in each room to determin if the room is occupied, to turn lights on automatically when you enter a room.

Another device we will talk about is a liquid crystal display. The one we will use has 4 lines of 20 characters each, for a total of 80 characters. It can display all the alphabet and numbers plus some special characters like @#$%. It takes an ascii number and displays it. This is why we wrote a binary to ascii routine in a previous lesson, to get ready to use this display. This display can be used to display the time or temperature or anything you want displayed.

The last thing I would like to mention is something called X10. It has been around for several years and is an assortment of modules that allow anyone to control lights and just about anything else plugged into 120 volt house power. There are also door sensors, keypads, infrared motion sensors and many other accessories. New ones are introduced occasionally and they are very cost effective and inexpensive to own. They communicate over the power lines in your house, without any other connection. Just plug in a control module, plug in the appliance to be controlled into the module and your done. There is a particular module that lets a computer communicate with the other modules in your house. You plug this module into an outlet, plug the computer into it, and your ready to control lights, monitor doors, motion sensors, even your telephone!. Part of our design project will be to make an interface that will allow us to connect our micro to the X10 computer interface. The rest will be up to you and the modules you want to control. An example of the costs: a module to control a light is $15. The computer interface is $60. A door sensor is $20.

The rest of the parts in our system will be odds and ends. A few resistors, capacitors, transistors, switches, cable and connectors.

With all these components, we will be able to build lots of useful functions into our system. Here is a list of possible uses we can put our system to performing.

1. A full-featured set-back thermostat to control your home airconditioning, to save you money in power costs!

2. A home security system.

3. With the X10 capabilities, control of all of your appliances and lights.

4. A clock/calendar that can be used by all the other functions to add time/date to the control functions. For instance the setback thermostat can adjust the temperature in your house after you leave for work, but not do it on weekends. Or turn on security lights at night and turn them off in the morning. Turn your children's TV off at bed time. Set your coffee pot up the night before and have hot coffee ready for you when you wake up.

You'll probably think of other uses that are combinations of these or new ones that I haven't thought of yet. The possibilities are limited by your imagination, and your pocket book, of course. Other chips can be added that allow the system to TALK to you.

All these applications can be purchased off of the shelf at stores, but the cost is more and you don't get the satisfaction of building and customizing them to suit your needs. I hope this prospect interests you. If it dosen't, this is probably as far as you need to go in this course. The rest of it is devoted to reaching this conclusion. Unless you intend to buy the hardware described in the next lesson, the rest of this course will be hard to keep up with. It will assume that you have bought the needed hardware and are following along.

The next lesson isn't really a lesson, but instead, the parts list, schematic, and all the sources of the parts and their prices. We are just about ready to start building the hardware, something I've been anticipating from the beginning. I am going to build all this for myself, along with you. It may be a few weeks before I have lesson 11 done. I have to buy all the parts myself and get the training system working first before I can furnish you with an accurate parts list and sources for the parts.

For those of you who are going to end the course here, I hope I've given you food for thought and an insight into the world of microprocessors and computers in general. I am planning to offer a free course in basic electronics after I finish this one, so check back at my home page in a few months and see if it has began. Good luck to you and God bless.

My home page is .

On to lesson 11.