System Construction Part 2


The last lesson got you used to connecting parts on the protoboard and reading the schematic. Now we will finish connecting the basic system. By the way, Digikey has the very same digital voltmeter that I use for $35. The part # is BK2700-ND . This is the same voltmeter I use at work most of the time, and is good for most applications.

Take four of the 22UF Caps and place the first between U3 pin 2 and GND, with the + lead on pin 2. Next place one between U3 pin 6 and GND, with the + lead on GND. Next place one between U3 pin 1 and U3 pin 3, with the + lead on pin 1. The last placed between U3 pin 4 and U3 pin 5, with the + lead on pin 4. Now connect the red wire from the RS-232 cable to U3 pin 14, the green wire to U3 pin 13, and the black wire to GND. With your safety glasses on, turn on power and measure between U3 pin 2 and GND. You should read between 8.5 and 10 VDC. Now measure between U3 pin 6 and GND. You should read between -8.5 and -10 VDC. Notice the opposite polarity of the second reading. You should always connect the black lead of the voltmeter to GND and use the red lead for the measurement. U3 pin 2 should be positive and U3 pin 6 should be negative. These are the two power supplies generated by the MAX 232 chip used to make the RS-232 interface levels.

Turn off power and install the DS5000 chip, placing it at the extreme right end of the protoboard. This should place pin 20 of the DS5000 on the last tie strip on the lower right section of the protoboard (referring to the picture of the protoboard in the previous lesson). There should be 2 rows showing on the lower half and 3 rows showing on the upper half of the protoboard. The DS5000 is .6" wide and covers up some of the connection points. We want to have 2 holes in each tie strip exposed for pins 1 through 20 of the DS5000 and 3 holes in each tie strip for pins 21 through 40. To say this another way, after the DS5000 is plugged into the protoboard, there should be 2 holes left in each tie strip on the lower half (pins 1 thru 20) and 3 holes left in the upper half (pins 21 thru 40). As always, the indent or dot on pin 1 should be pointing to the left as you plug in the DS5000.

Connect U6 pin 40 to VCC and U4 pin 20 to GND. These are the power connections for the DS5000. Now place a 10K resistor (brown-black-orange) between U6 pin 31 and VCC. Place a jumper between U5 pin 5 and U6 pin 19. This is the clock for the DS5000. Place a jumper between U3 pin 11 and U6 pin 11. This is the RS-232 transmit from the DS5000. Place a jumper between U3 pin 12 and U6 pin 10. This is the RS-232 receive to the DS5000. Place a jumper between U4 pin 2 and U6 pin 9. This is the RESET to the DS5000. Place a jumper between U4 pin 4 and U6 pin 29. This is part of the LOAD control for the DS5000. Place a jumper between U4 pin 6 and U6 pin 13. This is the BREAK to the DS5000.

Now double check all the connections that you have just made. In particular the power connections to the DS5000 and the connections between U3 and U6. It is CRITICAL that these are right or you may damage the DS5000 chip. The rest of the connections, if they are wrong, will only cause the system not to work correctly. This should be enough of a system to be able to talk to with the PC. Make sure the BREAK / NORMAL switch is in the NORMAL position. The LOAD / RUN switch should be in the LOAD position.

Now connect the RS-232 connector to your PC and start up your PC. You may have to unplug your mouse to connect the RS-232 connector. This is the most common configuration. If your PC was already on, with the mouse connected to COM 1, you need unload the mouse driver, if one is loaded, to eliminate any conflicts created by the mouse driver. To do this, reboot the PC with the RS-232 connector connected. The mouse driver will attempt to load, but will fail, because you don't have it connected to the PC. The mouse won't be needed in any of the work with the DS5000 that we do for the rest of the course. In the previous lesson I went into detail about the mouse and Windows. Refer to that description to make sure that you're ready for the DS5000. You should be at the DOS prompt, in the directory that you've downloaded all the files I've given you into. All these files should have been unzipped before now.

We are getting close to the real good stuff, so pay close attention. One of the utilities I have written and provided to you is one called KUCONFIG.EXE . Start this one and follow the prompts. The typical values will be COM 1, 9600 BAUD, and DUMPI set to 4000h. If you are using COM 2, then pick that instead of COM 1, but the rest should be the same. Finish by reviewing the selections you made and answer Y to confirm and save them. This will create a file called KENUTILS.CFG . This is the configuration for the other utilities you will be using. You shouldn't have to run the configuration again, unless you change COM ports later, which you probably won't.

Now start TALK.EXE. This is the terminal emulator program that will allow you to communicate with the DS5000 interactively. You can use any terminal program you wish, but this one will work for our needs. At this point we are about to embark on the rest of this course in earnest. This is the culmination of all the previous lessons, and the one I've been anticipating with eagerness on one part and bit of reservation on the other. If what follows doesn't work for you, this will be the most difficult to trouble shoot. If this does work, fantastic!

Making sure of all your connections on the protoboard, and of course wearing your safety glasses, apply power to the system. If every thing is connected correctly, you should press the ENTER key on the PC keyboard and a message similar to:

DS5000 LOADER VERSION 2.3  COPYRIGHT (C) 1988,1990 DALLAS SEMICONDUCTOR

should appear on the PC screen. If it did, congratulations, you've made it!!! You are now communicating with the DS5000 chip on your own personal rats nest! If it didn't, about all I can suggest to you is to double check all the connections starting with lesson 12 through now. Some of the things that would make this not work is the mouse driver still loaded on your PC, the RS-232 connector not wired correctly, the COM port you used not working, or the protoboard not wired correctly. Look at the schematic as you re-check everything, it shows all the connections.

Now we will play with the DS5000 Loader. In the Dallas Soft Microcontroller data book is a listing of all the commands that you can use through the loader, starting on about page 137. The first command we will do is the configuration command (W). Type W88 and ENTER. Now type R and enter. The 88 should be displayed again. You have just configured the DS5000 for 16K of program memory and 16K of Data memory. This is the configuration we will use throughout this course. You shouldn't have to use this command again, although I have had to reconfigure the DS5000 on a couple of occasions, though I don't know why.

Next type G and enter. There will now be displayed 4, two digit hex values representing the four I/O ports on the DS5000. Now connect the logic probe to U6 pin 1, which is port 1 bit 0. I normally don't suggest you make any connections with power applied, with the exception of the logic probe. I would caution you about static discharge. You should not be wearing rubber sole shoes. These shoes, coupled with certain carpet types, can generate very high static potentials that can destroy chips! The LED should be lit now. Type P 1 00 and enter. This should place all of the lines of port 1 to all 0's. The LED should go out. Now type P 1 FF and enter. This should set all the lines of port 1 to all 1's. The LED should be lit. Kinda' fun, ain't it? You are now communicating with the DS5000 and setting and clearing port lines, watching them with your logic probe.

Next type D 4000 40FF and enter. You should now see several lines of hex characters, representing the data currently in memory starting at location 4000, for 256 locations. This format is a little difficult to decipher. It is called Intel Hex File Format. This is the very same format that the assembler generates, that we will download to the DS5000 as we write programs and test them. It is described on page 141.

Next type F 00 4000 40FF and enter. This filled location 4000 thru 40FF with all 0's. Now type D 4000 40FF and enter. Now all the data displayed should be 0's. Now type F FF 4000 40FF and enter. Now type D 4000 40FF and enter. All the data should be 1's now. You have just altered the data memory inside the DS5000. Cool, huh? If you try filling (F) or dumping (D) memory at any address before 4000h, you will get unpredictable results. This is because the loader has some security features built in that won't allow you to look at a program in the DS5000. You can only manipulate the data memory section. This prevents you from accidentally overwriting any program previously loaded into the DS5000 and keeps prying eyes out of your program. Since we divided up memory at location 4000h (when we did the W88 command), all the memory from 0000h thru 3FFFh is program memory. All the memory from 4000h thru 7FFFh is data memory. There is no memory above 7FFFh, so any reference to locations 8000h thru FFFFh will produce unpredictable results.

As an exercise in getting used to playing with the DS5000, I would try moving the logic probe around, writing different values to the ports, and watching them with the logic probe. There is one thing, though, only port 1 will work this way. In the LOAD condition, the other port line outputs are in the high impedence state. Only port 1 can be manipulated with the loader and the outputs affected by the P command. You can however, use a jumper to GND to input to the other port lines and see it with the G command. I would only play with the D,F,G,and P commands. I wouldn't use the W command again, but if you do, make sure you finish by setting it back to 88. You can use the R command to read this value at any time, since it only reads the value, and doesn't alter it. There is an explanation of the MCON register (the one you are altering with the W command) starting on page 13. These 6 commands are about all that you can play with that do anything useful to the DS5000. There is a Load command that downloads an Intel Hex File to the DS5000, but we will use that in the next lesson. There is also the CTRL C command that will restart the loader and display the opening message.

Play around and enjoy. Some of you may have thought that you would never get to this point, but I hope you did.

My home page is http://www.hkrmicrop.com/personal/index.html .

On to lesson 14.