Few questions about my plans

Building your first 6502-based project? We'll help you get started here.
pogof
Posts: 15
Joined: 13 Sep 2016

Few questions about my plans

Post by pogof »

Hi all! First I will introduce my self then little rant and then my questions :D !

I am pogof, 16 old electronic hobbyist from Czech Republic.

The rant is: I really hate to register on my @gmail.com email address. But when I tried @seznam.cz it refused to register me. Olso the FAQ said that I should contact admin but how or where? Or did I miss something?

But anyway I was studding about how I can build my own 8bit computer. I found few projects that I could reproduce for start but they are not "complete" in way that one of them does not contain schematic but provide parts that I want and the other is providing schematic but not the features that I want.

Now I have all the chips here ready, but Im still wating for programmer (I chose MiniPro TL866a because it was cheap and I want to program other chips to) and some other breadboards coz I run out of space basicly with CPU, ROM, RAM and decode logic (these chips are so big!).

I am not a big reader so when I read something I usually remeber it wrong or not at all so I need someone to tell me (I learn through listening) or watch video explaning it (that is why I know so many useless things :D). I read the primer, this forum, datasheets and tried to find some other sources but Im still not sure of some things.

First Question:
64K, what does it really mean? What I was able to get from reading, that means that I have 64K address space on the bus? Are they like "little squares" that I can locate? That means that I can put there 64K of RAM or ROM or IO and/or split it between these three (That would be convinient, wasnt it?).
I was able to understand it little bit more after watching this video (first two minutes): https://www.youtube.com/watch?v=NLEMsw1SjDY How accureate the graphical representation is? And olso 64K meand KiloBITS or KiloBYTES (while studying RAM datasheet there is 32K * 8, that meand 32KiloBITS * 8 = 32KiloBytes or what ?)

Second Question:
I want to use TM9918A for video out. And in the project that I want to mimic the person is using decode logic for "from DRAM to SRAM" swap. BUT I dont really see any advantige doing this, because the datasheet says that the IC includes DRAM refresh circuitry. https://emu-docs.org/VDP%20TMS9918/Data ... MS9918.pdf Am I correct and Do you know any DRAM that is reasonably priced good for this job?

Third Question:
TM9918A specifies 10.738635 MHz (+-0.005%) crystal, with distortions known to occure when using 10MHz. In my local shop I was able to get 10.7MHz and on ebay 21.47727MHz (double the required value). So do you know where to get the crystal online or tell me/link me how to divide the double one?

Ok so this is the project that I want to recreate: https://hackaday.io/project/5789-6502-h ... -computer/

Thank you for your time. That is all for now that I can think of :)

Pogof
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Few questions about my plans

Post by BigEd »

Welcome! You should have a look at Garth's primer:
http://wilsonminesco.com/6502primer/

Indeed, 64k as the size of addressable space is in bytes. RAM sizes are often in bits, as you saw, so you need to take care.

(About contacting the admin if you can't sign up: see the footer of the page, that will lead you to Mike's email address)
pogof
Posts: 15
Joined: 13 Sep 2016

Re: Few questions about my plans

Post by pogof »

Thanks, I read the primer but I might again to remember my self on few things :)
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: Few questions about my plans

Post by White Flame »

Regarding the 64K, the address bus is 16 bits wide. That means that the CPU can address 65,536 unique addresses. The data bus width is technically independent from that, so while the 6502 has an 8-bit wide data bus, if you had a CPU with 16-bit read/write width that would be 128 kilobytes of address space, while if the CPU only read/write 1 bit wide and had 1-bit wide registers, that could only address 64 kilobit. Because the 6502 reads & writes 8 bits wide whenever it addresses an address, that means it can address 65,536 bytes of space.

Often, logic chips will read the upper lines of the address to decide whether or not to enable the RAM/ROM/IO chips for that particular access, which will generally decide between fairly large areas of memory (like taking up a full 256 bytes or more of address space for an IO chip which might only have 10 registers).
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Few questions about my plans

Post by BigEd »

Dividing a 2x crystal output by two is a good idea - see
http://wilsonminesco.com/6502primer/ClkGen.html
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Few questions about my plans

Post by BigDumbDinosaur »

pogof wrote:
TM9918A specifies 10.738635 MHz (+-0.005%) crystal, with distortions known to occure when using 10MHz. In my local shop I was able to get 10.7MHz and on ebay 21.47727MHz (double the required value). So do you know where to get the crystal online or tell me/link me how to divide the double one?
I recommend you use a can oscillator for this purpose. If all that is available is the 21.47727 MHz version you can run its output through a flip-flop to generate the required 10.738635 MHz signal.
Clock Generation w/Flip-Flop
Clock Generation w/Flip-Flop
The above circuit is from Garth Wilson's site and shows how to do it. The clock output is gotten at the flop's Q pin. The recommended flop is a 74AC74, which is available in DIP and SOIC packages.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Few questions about my plans

Post by GARTHWILSON »

pogof wrote:
The rant is: I really hate to register on my @gmail.com email address. But when I tried @seznam.cz it refused to register me.
We had a terrible problem with spammers before Mike put the current criteria into effect. At the peak, I was throwing out more than 20 spammers every single day and cleaning up their messes. One part of this is that spammers mostly seemed to come from certain domains and countries, and we were not getting any legitimate sign-ups from those, so Mike (the owner) decided to ban them. Unfortunately then, if someone does come up from one of those with a legitimate interest in 6502, they have to contact the admin directly to ask for an exception.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Martin A
Posts: 197
Joined: 02 Jan 2016

Re: Few questions about my plans

Post by Martin A »

Using DRAM with the 9918 family usually means using the 4116 or equivalent (it's 16k by 1 bit wide so you need 8). It's an old design, long out of production which is awkward for modern designs, as it uses 3 voltages 12v, 5v and -5v. So you're only likely to find it a s pulls or somewhere that has very old stock.

Using half of a 32k x 8 static ram means you only need the 5v voltage supply but you need the other support chips instead.

Another alternative I have used is the 4164 DRAM, it's 5v only, 64x x 1 bit (so 8 needed again), and just tie the extra address line to 0v or 5v. It's almost as old as the 4116 though.

Some manufacturers did a 64k x 4 DRAM, (the 41464 or equivalent) they're used on the V9938 and V9958, it might be possible to use 2 of those, again with the spare address line tied to a voltage. I've no idea though if it works.
Bregalad
Posts: 149
Joined: 27 Mar 2010
Location: Chexbres, VD, Switzerland
Contact:

Re: Few questions about my plans

Post by Bregalad »

Welcome !

I'll just point out a discussion we had on nesdev just a while (it's still half going on) which is also about building a new retro system out of retro parts. You'll probably be interested. : http://forums.nesdev.com/viewtopic.php?f=5&t=14766
pogof
Posts: 15
Joined: 13 Sep 2016

Re: Few questions about my plans

Post by pogof »

Thanks all for responding!

@BigDumbDinosaur I dont quite understand how that should work. When I use, say NE555 I know that it generates square wave on one pin. So that mean that I use two of the flipflops, one for each leg of the crystal? Specially these two leg metal can crystals are black magic for me.

@GARTHWILSON That is unfortunate, but I know the pain little bit, because I own site on my own. But except few bad written articles, there is nothing so it was matter of seconds to remove it all and then set comments for only registered users with captcha registration.

@Martin A Thanks for explanation. In my local shop they have the 64K*4 for little to no money (not even 1/4 $) so Im going to give it a try.

@Bregalad Thanks I will read that. I found NesDev few months ago, because I was curious to know how to make my own NES carts. One day I want to have a collection of games but they are expensive for me (now) and I cannot find any in our country.

The reason is that computers and game consoles of that era was "not legal" to sell here. You had to do one of three things: 1) Go buy it yourself oudside of the country, wich took time to get permission and the currency and was really expensive and on way back you had to pray, that they wouldnt take it away on customs. 2) Buy it from someone who already had it. 3) Exchange foreign currency for special kind of currency and then you could spent this in special shops with limited supply. Or at least I was told that these were the only ways to get something like that. And after the revolution in 89 Computers didnt really caught on till mid 90. Or I think coz number of Win95 computers on "graveyards" is enormos.
Bregalad
Posts: 149
Joined: 27 Mar 2010
Location: Chexbres, VD, Switzerland
Contact:

Re: Few questions about my plans

Post by Bregalad »

I think famiclones were common in soviet-controlled countries. Some of them were even technically supperior to the Nintendo original PAL console, in the sense they supported playing NTSC games on a 50 Hz PAL TV just fine, when the official Nintendo didn't. Kinda hironic. Of course their collective value is very low in most cases. Today it would be no problem to import official material I imagine.
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: Few questions about my plans

Post by cbmeeks »

First off, welcome aboard! It's always great to see new users here. Especially young ones like yourself.
pogof wrote:
Third Question:
TM9918A specifies 10.738635 MHz (+-0.005%) crystal, with distortions known to occure when using 10MHz. In my local shop I was able to get 10.7MHz and on ebay 21.47727MHz (double the required value). So do you know where to get the crystal online or tell me/link me how to divide the double one?
From what I've read, the TMS9918 is very sensitive to deviations in the frequency. Meaning, that 10.7 MHz is too far off to work (IIRC). If you can find 2X the crystal, then clock divide it and that should be good enough.

Also, I have a few 10.738635 MHz crystals if you can't find anything. I'd be happy to send you one. They're pretty easy to get over here (US).

Something else I'd like to point you to is my collection of documents regarding the TMS9918. I've gathered everything I can on that chip and put it in one repo to share.

Please keep us up to date on your progress!

https://github.com/cbmeeks/TMS9918
Cat; the other white meat.
pogof
Posts: 15
Joined: 13 Sep 2016

Re: Few questions about my plans

Post by pogof »

Bregalad wrote:
I think famiclones were common in soviet-controlled countries. Some of them were even technically supperior to the Nintendo original PAL console, in the sense they supported playing NTSC games on a 50 Hz PAL TV just fine, when the official Nintendo didn't. Kinda hironic. Of course their collective value is very low in most cases. Today it would be no problem to import official material I imagine.
My father had small consumer electronic shop after the revolution occured and private companies were starting to start up. He said that one of the machines did have Mario +30 other games (or so) in it and was brownish yellow and dark red, that was Famiclone alright but more chinese then anything else by looks of it. There were probably some clones before but they didnt sold here/there wasnt any interest in them.
Only things I now remembered are two Game and Watch clones that I have put somewhere. But they are not worth anything yet.

With the official material, of course there is no problem getting it, I can jump to ebay and order whatever I want. The issue is the additional price, postage is almost the same price as the game itself, I am limited to Europe/Australia/other pal regions but outside EU you pay "import tax" (really a VAT and after certain price "the import tax") and they use DHL/Fedex or others and they take again some money so you see whatever I do it wont be worth it.
cbmeeks wrote:
From what I've read, the TMS9918 is very sensitive to deviations in the frequency. Meaning, that 10.7 MHz is too far off to work (IIRC). If you can find 2X the crystal, then clock divide it and that should be good enough.
That is what I gathered from the URL on the end of my first message, It is somewhere in comments on that project.
cbmeeks wrote:
Also, I have a few 10.738635 MHz crystals if you can't find anything. I'd be happy to send you one. They're pretty easy to get over here (US).
Great, if I can "order" 10 and pay for them could you do it for me? So I have spare if I ever needed them again? Please PM me :)
cbmeeks wrote:
Something else I'd like to point you to is my collection of documents regarding the TMS9918. I've gathered everything I can on that chip and put it in one repo to share.
I definitely read through that!
cbmeeks wrote:
Please keep us up to date on your progress!
Of course!
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: Few questions about my plans

Post by cbmeeks »

pogof wrote:
Great, if I can "order" 10 and pay for them could you do it for me? So I have spare if I ever needed them again? Please PM me :)
I don't have that many on hand but I just checked at Mouser and they are $0.55 USD for 10. But the shipping will be at least $5. I wished I had known this Monday when I placed a Mouser order. :-)

I will send you a PM.
Cat; the other white meat.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Few questions about my plans

Post by GARTHWILSON »

pogof wrote:
@BigDumbDinosaur I dont quite understand how that should work. When I use, say NE555 I know that it generates square wave on one pin. So that mean that I use two of the flipflops, one for each leg of the crystal? Specially these two leg metal can crystals are black magic for me.
BDD was recommending that you use a can oscillator, not just a crystal. The crystal by itself is a passive device and will not oscillate. It is a resonant circuit with an extremely high Q. It has to be put in a circuit with one or more active components if you want an oscillator. If you get an oscillator can instead of just a crystal by itself, the details of making an oscillator that is stable under the range of temperature and other conditions have already been taken care of for you, and the price is hardly more than just the crystal. You might also save board space because the entire oscillator, including the crystal is inside the can. These oscillator cans typically plug into an 8-pin DIP socket, or a 14-pin DIP socket. (These are the two common non-SMT sizes.) There's a picture of one at about the middle of the page at http://wilsonminesco.com/6502primer/ClkGen.html .

The oscillator can has one output pin. If the 21.47727MHz (double the required value) one is all you can get, what BDD is recommending is that you get that one and put it through the FF circuit to divide the frequency by two. You only need one FF section, for example half of a 74AC74. The oscillator has four pins, but only one is output. Run that into the ck input of the FF. the FF's Q\ ("Q-not") output goes to the D input, and you take your desired output from the Q pin. The duty cycle will be 50%, even if the oscillator's duty cycle is not.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Post Reply