6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 15, 2024 4:03 am

All times are UTC




Post new topic Reply to topic  [ 75 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Trivial circuits for sbc
PostPosted: Sat Dec 03, 2011 5:39 am 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
Well, when i started building my sbc, i just placed pull up resistors to the irq, nmi, rdy, so inputs, and left them "for later".
Now "later" has came so i first tried to build the automatic reset circuit when power comes up. I tried using 555, op amps, but i just didn't have any luck...
Now i need to build also multiple rdy and irq inputs, that should not be a problem...
But now my question are:
To which circuits should i give the control of the nmi input?
How can i use the so input?
How to make the auto reset circuit?

I hope this helps other too, since this is a "trivial pack"...
Also a funny fact, i have probably more that 200 ic, but i don't have a single or gate!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 03, 2011 6:11 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Quote:
To which circuits should i give the control of the nmi input?

I have one of my 65c22's (VIA1) on NMI\ and the rest of the peripheral ICs on IRQ\. I use T1 in VIA1 for the software real-time clock (RTC), giving 100 interrupts per second for the time of day and calendar. It only slows the computer down about 1%, including seeing if it's time to activate another task. If an application really needs to have it turned off to prevent jitter on the timing of other interrupts, I turn it off temporarily (ie, disable VIA1T1 interrupts). What I use the RTC for most is just timing key presses for debouncing, delay before auto-repeat, and auto-repeat rate, and maybe time-out on hardware error (like printer not ready), etc.. This prevents using delay loops that would keep the computer from doing other useful things while waiting. Using the RTC to schedule tasks or for timing actual hours and minutes and seconds is less common, and it has been years since the last time I used the calendar functions I wrote.

I have an "Abort" button on the same VIA which I can set up in software to cause an NMI to get the processor's attention. This lets you take back control from a crashed program, without resetting all the I/O ICs; so it's less drastic.

We're often told to reserve the NMI for something drastic like power going down; but in most systems the people on this forum are making, what happens in the last milliseconds before power is gone is of no concern. If you have a system that remembers things when it's off, it probably has batteries and can turn itself off in an orderly fashion. There's no time to store anything useful on a disc. If the 6522 used for the RTC goes on the 6502's NMI\, polling for interrupt sources on IRQ\ is simplified, and the RTC never misses a beat when other interrupts hit or are masked.

Quote:
How can i use the so input?

Most designers have respected its obscurity and left it alone.

Quote:
How to make the auto reset circuit?

Mine is at http://www.6502.org/users/garth/project ... chematic=1 . It uses one sixth of a 74xx14.
Edit: RST page in my 6502 primer: http://wilsonminesco.com/6502primer/RSTreqs.html

_________________
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:
PostPosted: Sat Dec 03, 2011 9:05 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
There's a video online(*) of Samuel's recent presentation of his single-board Forth machine. At one point he inputs a bad program, resets and continues where he left off. He points out he can do that because he has no destructive memory test. Maybe, in the absence of a fast peripheral like a disk drive which needs NMI's rapid response(+), you could use NMI to do a non-destructive reset into a monitor program. Then you don't need that 'Cold/Warm' prompt at reset time: just have one each Reset and Debug button.

(*) Ogg format: you may need to use VLC to play it.

(+) In Acorn's BBC micro, the NMI is used for the disk interface. It's rapid response because it's used only for one purpose, and the handling routine is in RAM so can be patched for each upcoming operation, whether a disk read or a disk write. More details

The SO pin is for even more rapid response: used in the C64's disk drive's firmware, for polling a single input in a tight loop which checks the overflow flag. I think very few systems use this: you can't do ordinary arithmetic and then check overflow if there's any chance some hardware will set the overflow flag mysteriously.

Cheers
Ed


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 03, 2011 3:10 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
Well, i was trying to make a Schmitt trigger from opamps and 555. I should give it another try.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 03, 2011 3:56 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Dajgoro wrote:
Well, i was trying to make a Schmitt trigger from opamps and 555. I should give it another try.
You might want to refer to the KIM-1 schematic. It uses a 556 (dual 555) in a nice, simple circuit that conditions a pair of pushbutton inputs to generate debounced NMI and RST signals. The schematic is on page 26 of the KIM-1 User Manual.


Regarding the SO input,
GARTHWILSON wrote:
Most designers have respected its obscurity and left it alone.
LOL!! Rather a droll remark, Garth -- I never knew you had such a dry wit. Thanks for the belly-laugh! :D

-- Jeff


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 03, 2011 9:26 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8487
Location: Midwestern USA
BigEd wrote:
I think very few systems use this: you can't do ordinary arithmetic and then check overflow if there's any chance some hardware will set the overflow flag mysteriously.

That and SO is absent on the W65C816S. The use of SO is predicated on a busy loop watching the overflow bit until it changes. It does result in rapid response, but not as fast as using this sequence on a 'C02 or '816
Code:
          SEI                   ;IRQs off
          WAI                   ;wait for IRQ...MPU will do nothing else while waiting

          ...IRQ handler follows...

In this code snippet, the IRQ handler immediately follows the WAI instruction. With IRQs off and WAI being executed, the MPU goes into a catatonic state like that produced by asserting /RDY, until an IRQ hits, at which time the instruction following WAI is executed. As near as I have been able to determine, response occurs within one clock cycle when /IRQ is asserted.

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 05, 2011 3:57 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
What kind of power supply do you(all of you) use for the sbc projects? I've been using the 7805, but is there a better solution? What if some day i decide to install a hard drive, and my nmos ic are kinda power hungry already.


Top
 Profile  
Reply with quote  
 Post subject: Power Supply
PostPosted: Mon Dec 05, 2011 7:01 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8487
Location: Midwestern USA
Dajgoro wrote:
What kind of power supply do you(all of you) use for the sbc projects? I've been using the 7805, but is there a better solution? What if some day i decide to install a hard drive, and my nmos ic are kinda power hungry already.

I use a standard ATX power supply to power my POC unit, with a jumper across the pilot circuit. One of the 5-1/4 inch drive connectors powers the POC itself. The particular supply I use has an On/Off switch. If yours doesn't, replace the jumper with a toggle switch. You'll have the necessary connectors to power a disk or other peripheral as needed.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Power Supply
PostPosted: Mon Dec 05, 2011 9:11 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
BigDumbDinosaur wrote:
Dajgoro wrote:
What kind of power supply do you(all of you) use for the sbc projects? I've been using the 7805, but is there a better solution? What if some day i decide to install a hard drive, and my nmos ic are kinda power hungry already.

I use a standard ATX power supply to power my POC unit, with a jumper across the pilot circuit. One of the 5-1/4 inch drive connectors powers the POC itself. The particular supply I use has an On/Off switch. If yours doesn't, replace the jumper with a toggle switch. You'll have the necessary connectors to power a disk or other peripheral as needed.


Maybe i could find one of those smaller version of th ATX power supply. Actually i have a 1M tall tower of dead atx power supplies on my attic...
Anyway are there some more powerful versions of the 7805?
(Nice desk, i noticed that everyone uses the same crocodile wires, including me...)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 05, 2011 9:28 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Quote:
Anyway are there some more powerful versions of the 7805?

I can't think of any offhand, but there are loads of options of course, including (but not limited to):
  • use more of them, each one local to the circuitry it's powering up , all fed from the the same input voltage & supply
  • use a voltage follower power transistor with a bigger heat sink (and put a diode in the 7805 ground circuit to make up for the B-E voltage difference from the transistor so you still get 5V out)
  • if efficiency and heat (and not just amperage) is the issue, use an integrated switching regulator like the Power Trends 78SR105
  • use an LM317 or LM350, especially the 350 with the K ending (ie, TO-3 case for better heat dissipation), which will give you at least 3A and typically up to 4.5A
All of these are more compact solutions than using a PC power supply.


Top
 Profile  
Reply with quote  
 Post subject: Re: Power Supply
PostPosted: Tue Dec 06, 2011 5:49 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8487
Location: Midwestern USA
Dajgoro wrote:
Actually i have a 1M tall tower of dead atx power supplies on my attic...

Why have a pile of dead power supplies? They're almost as useless as a leaky space suit.

Quote:
Anyway are there some more powerful versions of the 7805?

The 7805 is rated for 1 amp with adequate heat sinking. For powering a SBC alone it's more than adequate. You'll need 12 volts as well as 5 volts to run a disk and 1 amp isn't going to cut it.

Quote:
(Nice desk, i noticed that everyone uses the same crocodile wires, including me...)

Yep! No substitute for lots of clip leads. :lol: I couldn't function without them.

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 06, 2011 6:43 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
BigEd wrote:
you could use NMI to do a non-destructive reset into a monitor program.


The RESTORE key on Commodore 8-bit machines is tied to the CPU via the NMI input, performing exactly this function. The additional requirement of having RUN/STOP pressed when hitting RESTORE (which itself is a key that requires a harder press than any other key) is intended to prevent accidental triggers of this interrupt.

In the case of the Commodore 64 and 128, it dropped back into BASIC. But, the NMI vectors through RAM, and can be changed to do whatever you want.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 06, 2011 9:16 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Thanks - I didn't know that!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Dec 07, 2011 2:26 am 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
As for the 4000-7400 conversation from the crtc topic, i went to replace my 4000 glue logic with 74ls. It worked all fine until i replaced the CD4069 with the 74ls04, when i replaced it the sbc would not start even at 500khz. While when i replaced the 4081 with the 74ls08, all worked well. My glue logic is based on sbc-2, except i used and and not gates. the rest of the sbc logic is also 74ls(2-4 decoders and latches).

Edit: Now when i replaced the 4081 with 74ls08 i can get EhBasic working kinda stable again @ 2MHz with the 1MHz 6502 version(usually it would crash when i would enter a line of code like 10 INPUT A).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Dec 07, 2011 12:53 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
Progress:
I replaced the 74ls04(cd4069) with the 74hc04, and now it seems to be working, and EhBasic works kinda stable @ 4MHz with the 1MHz 6502(nmos).


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

All times are UTC


Who is online

Users browsing this forum: barrym95838 and 26 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: