6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 2:10 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Mar 25, 2014 6:35 pm 
Offline

Joined: Tue May 05, 2009 2:49 pm
Posts: 113
I know it's a horrid abuse of programmable logic, but I'm wondering if it's possible to create an astable multivibrator in Verilog?

Why?

To complete the 6525 effort, I need to create a 500uS delay period. It doesn't have to be precise, just >= 500uS. I otherwise have no need for a clock signal. Thus, I was wondering if it would be possible to put the 10uS CPLD into a feedback loop, count 64 transitions, and use that as a timer.

Jim


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 25, 2014 6:51 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8483
Location: Midwestern USA
brain wrote:
I know it's a horrid abuse of programmable logic, but I'm wondering if it's possible to create an astable multivibrator in Verilog?

Why?

To complete the 6525 effort, I need to create a 500uS delay period. It doesn't have to be precise, just >= 500uS. I otherwise have no need for a clock signal. Thus, I was wondering if it would be possible to put the 10uS CPLD into a feedback loop, count 64 transitions, and use that as a timer.

Jim

I'm no Verilog expert, but seem to think that a simple(?) state machine may accomplish what you want. However, I'm not sure how you would go about achieving an ~500µS delay without use of a clock input.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 25, 2014 7:31 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8540
Location: Southern California
Quote:
I was wondering if it would be possible to put the 10uS CPLD into a feedback loop, count 64 transitions, and use that as a timer.

Keep in mind that the 10ns (not µs) is a guaranteed maximum, and that there's no guarateed minimum. I suspect typical would be somewhere around half to 2/3 of max.

_________________
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: Tue Mar 25, 2014 8:21 pm 
Offline

Joined: Tue Sep 03, 2002 12:58 pm
Posts: 336
If you have a spare input and output, a resistor and capacitor will give you some approximation to any delay you want.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 25, 2014 8:57 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8540
Location: Southern California
John West wrote:
If you have a spare input and output, a resistor and capacitor will give you some approximation to any delay you want.

and even if there are no Schmitt-trigger inputs, you can approximate one by adding positive feedback with resistors, to avoid problems with the "no-man's land" in the slow input transitions between solid logic 0 and logic 1.

_________________
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 Mar 26, 2014 5:49 am 
Offline

Joined: Tue May 05, 2009 2:49 pm
Posts: 113
GARTHWILSON wrote:
Quote:
I was wondering if it would be possible to put the 10uS CPLD into a feedback loop, count 64 transitions, and use that as a timer.

Keep in mind that the 10ns (not µs) is a guaranteed maximum, and that there's no guarateed minimum. I suspect typical would be somewhere around half to 2/3 of max.

Yep, messed up there. 10nS, but the theory is still valid, as I need 500nS of delay:

http://www.zimmers.net/anonftp/pub/cbm/ ... 6525-7.gif (see CB and CA notes in top left corner of page)

I figured I'd need to empirically test the delay to get it right...

I will have some extra pins on a 95144-100 to create the one shot, and I like it better as an idea. I assume you drive the output high, and then the input going high is your delay...


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 26, 2014 1:58 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
The trouble with propagation delay is, it's not predictable or well specified. No minimum figure, as Garth said.

A better way -- and the normal and natural way -- to implement a delay with programmable logic is via a counter. At the start of the delay the counter would be loaded, then it would proceed to decrement (or increment) according to a clock signal that's been chosen as a time base. The delay is complete when the counter reaches its terminal value (typically zero if you're decrementing).

That same basic idea can work for you, too. Presumably this 6526 device -- a 65xx peripheral -- gets the Phase 2 signal fed to it, and that can serve as your time base. From the datasheet you posted, I see the delay commences with a write to PRB. This would load your counter, which would subsequently decrement at the Phase 2 rate until the delay is complete. You'd arrange for CB to be low anytime the counter is not at its terminal value. This gives a nicely defined pulse following a write to PRB. :)

You'd need to decide whether the counter decrements on the rising or falling edge of Phase 2, and what the initial count should be. Looks like that count might be be extremely small -- like, 1! A simple flipflop might serve as the "counter." It would "count" from 1 down to zero. Possibly the original 6526 logic is just as I describe.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 26, 2014 6:30 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
For an uncalibrated delay, you could make an on-chip ring oscillator with an odd number of inverters - perhaps 5 or 7 - and use that fast signal to clock a counter. You could trim that by bringing one of the outputs off-chip and loading it with a capacitor, probably.


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 2 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: