Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

What is multiplexing?

Status
Not open for further replies.
Ok, i got the software for that camera. Here are some PICS. Oh, sorry they are so low in resolution. Once i get the thing finished, i will borrow a nice digital camera from a friend, and then take some High-Res pictures. What do you think?

**broken link removed**

**broken link removed**

**broken link removed**
 
What do you think?
Looks like you have plenty of room on that breadboard to prototype your entire Z80 project. Make sure you put plenty of 0.1uF bypass caps on the power rails. Sprinkle some around a bit. ;)
In the last picture, what is the chip covered by the Q in MemRQ doing?
 
Sorry i haven't posted for a few days, my router went down, and it took the whole network with it. Anywho, that chip is a 4049 Hex Inverter. I was getting ready to build my switchboard circuit. I do have a bunch of 104 CAPs on the chips, and i have a 1uF on the z80. I got my order sent out to Jameco, here is all the stuff i got;

1. 16K EEPROM
2. 16K SRAM
3. 100 LEDs
3. 200 1/2 watt, and 1/4 watt resistors
4. 100 POTS
5. 100 feet of 22awg hookup wire (for use as jumper wires)
6. 200 ceramic-disk CAPs

I think that should be enough for now. Electrolytic are easy to desolder, and normally have long enough leads to connect to the breadboard. :)

I did get that switch circuit done last night. I started putting commands in, and then manually clocking it, and i ran into a problem. How do you get numbers into the commands? What i mean, is, if need to add reg(A), and reg(B), then how do i load number into A and B, if the commands are static?

I am going to assume that the command "ADD A, n" means "add reg(a) and {this number}", correct? If i am right, then how do if define the variable "n"? Since the opcode for "ADD A, n" is 11000110, let's say i want to add "A" with "5". How would i tell the cpu that n=11000110?

Also, i noticed something else that really disturbs me. A7-A15 blink? Why is that? If you would like, i could try to take some video with that camera?

Looks like you have plenty of room on that breadboard to prototype your entire Z80 project.
I am hoping so! :)
 
I am going to assume that the command "ADD A, n" means "add reg(a) and {this number}", correct?
Correct.
If i am right, then how do if define the variable "n"? Since the opcode for "ADD A, n" is 11000110, let's say i want to add "A" with "5". How would i tell the cpu that n=11000110?
In this example, you put the number "5" after the opcode for "ADD A, n". The CPU knows that the byte following the opcode for "ADD A, n" contains the value of n and not another opcode.
So in EEPROM, it would code like this:
Code:
Address:    Data:          Comment:
 0x0000     11000110     ADD A, (Opcode)
 0x0001     00000101     n=5     (value)
 0x0002     ????????     next opcode.

Also, i noticed something else that really disturbs me. A7-A15 blink? Why is that?
That's normal. They blink in sympathy for the lower address line when those do the 7bit DRAM refresh addressing. :)
 
Last edited:
Oh, ok, i figured that the variable would be stored in memory. Cool. Before i find out the hard way, i have yet another question. If the CPU needs to send data OUT of the data port, will IORQ go active? Also, what does the Halt pin do? Does it go active when the command "Halt" is executed?
 
i figured that the variable would be stored in memory. Cool. Before i find out the hard way, i have yet another question. If the CPU needs to send data OUT of the data port, will IORQ go active?
Yes, any of the OUT or IN opcodes will cause the IORQ line to go active low.
Also, what does the Halt pin do? Does it go active when the command "Halt" is executed?
Yes, that's all it does. You can use the HALT instruction to wait for an interrupt to occur.
BTW, you've rekindled my interest in my old Z80 development board and I'm playing around with some 74LS374's from the junk box to make a SRAM/EEPROM programmer for the parallel port. Have you found a compiler yet?
 
No, actually i am making one. That is great that you are playing around. Sounds like fun! I got a little more techie on the thing. I don't know if you read my post on the LCD i found, but i am thinking of using it as a monitor for it. I also got a better set of LEDs for the address bus. I got 2 LED bar graph readouts. It looks cooler now. I will take some more pics when i get something rigged up for the data bus. Is there some type of chip that allows me to add tri-state to something? I think it would be called a Tri-State Buffer?

Ok, so if IORQ goes active, then MemRQ should go inactive, and then memory should be Z(High Impedance)?
 
I don't know if you read my post on the LCD i found, but i am thinking of using it as a monitor for it
Must have missed that post. If it has it's own display and keypad it'll be truly stand alone.
Is there some type of chip that allows me to add tri-state to something? I think it would be called a Tri-State Buffer?
You can use a 74xx245 which is a bidirectional tri-state buffer. It has a nicer pinout than the unidirectional 74xx244.
A logic IC reference:
**broken link removed**
Ok, so if IORQ goes active, then MemRQ should go inactive, and then memory should be Z(High Impedance)?
That is correct. I can scan a timing diagram for you if that helps.
 
You can use a 74xx245 which is a bidirectional tri-state buffer. It has a nicer pinout than the unidirectional 74xx244.
A logic IC reference

Yes, i do have a lot of those laying around. I will use a few of them.

That is correct. I can scan a timing diagram for you if that helps.

That would be great! :cool: But if you do that, then you will have to teach me how to read it. :) Every time i look at timing diagrams, i get very confused. :p


I just tried to make a digital clock selector. Lets just say it was a major failure. :( This project is really teaching me electronics, the art of computation, and assembly all in one. You know how some people are drug addicts, and alcoholics? Well, i have a sick addiction for knowledge. I try to learn as much as i possibly can, all at once. So far i have been managing, but i just hit another wall. :(
As many people on this site have predicted, i am trying to run a marathon before i could even crawl. I have learned to crawl, and i have just about mastered walking. When i say "i just hit another wall", i mean, i don't know ANY basic logic. Yes, i know, it is shameful, but i have a plan! :cool: I have a book on digital electronics, that explains digital logic. I am hoping i can get all of that knowledge crammed into my head before school starts(in about a week or so). I am sure i can do it, but that means i just have more things going on.

So, anyways, what i am saying, is I WILL NOT GIVE UP! :) If i can learn logic this week, then i will be back on track! ;) Thanks again for all of your help! :)
 
When i say "i just hit another wall", i mean, i don't know ANY basic logic. Yes, i know, it is shameful, but i have a plan! I have a book on digital electronics, that explains digital logic.
The truth table shal set you free! :D Just concentrate on the basic gates such as AND NAND OR NOR XOR etc first. Then figuring out things like flip-flops and multiplexers becomes possible.
That would be great! But if you do that, then you will have to teach me how to read it. Every time i look at timing diagrams, i get very confused. :p
I think you've studied the Z80 enough now that they should make sense. ;)
Here are the OpCode fetch, Mem read/write and IO read/write. There are a few more about interupts etc, but we'll leave that for later:
 

Attachments

  • Z80-Fetch.jpg
    Z80-Fetch.jpg
    178.3 KB · Views: 179
  • Z80-Mem.jpg
    Z80-Mem.jpg
    143.1 KB · Views: 193
  • Z80-IO.jpg
    Z80-IO.jpg
    129 KB · Views: 198
None of that made any scence to me. :( I will do some more research on timeings. I added some more circuitry to it. I will take more pics soon. Probably later today? I don't know. It depends on what i get accomplished. :) Thanks for scanning thoes images for me. :) I will keep looking at them until something makes a bit of sence. I have a question that bugs me, though. How can things be 0 and 1 at the same time? And then why does it make an "X" in some of the timmings?
 
None of that made any scence to me.
Think of it as looking at a multichannel scope hooked up the Z80 pins.
I have a question that bugs me, though. How can things be 0 and 1 at the same time? And then why does it make an "X" in some of the timmings?
When they do that it is because those represent all 16 address lines and the 8 data buss lines. So d2, d4 & d7 could be high on the data buss and the rest low. So they draw it as a don't care or it could be anything scenario. So they draw the high AND the low at the same time and the X at the end. The X just represents the start of another state such as valid data when you transition from say invalid data.
You can ignore the WAIT input line because you won't be using it because modern chips are all quick enough to keep up with the Z80.
 
Last edited:
Here are some more pics.

**broken link removed**

Wide shot of the project. Shows part of the switch board, and the clock selector board.

**broken link removed**

The switch board. It is used for manually entering commands. It works too! It needs to be redone though. If IORQ goes high, i am forced to reset, or my hex inverter may not last too long! :)

**broken link removed**

Here is the clock selector board. The switch on the left(the one with the knob), is used for selecting clocks. The one on the right, is the clock stop. The 2P6T switch controls a multiplexer, that has all the clocks going into it. The inverted output of the MUX is then ran into a 2N2222 transistor, that has few pull-up resistors on it. The transistor allows me to stop the clock.

**broken link removed**

This is the MUX. If you look hard enough, you can see the transistor at the bottom right of the MUX. It is kinda under the arrow. :)




The thing that makes me so proud, is that the digital selector circuit was ALL of my design. I didn't get schematics from anyone, nor did i ask for help. I just found the datasheet on the MUX, and connected it all, AND IT WORKED! :) :cool:
I don't mean to brag, but i am happy! :) :) :) :) :) :)
 
This is the MUX. If you look hard enough, you can see the transistor at the bottom right of the MUX. It is kinda under the arrow
Is it that blurry thing next to the other blurry thing? :D

The thing that makes me so proud, is that the digital selector circuit was ALL of my design. I didn't get schematics from anyone, nor did i ask for help. I just found the datasheet on the MUX, and connected it all, AND IT WORKED!
There is nothing better than designing something yourself. Way more fun and you can use the parts you have on hand which leads to some pretty strange and creative things.
Are you still trying to make your own assembler/compiler. Here is a command line operated one that works:
http://www.z80.info/zip/tasm301.zip
I have managed to build a programmer for loading code into a Z80 system in circuit via the parallel port. I'll post a schematic if you're interested. The software needs alot of work but at least it loads the binary data into RAM now. I don't have an EEprom to try it with, but I'm sure all that'll need doing is lengthening the time between data writes.
 
Is it that blurry thing next to the other blurry thing?

Hehe, yes it is. The crappy little camera can't focus on things that close. Soon i will just break down, and buy a better one on ebay. :)

There is nothing better than designing something yourself. Way more fun and you can use the parts you have on hand which leads to some pretty strange and creative things.
Are you still trying to make your own assembler/compiler. Here is a command line operated one that works:
http://www.z80.info/zip/tasm301.zip
I have managed to build a programmer for loading code into a Z80 system in circuit via the parallel port. I'll post a schematic if you're interested. The software needs alot of work but at least it loads the binary data into RAM now. I don't have an EEprom to try it with, but I'm sure all that'll need doing is lengthening the time between data writes.

Thanks for the link. I already have TASM. Yes, i would love to see your programmer. Is it just hardware? Or did you create software, too? Heck, i will take both! Thanks! :cool:
 
Oh, i almost forgot, is HL a register? On those OPCODES i got, HL is used often. (You know the ZIP file that had an XLS file in it...) :)
 
Yes, i would love to see your programmer. Is it just hardware? Or did you create software, too? Heck, i will take both! Thanks!
I'm having a little problem saving the schematic as a GIF right now. After all that drawing and now it won't save as an image.:mad: :( :mad: :(
I'll post both the software and the schematic once I get that figured out. One doesn't make sense without the other.
Oh, i almost forgot, is HL a register? On those OPCODES i got, HL is used often. (You know the ZIP file that had an XLS file in it...)
HL is a 16bit special register that is made from two 8bit ones (H & L). It's is commonly used to index memory or as a 16bit counter. IX and IY are also 16bit registers but they cannot be split into 2 8bit one like HL can.
 
I'm having a little problem saving the schematic as a GIF right now. After all that drawing and now it won't save as an image.
I'll post both the software and the schematic once I get that figured out. One doesn't make sense without the other.

Well, if you don't want to go through all of that work, then you can just push [CNTRL]+[PRT SCR], then [ALT]+[PRT SCR], and that will take a screen shot of any window you have up. Then just paste it into an image editor.

I guess it would be nice to have some actual schematics software though. :)

HL is a 16bit special register that is made from two 8bit ones (H & L). It's is commonly used to index memory or as a 16bit counter. IX and IY are also 16bit registers but they cannot be split into 2 8bit one like HL can.

Ok, so if i needed to load a 16bit number from an 8bit bus, then i would send 8high, and then send 8low, correct?
 
Well, if you don't want to go through all of that work, then you can just push [CNTRL]+[PRT SCR], then [ALT]+[PRT SCR], and that will take a screen shot of any window you have up. Then just paste it into an image editor.
I tried that. The problem, with Express Schematic, is when the whole schematic was on screen then there are no details for you even to guess what it is. I could have zoomed, scrolled around and done 4 print screen's and pasted it together but what a pain. I managed to fool it by changing the paper size but then it put the boarder in the middle of the diagram which I had to photo shop out. Grrr!

Ok, here's the schematic, code and Z80 program (eeprom.txt is the list file from TASM) . The code is in C (eeprom.c) and is compiled as a win32 console application using the free lcc-win32 compiler. In the file eeprom.c, the HEX codes assigned to unsigned char Data[] are the binary codes that get loaded into the RAM on the Z80 board. None of this is finished yet or fully checked for accuracy so don't started building anything yet. ;)
 

Attachments

  • eeprom-s.gif
    eeprom-s.gif
    22.2 KB · Views: 171
  • eeprom.c
    2.7 KB · Views: 209
  • eeprom.txt
    1.7 KB · Views: 154
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top