6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Oct 06, 2024 11:32 pm

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Sat Dec 25, 2010 9:25 pm 
Offline

Joined: Sat Dec 25, 2010 9:07 pm
Posts: 4
Hi guys,

First of all, let me say that I'm just an electronic hobbyist. I have never had a job in the Electronics field, and I never made a living in this field.
I know the little that I know by tinkering with digital electronics as a kid way back in the 80s.
I do not own or have access to an oscilloscope or logic analyzer, I have just a good enough multimeter. It can count frequency up to 20 MHz, but it does not display signal shape.

I don't even know how and why I got involved into this issue, but that is a story for another time.
Maybe since I have not done electronics in such a long time, I wanted to relive that magic time.

I'm troubleshooting a factory made system based on a 6502 CPU which is supposed to run at 8 MHz.
The 6502 CPU is stamped 'R65C02P4' but it has a plastic sticker on it that someone wrote by hand '8.8 MHz'.
I cannot get this system to work at 8 Mhz. It does work stable at 4 and 6 MHz though.
The owner of this system told me that another person has attempted to fixed it.
I can see with a magnifying glass where the previous person probed the ICs pins.
He replaced 2 ICs and mixed 'LS' with 'HC' logic. After I got every IC to be compatible with each other, and replaced the original 27C256 120ns ROM with a brand new 90ns one, I was able to run the system at 6 MHz.

The system clock oscillator is a parallel Pierce type with 2 capacitors, 2 resistors, and a 74HC04.
The CPU receives the full 8 MHz (the clock is not divided by any other IC).

This system currently has:

6502 CPU (R65C02P4 with a plastic sticker that says '8.8 MHz')
8 MHz quartz (CL=18pF; 2 capacitors of 22pF each; parallel Pierce type oscillator config)
27C256 (32kx8 ROM with 90ns access time)
2x TMM2016-1 (SRAM 100ns access time)
74F138 (2 memory decoders, one for RAM the other for ROM)
5-6 other ICs which I think are not that important to make a difference

------------------------------------------------------------

74F138 decoder for RAM
pin 1 = A11
pin 2 = A12
pin 3 = A13
pin 4 = A15
pin 5 = A14
pin 6 = +5v

74F138 decoder for ROM
pin 1 = GND
pin 2 = +5v
pin 3 = A15
pin 4 = GND
pin 5 = GND
pin 6 = 6502 pin 39 (phase2 clock)

-------------------------------------------------------------

The system has a bunch of empty ROM/RAM memory sockets, maybe for future upgrades, that's why it has two 74F138s.
The 74F138s outputs go to ROMs and RAMs sockets only, they do not provide signals to any other ICs.

Initially after getting the schematic down on paper, I could not believe that this system would ever run at 8 MHz, and the owner is just trying to fool me to upgrade it from 6 MHz to 8 MHz. The original ROM had 120ns access time, too slow for 8 MHz the way the schematic was originally designed.

I took pin 6 from 74F138 ROM decoder and moved it to 6502 pin 34 (READ/WRITE), system works at 6 MHz, it doesn't work at 8 MHz.
I put pin 6 from 74F138 ROM decoder to +5v, works at 6 MHz, and it still doesn't work at 8 MHz.

I'm wondering if the 6502 CPU is just a 6 MHz one.
I can't find a place to buy a 6502 CPU at 8 MHz, or even 10 MHz, so that I can rule out the CPU.
Of course there is always the possibility of a timing issue I'm not aware of.
Anyone can learn digital electronics, but timing is an art.
The software in the ROM has nothing to do with this issue, it can be run at any speed, it would just work slower or faster.

I realize that what I'm asking, troubleshooting digital electronics and timing issues from a distance, is a difficult task, but I would like to hear suggestions from your previous experience.

Happy Holidays,
Tino


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 25, 2010 10:32 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
The R65C02P4 is a 4MHz part though may itself run faster but at 8MHz you really need 60ns or faster memory parts to be in with a chance of reliable operation.

90ns is pushing it a bit at 6MHz, though you can gain a little extra time if you only gate the address decoding at the end.

Quote:
Initially after getting the schematic down on paper, I could not believe that this system would ever run at 8 MHz, and the owner is just trying to fool me to upgrade it from 6 MHz to 8 MHz.

I think you are right and that you have made a very thorough attempt at what is probably impossible.

Cheers,
Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Dec 26, 2010 2:40 am 
Offline

Joined: Sat Dec 25, 2010 9:07 pm
Posts: 4
Hi Lee,

Thank you for your opinion.
I understand what are you referring to.

I think that I will modify the board. I will move pin 6 of 74F138 ROM decoder from Phase2 clock to 6502 pin 34 READ/WRITE, or maybe to +5v. That way I will not have the ROM enabled only for the HIGH duration of halfcycle (125ns / 2 = 62ns, which is less than ROM 90s access time).
I do realize that ROM and RAM access time values are the maximum values, in practice they take less time than that.

I also forgot to mention that the Phase2 signal is also used for the WE of RAM.
The 6502 READ/WRITE signal is gate-negated and the output + Phase2 signal are gated through a NAND, then the NAND output goes to WE of RAM.

Man, people designing 6502 systems really fell in love with the Phase2 signal, trying to design 'politically correct' schematics. The use of the Phase2 signal is totally unnecessary in such a simple system as I have. They should have kept it simple.
My experience with CPUs dates back to the Zilog Z80 which did not have these Phase1 and Phase2 signals, yet there was no problem designing simple schematics without them.
I do realize that Phase1 and Phase2 are useful in other situations.

I'll make those two modifications, eliminating the Phase2 signal in those two places.
Hopefully the R65C02P4 can take the 8 Mhz, otherwise I will get stuck until I find a real CPU that does 8 or 10 MHz.

I think that I can get a 70ns ROM. The problem is with the RAM, I have never seen any RAM chips which are pin compatible with TMM2016 or HM6116 and faster than 100ns.

Do you agree that taking the Phase2 signal out of the picture should allow this system to run at 8 MHz having ROM 90ns and SRAM 100ns (of course if the R65C02P4 holds) ?


Best regards,
Tino


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Dec 26, 2010 2:57 am 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
You need the phase two for the RAM write but not the RAM or ROM read.

Quote:
My experience with CPUs dates back to the Zilog Z80 which did not have these Phase1 and Phase2 signals, yet there was no problem designing simple schematics without them.

The Z80 generates justified read and write signals so doesn't need and further gating.

Quote:
The problem is with the RAM, I have never seen any RAM chips which are pin compatible with TMM2016 or HM6116 and faster than 100ns.

There are I think some cache RAMs that have a similar pinout but are 0.3" wide. Probably all but unobtainable now though.

You could probably use an 8KB or 32KB cache RAM and just tie the unused address lines to one supply but again you'll be dealing with 0.3" wide parts that may not be readily available.

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 27, 2010 2:20 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8415
Location: Midwestern USA
Tino wrote:
The 6502 READ/WRITE signal is gate-negated and the output + Phase2 signal are gated through a NAND, then the NAND output goes to WE of RAM...The use of the Phase2 signal is totally unnecessary in such a simple system as I have. They should have kept it simple.

Not so. It is necessary to qualify writes with Ø2 because the data bus is not necessarily valid when Ø2 is low. Depending on the RAM in use, it may be ready to pluck data off the bus before it has settled. You'll drive yourself nuts trying to troubleshoot such a problem.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 27, 2010 3:23 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
Quote:
It is necessary to qualify writes with Ø2 because the data bus is not necessarily valid when Ø2 is low.

and the address bus is not guaranteed to be valid before the R/W\ line goes down, meaning the RAM could write whatever data that's there, valid or not, to the wrong address. Furthermore, the R/W\ line is not guaranteed to come up before the address and data go invalid at the end of the write. φ2 absolutely must be used to qualify writes.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 27, 2010 4:05 pm 
Offline

Joined: Sat Dec 25, 2010 9:07 pm
Posts: 4
Thanks guys!
You can tell that I have never worked with a 6502 before. My first computer was a Sinclair ZX Spectrum clone, with a Z80.
Didn't have too much time to read info on 6502 before attempting the fix.

I will definitely keep the Ø2 where it is.

Some questions:


1. Would the system work at 8MHz with:

90ns or 70ns ROM (27C256)
55ns SRAM (TMM2016 or 6116 equivalents)

74F138 decoder for ROM
pin 1 = GND
pin 2 = +5v
pin 3 = A15
pin 4 = GND
pin 5 = GND
pin 6 = +5v

I realize that 1 ROM and 2 SRAM chips can be decoded easier/simpler, but the system has other sockets that may need to be used in the future.

2. What's your guess about the R65C02P4 with a '8.8 MHz' sticker? It does run at 6 MHz, but Would it work at 8 MHz?

3. Where could I find to buy 6502 at 8 MHz or even 10 MHz? I would like the direct replacement without the need to make any mods on the PCB.


On another topic, what is the name/brand of that plastic/silicone epoxy that they use on PCBs for holding/sticking wires, cables, quartz crystals, coils, etc. in place
That epoxy is either clear or milky in color, and is plasticky to the touch.
I'm not talking about the hard potting types that one can find, for example, in a bridge rectifier or RF coils.

Best regards,
Tino


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 27, 2010 6:07 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
Quote:
Would the system work at 8MHz with:

It's hard to say if it could work. The processor will always work faster than it says, but you lose the timing margins, making it necessary to have a big increase in the speed of the the memory and other hardware to get a relatively small increase in system operating speed. I'm sure you will need faster memory.

Quote:
Where could I find to buy 6502 at 8 MHz or even 10 MHz?

The only ones being made today are 14MHz with a typical true max of about 24MHz at 5V and room temperature. (That's for standard parts you can buy off the shelf in small quantities. At least one of WDC's customers runs a 65c02 core in their custom IC at over 200MHz.) See http://www.westerndesigncenter.com/wdc/ . You can buy directly from them, or go through distributors. They have a list of distributors at http://www.westerndesigncenter.com/wdc/distributors.cfm although I don't see any reference to Apatco in the U.S.: http://ncs.apatco.com/shop/index.php?productID=678 .


Last edited by GARTHWILSON on Fri Dec 31, 2010 6:02 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Dec 31, 2010 5:06 pm 
Offline

Joined: Sat Dec 25, 2010 9:07 pm
Posts: 4
Hi,


I have ordered faster ROM (70ns) and RAM (55ns) memory chips.
That was the fastest I could find from places I could buy right away.
I will post an update with the result, be it either success or failure .


Happy New Year!
Tino


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 04, 2011 3:31 pm 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
Faster RAM is good. I had a RAM speed problem on my pinball design as it would run a power up self test then keel over when I tried to run the main program. Turns out teh RAM was too slow, so 70 nS at 4 MHz did the trick rthere.

Good luck on yours!

_________________
"My biggest dream in life? Building black plywood Habitrails"


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 03, 2016 11:52 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Just wondering if you got anywhere with your speedup Tino? You have a 6MHz CPU which is suspected to run, or hoped to run, at 8MHz. (Actually, I see a datasheet which says the P4 version is specced for 4MHz operation)

Be sure to have a solid 5v power supply with lots of decoupling. It might even help to run at a slightly higher voltage - 5.25V is legal!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 03, 2016 9:12 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
I don't know if Tino is still around to answer, Ed (as you know, two of the respondents in this thread are no longer with us). Perhaps he could just yank his RAM and ROM, hard-wire an $EA or $A9 on the data bus, throttle it up to 8 MHz, and see if the address lines are counting up using his DVOM?

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 04, 2016 5:37 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8415
Location: Midwestern USA
barrym95838 wrote:
I don't know if Tino is still around to answer...

Tino hasn't visited since December 25, 2010.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 04, 2016 9:59 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Ahem, yes, well, that is quite a long time ago...


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 04, 2016 4:42 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
He should get an email notification that there have been responses to his post though, unless he has notifications turned off.

_________________
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?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: