6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 9:35 pm

All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Thu Nov 17, 2011 9:12 am 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 68
Dajgoro wrote:
Well i am building a 6502 sbc for the first time also. Your plans are similar to mine. I've based my board on the SBC-2 from 8BIT, it is a simple design to start with. For the keyboard, lcd, rtc, mouse i am using a pic16f877, i connected it using the PSP port, which allows to use it as a regular peripheral. For now i managed to get the keyboard working, and a 4 line lcd with buzzing character 7. I still have to find out how to get the i2c bus working for the rtc. Now i started to build a graphic board using a MC6847 CRTC chip, it has color(requires MC1372), and it is kinda simple to use, and available on ebay!!! I would like to be able to read sd cards and connect to the Ethernet, but i still haven't figured out how to do this...
There are lots of topics in the hardware thread on acia, crtc, ps/2, ect that i opened for my sbc...


Thanks for posting; I am having similar thoughts about using an MCU as I/O processor. I like the Atmel family so that's probably what I would be using. Excellent that you have gone this route (although with a PIC) - when the time comes I know which threads to search for!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 17, 2011 10:07 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Johan, the method I suggest for beginners is not the absolute fastest, but is simple and plenty fast for when you're not pushing the speed limits of the parts. For your RAM however, I would still recommend putting your lowest delay in the φ2 logic. That would mean swapping your RAM's CS and /CS2 and run the φ2 directly to the CS, and use /A15 for for the /CS2. To do it all with a single 74xx00, use a section as an inverter to replace the 74xx04 section. I didn't, because I had the '04 for something else anyway.

For a computer board for a product we made starting in 1994 before microcontrollers were so common and available in so many variations for small quantities and no mask programming, we just used a '02, a '22, 2Kx8 SRAM, 8Kx8 EPROM, 74HC00, and a 93c06 serial EEPROM. Including the PC board and the assembly labor, it didn't cost us any more than the 68HC11 variation we wanted with the quantity of RAM and ROM we needed plus the EEPROM for storing custom defaults, and the parts were more available since the automotive industry had the 'HC11 tied up on allocation. A couple of manufacturers told us clearly that our business was too small for them to be interested in selling to us. Now of course you can buy microcontrollers in many variations from stock at many distributors. Although they are perfect for many jobs, there's still a place for making your own computer with a lot of RAM that you can run programs from.

74AC or ACT logic is 2-3 times as fast as HC and LS. ABT which BDD recommends is even better but not as widely available, especially to hobbyists overseas (like you), and some 74ABT parts are not available at all (like the '521 or '688 I want), let alone in DIP packages.

As a hobbyist, you can hope for typical timings on the ICs, but otherwise you have to design around maximums. Also, look at the input-output combinations and edge directions (H->L, L->H) that may be the most limiting.

74xx138:
74HC 28ns typ, 35ns max
74HCT 20ns typ, 35ns max
74ACT 8ns typ, 12 max
74AC 8ns typ, 11ns max
74F 6.1ns typ, 8ns max

74xx139:
74HC 28ns typ, 38ns max
74HCT 18ns typ, 30ns max
74AC 7ns typ, 8.5ns max
74ACT 7ns typ, 10ns max
74F 6.1ns typ, 8ns max

74xx00:
74HC 8ns typ, 15ns max
74HCT 18ns typ, 23ns max
74AC 6ns typ, 8ns max
74ACT 5.5ns typ, 9ns max
74F 3.7ns typ, 5ns max

These are at 5V and 25°C. They will be slower at higher temperatures (and/or lower voltages).

At slow clock speeds and with 74HC logic, you can get away with murder. As you get to faster clock rates and rise times, you have to start getting a lot more careful in the construction or you will end up with things not working reliably and you won't be able to figure out why.

Quote:
I have read the tip of the day thread now, some excellent tips in there. Somewhere in there was a tip about breaking it down to smaller pieces and solving one problem at a time, and I think this is probably the best advice anyone can give a novice like me Smile Still, I like plans of grand designs in theory.

The simple address-decoding scheme won't keep you from doing a ton of expansion later. It's best if you can have a plan that can work soon and simply but does not prevent a lot of adding-on in the future. IIRC, where it mentioned breaking it down into smaller pieces was referring to your software approach.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 17, 2011 4:59 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
What Garth is saying is there are numerous ways to slice your cake. Just don't try to eat too big a piece when you are just starting out.

For a first effort, 74AC logic will do you fine and is readily available in PDIP packages at low prices. You can build your first computer on perf board with point-to-point wiring (wire wrap if you can, as it's less a hassle than soldering). Later on, you may want to consider going with a printed circuit board (many sources from which to choose), which will give you more flexibility and also open the door to using smaller chip packages, such as SOJ.

In time, you may want to consider programmable logic, which will open up a whole new world of design possibilities. I'm still working with my first design, which I built on a PCB (my hand-eye coordination has deteriorated in recent years due to age and health), using a W65C816S and 74AC logic. However, my second design, which is still a paper computer, will use an Atmel 1500-series CPLD for just about all logic functions. Doing so will allow me to implement features that aren't practical with discrete gates.

_________________
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 10:16 am 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 68
Sorry for late reply guys, I have spent the last two weeks staring at the breadboard, cutting wires with scissors and rearranging ICs. If this exercise has taught me anything, it's that it takes a lot more time doing the actual wiring than planning the concept :) It's also obvious that your tips about keeping address decoding simple is very good advice. For now, it is more than sufficient. There will be enough wiring as it is. Indeed, baby steps seems to be the way to go. Turns out that those steps are not so small when put in practice.

So far, I have managed to hook up the 65C02 to a hardwired NOP instruction (got the idea from
http://mysite.du.edu/~jcalvert/tech/6504.htm), to test the 65C02 with the clock source and reset circuit. This turned out to be a good idea, as I learnt the hard way what an open-drain output is, and that I accidentally ordered a watchdog timer rather than a simple reset circuit (no, I didn't read the specs for it that closely). It seems to run OK now - the A15 is connected to a LED and it flickers at
what is estimately 20 Hz (slow enough to be noticable). I used the clock circuit proposed by http://www.reocities.com/SiliconValley/2072/6502prj1.htm (2 MHz crystal and a hex inverter).

Also, I hooked up a DLP-2232PB-G microcontroller to the breadboard, connecting it to the 28C256 EEPROM via a 12-bit ripple counter (wasn't able to get more than 14 pins working from the MCU, so I had to clock count the lower 12 address bits). I wrote a Visual C++ program that reads a HEX file and programs the EEPROM with it. I have some random bugs in it but it seems to program OK when working.

So I think the next step now is to connect the EEPROM and 65C22 to the 65C02 and write a simple ROM code that flips som pins (flashing some LEDs).

I have created a small blog for my rambling, http://8bit.johanfransson.se, if anyone would be interested.

I think your advice regarding programmable logic is excellent advice. I want to learn about this before any succeeding projects. I have no experience with wire-wrapping (and little experience with soldering), but this is probably the way to go for more advanced designs, so I will have to learn and practice this as well. Or as you say, a printed PCB, when stuff gets really complex. The breadboard is just too fragile in terms of wiring popping out (or put in the wrong place) for the amount of wires required. But it will have to do for now, until I know what I am doing :)

If I manage to take this project to a complete working ROM/RAM setup, I am thinking about implementing a bitbanging SPI services routine in the ROM, using the 65C22. It seems straight forward, and frankly, I think I will have had enough of parallel buses for a while when reaching this point :) But we will have to see; if the amount of wiring gets out of control, I might switch focus and learn more about PCB and/or wirewrapping to make the board more solid. As I might have mentioned before, part of the goal for me is not the finished product itself, but to learn.

I have no problem staying with low clock speeds for a while. Garth, I have considered and will use your advice regarding switching the wiring for Phi2 and chip selects for RAM. I have a question though: when talking about Phi2, do you usually use the clock-out from the 65C02, or the output from the clock circuit itself? Also, do you have any references to information regarding the corrupt-RAM-data issues?

Thanks again guys.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 06, 2011 8:25 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Quote:
If this exercise has taught me anything, it's that it takes a lot more time doing the actual wiring than planning the concept :)

That's why I like the synchronous-serial parts so much-- I²C, SPI, Microwire, dumb shift resgisters, and relatives of SPI. :)

Quote:
The breadboard is just too fragile in terms of wiring popping out (or put in the wrong place) for the amount of wires required. [...] if the amount of wiring gets out of control, I might switch focus and learn more about PCB and/or wirewrapping to make the board more solid.

The only thing that's fragile about WW is that the pins can easily get bent to touch each other if there's no protection for the back of the board.  I have found wire-wrap to be totally reliable though.  I started in WW over 20 years ago with some trepidation, but none of the things I've built in these 20 years have had a single problem from wire wraps.  [Edit, 11 years later: still no problems.]  Not one.  Make your wires no longer than needed to connect the required pins though.  That means they will go straight, not with curved paths but also not tugging the pins toward each other, and since there's no extra wire length, the wires will not be able to come up above the pins and get snagged.  Really the only limit to how much wire you can pile in is how many levels of wrap you can get on a post; and good planning will keep that from being a problem.  Getting the tool down onto a pin that's surrounded with lots of layers of wire going between pins can be a small challenge, but always manageable.  This is the bottom of my workbench computer which has no unused rows of holes between ICs:
Attachment:
BotWithFrPanSmall.jpg
BotWithFrPanSmall.jpg [ 141.58 KiB | Viewed 420 times ]

The only curved wires there are soldered at one end.  Even when it's right-side-up (wire side down), the wires stay within 1/8" or 3mm from the board.

Quote:
when talking about Phi2, do you usually use the clock-out from the 65C02, or the output from the clock circuit itself?

For 6502, it's phase-2 out (pin 39 if you're using the DIP).  For the 65816, it's the input, since the processor has no clock output.

Quote:
Also, do you have any references to information regarding the corrupt-RAM-data issues?

We had a few forum members years ago who neglected to bring phase 2 into the RAM-writing logic and wound up with problems.  I don't think we've had any recently.  Simply by examining the timing diagrams and specifications, you can see why it would be a problem.

The simplest, most reliable, and most compact clock oscillator will be the oscillator cans that fit into an 8- or 16-pin IC socket.  They require no external parts, and the details of making an oscillator that's stable and dependable under all conditions have already been figured out for you.

It would probably be a good idea to read through the "Tip of the Day" topic again and periodically as you get into the construction more.  There's a lot of helpful stuff there and it would be easy to forget key parts with only a single read.  [Edit:  My 6502 primer is much more complete.]

_________________
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: Tue Dec 06, 2011 8:49 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
I am a former wirewrapper and agree with everything Garth says. However, one word of caution which may save you many hours/days/months of troubleshooting noise issues: Either double/triple wirewrap all of your powers and grounds, or use thicker than 30AWG wire... Also, use a "star" distribution technique where your main power in goes to the "main load"+oscillator then spreads out in a starlike pattern to other surrounding IC's. This technique is superior to a simple "daisy-chain", where you just wire whatever is closest to your main power in and then wire everything else in consecutive order.

My advice only applies when using standard .1" non power/ground plane Vectorbord...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 12, 2011 3:40 pm 
Offline

Joined: Sun Nov 01, 2009 2:22 pm
Posts: 21
Location: United Kingdom
GARTHWILSON wrote:
Make your wires no longer than needed to connect the required pins though. That means they will go straight, not with curved paths


Grr, and there was me thinking I'd made my board look pretty. So at what speed does the path the wires take impact performance?

I'm (re)using a 2MHz CPU can I get away with longer wirewrap paths?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 12, 2011 11:24 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
At 1 & 2MHz you can get away with murder—although there are no clear boundaries in this case as to what constitutes murder, and there's not any precise point in frequency where suddenly new rules kick in. If you were to put a variable-frequency oscillator on it and gradually turn it up, or replace the parts with faster ones with faster slew rates, you'll run into problems sooner than you would with better construction. On my computer board pictured above, the 5MHz phase 2 signal looks a disaster on the oscilloscope, so I expect the board wouldn't work at all if I had been a little careless in the construction. It's not the clock rate so much as the slew rates (ie, rise times on the signal transitions), since with 4MHz parts it does work up to 7MHz ok so I run it at 5MHz for a little safety margin, but again the shape of the phase-2 signal (and others) is rather disastrous because of the inductance of the wires. One way to reduce that inductance is to keep the wires as short as possible, and relatively straight, and then there's the matter of an actual ground plane which you can get in these breadboards with holes on .100" centers, intended for ICs. For the next time I do this, I definitely know more about "good engineering practice" than I did when I originally built this up.

_________________
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: Tue Dec 13, 2011 1:42 am 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
This topic keeps me wondering about my methods. My only method of construction for now is point to point soldering on perfboard, and i constructed my sbc this way, and it manages to work at 4MHz. Now i wonder about my 68000 sbc that i plan to do next, it will be running at 8-10MHz and i wonder if my point to point soldered flat ribbon wires will do well, or will there be too much interference. I tend to make the wires as short and straight as possible...


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

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Doesn't the 68000 have a four-phase bus cycle? (I know Samuel can answer that.) If so, I suspect it would be a little more immune to ringing and other problems that result from poor construction. It doesn't try to do as much in one clock pulse as the 6502 does. AFAIK however, the 68000 is no longer in production, so you might do well to go to the 65816 which compares favorably in benchmarks, is in production, has a much simpler bus structure, and lets you transfer a lot of what you already know from the 6502.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 13, 2011 3:59 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Yes, the 68000 has a 4-phase bus cycle. Over-simplifying, phase 1 is address assertion, phase 2 is data assertion for writes (or, just the data strobes for reads), phase 3 is to let synchronous memories catch up as far as I know -- I don't remember it doing anything at all, while phase 4 is where DTACK is sampled. If DTACK is negated, each succeeding clock cycle continues to sample DTACK until it is asserted.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 13, 2011 12:03 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
The 68000 scb is a student project of mine, i am supposed to get it working by the end of semester, and then show it to the professor. I chose the 68000 also because my roommate(mathematician) has 68000 assembly language in one of his classes, so he will be able to play with it too... As for the 65816 i had in mind a sbc for it too, but i will save the idea for later, if i build everything now, what will i do later... Also a arm based sbc would be nice...
I feel i kinda hijacked this topic a bit...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 13, 2011 12:24 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
GARTHWILSON wrote:
...AFAIK however, the 68000 is no longer in production...

OFF-TOPIC: I apologize for going way off topic myself, but I had to post for anyone else interested besides myself: Freescale seems to be still making the MC68SEC000. You can get them from Digikey, although Avnet has a huge stock of all variations of MC68000. Also, Avnet has MC68EC040, stocked in EU - only businesses can buy here in the US. Also, the MC68LC060 for $466ea, min QTY 10. :lol:
The EU can buy 68020, 68030, and 68040...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 13, 2011 12:40 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
ElEctric_EyE wrote:
GARTHWILSON wrote:
...AFAIK however, the 68000 is no longer in production...

OFF-TOPIC: I apologize for going way off topic myself, but I had to post for anyone else interested besides myself: Freescale seems to be still making the MC68SEC000. You can get them from Digikey, although Avnet has a huge stock of all variations of MC68000. Also, Avnet has MC68EC040, stocked in EU - only businesses can buy here in the US. Also, the MC68LC060 for $466ea, min QTY 10. :lol:
The EU can buy 68020, 68030, and 68040...

OFF-TOPIC: I found the 68000 on ebay and i also bought the fpu and dma chip, i think that at Unicorn electronics they have the 68000 too...


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

All times are UTC


Who is online

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