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

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Oscillator
PostPosted: Wed Jan 08, 2014 9:55 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Hi guys

I need some expert advice on a small part of my homebrew 6502.

I plan to use a 4MHz crystal oscillator and a D-type flip-flop (a 74HCT74) to give me a steady 2MHz clock signal. Due to post Xmas cash flow issues I'm waiting to get the 74HCT74 and a few other things needed for the project, so have decided have a play with the 4MHz oscillator.

Here's the very small circuit I put together:
Image

The odd thing is that the input voltage is too low after the resistor. There oscillator needs 5V and going be the (very scant) information in the datasheet it should be limited to less than 20mA.
So I calculated things this way: 5v / 0.015 (15mA) = 333 Ohms for R1.
I believe this to be wrong as the incoming power supply rail is 5V, but the oscillator takes 5V. Going by Ohms law surely that should equal 5-5=0 / 0.015 which is ... 0.
How do you limit the oscillator so that it's VCC does not take more than 20mA (ideally 15mA)? or is this a case of the oscillator will take only 20mA by itself - i.e. this isn't a case of limitation, but just to note it doesn't take more than that?

Cheers!

P.S. Oddly my oscilloscope (a PDS5022S) does say it's detecting 4MHz, but the voltage is 6v!
BTW I'm new to all of this if you hadn't already guessed :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Oscillator
PostPosted: Wed Jan 08, 2014 10:02 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Quote:
is this a case of the oscillator will take only 20mA by itself - i.e. this isn't a case of limitation, but just to note it doesn't take more than that?

Yes, I'd say that was it.
As you almost say, if your resistor was carrying so much current, it would drop all of the voltage, leaving none for the oscillator. (I think!)

Cheers
Ed


Top
 Profile  
Reply with quote  
 Post subject: Re: Oscillator
PostPosted: Wed Jan 08, 2014 10:13 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Don't put any resistor in series. The maximum-current spec. is saying that they guarantee that at 5V, the current won't exceed 20mA with the rated load.

_________________
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  
 Post subject: Re: Oscillator
PostPosted: Wed Jan 08, 2014 10:52 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Thanks very much for your replies and for confirming my suspicion :). I'm more than a little inexperienced in reading datasheets - although I still think that particular one is a bit ambiguous.

On a slightly different note: does the 74HCT74 sound like a good idea for the D type flip flop to reduce the 4MHz output to 2MHz? I'm using HCT to keep everything TTL compatible.


Top
 Profile  
Reply with quote  
 Post subject: Re: Oscillator
PostPosted: Wed Jan 08, 2014 11:17 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
The oscillator data sheet says that with a 5V power supply, the high output voltage will be at least 4.5V, so the flipflop can be either HC or HCT. Depending on the construction and what parts you use (like an older 2MHz processor versus a WDC 14MHz+ one), 74AC or ACT may be better. All the CMOS ICs' outputs will be pulling up near 5V when high anyway, so logic with or without the "T" should work equally well, except the delays on the "T" version will be slightly longer. NMOS and TTL types can't pull up as high though, so logic inputs they're connected to should have the "T". What is your reason for planning to divide the 4MHz down to 2MHz, as opposed to just using the 4MHz (non-divided) or a 2MHz oscillator? If it's for symmetry, note that that won't really matter until you start getting close to the speed limits of the parts.

_________________
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  
 Post subject: Re: Oscillator
PostPosted: Wed Jan 08, 2014 11:25 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
I initially chose 2MHz as although I have a WDS W65C02 10MHz CPU, I have original 6522 VIA I/O chips which I'm not sure will with stand more than 2MHz.


Top
 Profile  
Reply with quote  
 Post subject: Re: Oscillator
PostPosted: Wed Jan 08, 2014 11:40 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
The marking should tell. If they're NMOS, I don't think I've seen any rated for more than 3MHz. We have data sheets at http://6502.org/documents/datasheets/. Unless you're super strapped for cash though, I might recommend the WDC VIAs, since in the input mode, the port pins are genuinely CMOS-type inputs (unlike other manufacturer's 6522's and even 65c22's which offered an LSTTL load on the port pins when in input mode), and, in the output mode, the CMOS ones are much, much stronger than the NMOS ones were. WDC's are like a 43-ohm resistor to Vcc or ground until you pull enough current to make them start going into current-limiting at 50mA per pin, both sourcing and sinking. (This is from my own measurements, not the datasheet.)

_________________
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  
 Post subject: Re: Oscillator
PostPosted: Thu Jan 09, 2014 12:15 am 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Thanks for the heads up regarding the WDC 65C22. I did try and get some last year, but found there weren't any in the UK (thus making it expensive to order in from places like the states). I'll have another look tomorrow and also see which exact ones I have already got and advise.

Thanks again!

[edit]

I have 4x R65C02P2 VIA ICs (I got them in a batch off of ebay).
However, I did spot these ;
http://www.ebay.co.uk/itm/Western-Desig ... 3cdab529be

Bit pricey, but there are 5 of them...


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 27 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: