6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 1:58 pm

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Jan 22, 2020 1:29 pm 
Offline

Joined: Sat Jan 30, 2016 11:43 pm
Posts: 15
Location: Baguio City, Philippines
I have an old Rockwell chip with label "R6502-13" that i'd like to do the "Free Run" test. I'm guessing it's an NMOS chip?
Attachment:
r6502.PNG
r6502.PNG [ 105.46 KiB | Viewed 1997 times ]

I've read the 6502 Primer: Clock Generation but I do not have the parts yet as mentioned for the NMOS chip. What I have is this 4pin crystal. Will this work?
Attachment:
1mhz.PNG
1mhz.PNG [ 162.9 KiB | Viewed 1997 times ]

Attachment:
1mhz_pinout.PNG
1mhz_pinout.PNG [ 100 KiB | Viewed 1997 times ]

_________________
// tinkerBOY


Last edited by M0001 on Wed Jan 22, 2020 2:21 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 1:43 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
Yes. Not only will that work, it's the preferred method.

And yes, I believe that is an old NMOS chip which has a minimum frequency to run (IIRC, something like 100KHz).

A modern WDC 65C02 would be better but the NMOS version can certainly be used (assuming it works).

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 2:20 pm 
Offline

Joined: Sat Jan 30, 2016 11:43 pm
Posts: 15
Location: Baguio City, Philippines
cbmeeks wrote:
Yes. Not only will that work, it's the preferred method.

And yes, I believe that is an old NMOS chip which has a minimum frequency to run (IIRC, something like 100KHz).

A modern WDC 65C02 would be better but the NMOS version can certainly be used (assuming it works).


Ok thanks. So the output of the crystal goes directly to the 6502's pin 37, correct?

_________________
// tinkerBOY


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 2:40 pm 
Offline

Joined: Sat Jan 30, 2016 11:43 pm
Posts: 15
Location: Baguio City, Philippines
So I tried it on a breadboard and connected all the necessary pins including the data bus pins to run the NOP code "ea". I' ve also connected one LED to one of the address bus. Powered it with a 5v power supply but I don't see to get any activity from the led. Anything I missed?

Attachment:
6502_breadboard.jpg
6502_breadboard.jpg [ 259.71 KiB | Viewed 1987 times ]

_________________
// tinkerBOY


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 2:50 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
M0001 wrote:
So I tried it on a breadboard and connected all the necessary pins including the data bus pins to run the NOP code "ea". I' ve also connected one LED to one of the address bus. Powered it with a 5v power supply but I don't see to get any activity from the led. Anything I missed?

Attachment:
6502_breadboard.jpg


connecting the LED to pin 25 (A15) may be more visible - A0 is going to be wiggling at clock/2 , so fast. However it ought to still glow somewhat. I presume you've done the usual thing of connect the LED directly to just 5v rail - just to be sure it's in the right way round and working...

And make sure the can oscillator is the right way round.

This is where an oscilloscope, even a cheap one, can be really handy just to check a few things.

There is also the possibility of a fake/broken chip - if this is something you bought off ebay. Do you have anything with a real working 6502 in it that you could use to check?

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 3:01 pm 
Offline

Joined: Sat Jan 30, 2016 11:43 pm
Posts: 15
Location: Baguio City, Philippines
I have tested the led to be working fine. For the 6502, it’s also tested to work just fine with a clone replica of Apple I i assembled. For the crystal i have no way of testing it though. I will definitely get an Oscilloscope in the near future. :)

I tried several nmos 6502 chips i have laying around but but couldn’t seem to do the “free run”.

_________________
// tinkerBOY


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 4:14 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
Was Rockwell still manufacturing NMOS on the 45th week of 2011? Or am I reading something incorrectly ...

I also noticed on first glance that your reset circuit might possibly be cause for concern.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 4:23 pm 
Offline

Joined: Sat Jan 30, 2016 11:43 pm
Posts: 15
Location: Baguio City, Philippines
It looks like the jumper wire for the VCC is not intact so i pressed it down and made sure there’s 5v on that pin. Sure thing, now it’s working. :)

Now I just need to find a way to slow down the 1mhz clock so I can clearly see what’s happening. Is it possible to slow it down to maybe the minimum 100khz clock?

_________________
// tinkerBOY


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 4:36 pm 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
You can divide by 2 with a Flip Flop, so a single 74xx74 dual flip flip would give you options of 500khz and 250khz, chain 2 together and you'd have 125khz and 62.5khz too.

Or use a counter, something like a 74xx93 would give you the same 4 clock rate options as pair of 74s.

(I wonder about that date code too)


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 7:44 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Welcome.

As Drogon said, put the LED (with series resistor) on A15 which will change states the most slowly so you can actually see it flashing.

As cbmeeks said, the oscillator can you have is the preferred method. That's not just a crystal. I just now edited that page of the 6502 primer to clarify that. A crystal by itself will not oscillate, any more than a bell just sitting there will ring if it's not being struck. It has to have the other circuit components around it to produce a signal. The oscillator can has the entire circuit to do that.

Like barrym95838, I doubt Rockwell was making any 65xx parts in 2011 (which the date code on yours says). I'm all the more sure they weren't making any NMOS 6502's anymore by then, so you definitely have a counterfeit there. There's quite a counterfeiting industry in China, with such parts showing up on eBay all the time. They pull parts out of old circuit boards, clean them up, sand the tops, and re-mark them. See https://www.youtube.com/watch?v=5vN_7NJ4qYA . I don't know why they don't just put the same markings back on, or just leave the markings alone. According to this pie chart from Wikipedia, China produces nearly twice as many counterfeit products as all other countries combined:
Attachment:
ChinaCounterfeits.gif
ChinaCounterfeits.gif [ 16.32 KiB | Viewed 774 times ]

Anyway, it's best to just buy from authorized distributors. We try to keep our sticky topic "65xx parts sources" up to date.

_________________
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  
PostPosted: Wed Jan 22, 2020 10:21 pm 
Offline

Joined: Sat Jan 30, 2016 11:43 pm
Posts: 15
Location: Baguio City, Philippines
Martin A wrote:
You can divide by 2 with a Flip Flop, so a single 74xx74 dual flip flip would give you options of 500khz and 250khz, chain 2 together and you'd have 125khz and 62.5khz too.

Or use a counter, something like a 74xx93 would give you the same 4 clock rate options as pair of 74s.

(I wonder about that date code too)


Yeah i was suspicious about the datecode too. I actually bought a few wdc 65c02s from Mouser.com a few days ago and just waiting for it to arrive.

If the chip i have is an old NMOS, is it possible to single pulse it or slow down the oscillator to about 100khz? I think it's mentioned in the 6502 Primer: Clock Generation that it's not possible.

_________________
// tinkerBOY


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 22, 2020 11:07 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
M0001 wrote:
If the chip i have is an old NMOS, is it possible to single pulse it or slow down the oscillator to about 100khz? I think it's mentioned in the 6502 Primer: Clock Generation that it's not possible.

100kHz yes; but not single-pulsing it as in leaving it long enough in one state to poke around and look at the various lines. The NMOS 6502 apparently has registers that are similar to DRAM in that they keep their data in charges that die out quickly. WDC's 65c02 lets you stop the clock indefinitely, in either phase, without losing information or losing its place.

_________________
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  
PostPosted: Fri Jan 24, 2020 3:13 am 
Offline

Joined: Sat Jan 30, 2016 11:43 pm
Posts: 15
Location: Baguio City, Philippines
GARTHWILSON wrote:
M0001 wrote:
If the chip i have is an old NMOS, is it possible to single pulse it or slow down the oscillator to about 100khz? I think it's mentioned in the 6502 Primer: Clock Generation that it's not possible.

100kHz yes; but not single-pulsing it as in leaving it long enough in one state to poke around and look at the various lines. The NMOS 6502 apparently has registers that are similar to DRAM in that they keep their data in charges that die out quickly. WDC's 65c02 lets you stop the clock indefinitely, in either phase, without losing information or losing its place.


Thanks.

So I built a clock on a breadboard that I can adjust and one that I can single pulse which both use a 555 timer. Both clocks work on this particular 6502 chip including the single-pulse. One thing I noticed though if I use the single-pulse clock when I leave it off for a while and single pulse it again, the outputs from the address bus do not seem to continue from where it stopped. It works fine though as long as I keep single-pulsing it and not stopping for maybe a while.

_________________
// tinkerBOY


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 24, 2020 3:35 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
M0001 wrote:
One thing I noticed though if I use the single-pulse clock when I leave it off for a while and single pulse it again, the outputs from the address bus do not seem to continue from where it stopped. It works fine though as long as I keep single-pulsing it and not stopping for maybe a while.

Right. Without a clock input at a minimum rate the chip "forgets" its internal state. According to both the MOS preliminary data sheet (1976) and the MOS/CSG 1980 data sheet that maximum pluse width of either phase of Φ₀ IN is 520 ns, which means that technically you can't run it at much less than 1 MHz and expect it to work, if I'm reading this right. But I see people running 6502s at 750 KHz all the time, so perhaps the data sheet is a bit conservative?

FWIW, I do remember that the 6800 was spec'd to run down to about 160 KHz, or something like that.

If you want to single-step these CPUs, you can do it by bringing the RDY low (while continuing to give it a full-speed clock), which will stop processing either immediately or, if a write cycle is in progress, at the end of that write cycle.

_________________
Curt J. Sampson - github.com/0cjs


Last edited by cjs on Sat Jan 25, 2020 7:18 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 24, 2020 8:36 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
It's all true - but note that it's the max cycle time which is the constraint here. The general advice is to go no slower than 100kHz for reliable operation. In practice you've probably got some tens of milliseconds before charge leakage starts to flip values, maybe more: for manual experimentation this is no big deal, but reliable operation in the field is another matter. And if you're trying to debug something, you don't want an extra source of uncertainty!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

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: