6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Jul 03, 2024 3:02 am

All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Nov 16, 2011 9:54 am 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 48
Hi guys!

My name is Johan Fransson, living in Sweden. I am a 35-year old engineer working with software development. Since my early teens I have always been interested in computers and also computer music. As for 8-bit technology, I have owned a Commodore 64 on which I created some programs but mostly used it to listen to SID music :)

Years have gone by and I have developed my musical interest, creating stuff on my own using various sequencer software. Also during the last 5-10 years I have become interested in photography (mostly people).

The 8-bit nostalgia has struck me in a hard way the last couple of years. Not only is my music getting more and more SID-like sounds, but I recently found out via a friend about the advancement in microcontroller technology and the community around it. I ordered an Arduino and Gameduino and some Sparkfun parts to create an retro arcade style game. It takes some time and a lot of programming, but the project progresses.

So I accidentally stumbled upon this forum a few months ago and saw the light. I couldn't believe it. There is actually a community about regular microprocessors, not just microcontrollers. Finally, a possibility to fulfil an old dream; build my own computer! I have lurked about for some time and realized the amount of knowledge here and for that I salute you guys! It seems it will not be impossible to build something from scratch with this kind of community.

So here I am. I have a WDC 65C02, a WDC 65C22, some RAM and EEPROM and other logic and a big breadboard on order. I am planning on building something simple, firstly with some leds and maybe a button, then maybe later on trying to use the timer in the 65C22 for sound.

Once again, thanks for a great forum, and hopefully I will be able to contribute in the future :) For now, I will probably just be the new guy asking questions :)

EDIT: It was supposed to go in the "Introduce yourself" thread. Sorry about this :(


Last edited by JohanFr on Tue Dec 06, 2011 1:20 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 10:03 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8462
Location: Southern California
Welcome! I can't believe it has already been 11 years, but I posted a lot of tips at viewtopic.php?t=342 . What made me think of it was your saying, "then maybe later on trying to use the timer in the 65C22 for sound," and that you can use one of the modes of the 65C22's synchronous serial port for a 9-level D/A converter which is definitely enough for intelligible speech, DTMF, and other sounds. If you budget the resources well, you can do a ton of things, simultaneously, with a single 65C22.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 10:43 am 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 48
Thanks Garth, excellent tips in one thread. As a novice designer, I really don't know what hurdles I might encounter. I really liked the idea about the shift register. In terms of sound, I was reading the 6522 spec and the timer seemed like a simple way to create pulsewidthmodulated audio with almost no constraint on the CPU. For this project, in the end, I want to create a complete a computer as possible, even if it is super low res and with super simple I/O. SD cards, SPI, OLEDs etc, but those are topics for when I have been able to get a simple LED lit :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 10:55 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8462
Location: Southern California
The pulse-width-modulation scheme the data books talk about is for very low frequency work.

Lighting an LED will only take a few instructions after reset, something like:
Code:
      LDA  #80H      ; Set bit 7 of port B
      STA  VIA_DDRB  ; to be an output, then
      STA  VIA_PB    ; write a 1 to that bit of the port.

if the LED goes from the port pin to ground through a resistor.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 4:24 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Welcome!
I would suggest copy your first post and paste it in the the Introductions section. That way your intro won't get 'buried' from all the future posts in this section.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 4:39 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 48
Thanks guys. I have reposted it in the proper section. Can't wait to start assembling and then write some 6502 code :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 7:10 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8462
Location: Southern California
That's fine to copy your original post to the "Introduce yourself" topic, but let's keep that truly as introductions and not clutter it with discussion about things like how to accomplish projects.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 7:45 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 48
Got it, let's keep that thread clean. I might as well rant some more here as I started this thread :)

I want to start small, then expand. I have been looking at "Adam's Great 6502 projects" http://www.reocities.com/SiliconValley/2072/6502prj1.htm and it seems like an excellent starting point and base for my project.

I have an idea how to squeeze 32 kilobyte SRAM, 16 kilobyte EEPROM (the two are actually 128 kilobyte and 32 kilobyte respectively but are not completely utilized in order to keep address decoding simple), four I/O chips using fairly simple scheme with a dual 2-4 decoder (74139) and an IC containing three 3-ANDs (7411)... But, this is all on paper (actual, physical paper), and as I am new to it all, I will probably start much smaller, i.e. first just connect the EEPROM to the 2-4 decoder to be able to boot the system up. Alternatively, I can use the simple memory decoding scheme suggested in Garth's tip of the day link posted above.

I was thinking of creating an Atmel/Arduino-based EEPROM-burner to create the BIOS. Not really feeling like manually program the EEPROM :). Not sure if this is the best way to do it (or if it is overkill) but it seems rather straight forward and easy to do. Also, I am already familiar with the Atmel environment. I made a simple sketch in google docs, https://docs.google.com/drawings/d/1rSywd9sTdXWvoMCBAkXrPI95eZ-DyuT_-8-n54SWTqU/edit

This is for 8K so for 16/32K there will need to be some additions (another counter or something).

Plans for graphics output of the system are fuzzy. Do you think a reoccurring refresh interrupt on the 6502 and a couple of 6522's would be able to drive an 8x8 RGB LED-matrix, possibly with a higher colordepth than on/off (i.e. time slicing on/off the intensity level) ? I think you would need 32 pins (R,G,B times the number of rows + the number of columns), but maybe one could get away with fewer with some simple glue logic (counters/demuxers). Or will the refresh rate required simply take 100% of the CPU, leaving nothing for actual programs? Maybe a better route would be an OLED with a preattached control interface. As you can see, this part is not really thought through.

For input I would ultimately want a keyboard. If it is supposed to be a computer, I want it to be one :)


Last edited by JohanFr on Wed Nov 16, 2011 8:23 pm, edited 4 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 8:02 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 48
Found my notes on address decoding:

cpu A14 -> demux1 A0
cpu A15 -> demux1 A1
cpu A12 -> demux2 A0
cpu A13 -> demux2 A1
demux1 /Y0 -> and1(1)
demux1 /Y1 -> and1(2)
demux1 /Y2 -> demux2 /CS
demux1 /Y3 -> and2(1)
+5V -> and1(3)
+5V -> and2(2)
+5V -> and2(3)
and1 -> SRAM /CS
and2 -> EEPROM /CS
demux2 /y0 -> ??? /CS
demux2 /y1 -> ??? /CS
demux2 /y2 -> ??? /CS
demux2 /y3 -> VIA1 /CS

All the +5V and ANDs might seem strange. I thought it would be a good idea to have similar number of components in the paths to get the same propagation delays for the EEPROM/SRAM/I/O, but maybe that is not important? In that case, it can be somewhat optimized.

If I have calculated correctly, this would give me:

RAM $0000-$7FFF
I/O1 $8000-$8FFF
I/O2 $9000-$9FFF
I/O3 $A000-$AFFF
I/O4 $B000-$BFFF
ROM $C000-$FFFF

But again, it seems fairly simple on paper. Maybe too complex in reality?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 8:30 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 48
GARTHWILSON wrote:
The pulse-width-modulation scheme the data books talk about is for very low frequency work.

Lighting an LED will only take a few instructions after reset, something like:
Code:
      LDA  #80H      ; Set bit 7 of port B
      STA  VIA_DDRB  ; to be an output, then
      STA  VIA_PB    ; write a 1 to that bit of the port.

if the LED goes from the port pin to ground through a resistor.


Exactly why I want to start with this, thanks. Being a novice at connecting actual things together, this would be a simple way to prove that everything works, then go from there with more software and more sophisticated I/O.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 16, 2011 9:11 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8462
Location: Southern California
About your address decoding:  Demultiplexers are kind of slow in propagation delays.  Also, beginners tend to make address decoding much more complex than it needs to be.  My workbench computer (the pictures at the link are quite outdated, since I have added a lot since then) has a simple address-decoding scheme that can be done with a single 74xx00, and allows 32KB ROM, 16KB RAM, and up to 10 I/O ICs (although I'm only using 6: 3 65c22's and 3 65c51's).  With a small change, you could have 16KB of ROM and 32KB of RAM, plus again 10 I/O ICs.

Edit: Actually, I covered this in my Tips column.  It's several pages, so be sure you keep going after page 1.  There's stuff there on debugging, construction, I/O, and other things too.

Edit again, many years later:  My 6502 primer (which is a major section of my website) has a page on address decoding, and this scheme is shown in the basic whole-computer schematic at the top of the primer's circuit potpourri page.  My 6502 workbench computer mentioned above, which uses this scheme, is much better documented at http://wilsonminesco.com/BenchCPU/ .

_________________
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: Wed Nov 16, 2011 9:34 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 48
GARTHWILSON wrote:
About your address decoding: demultiplexers are kind of slow in propagation delays. Also, beginners tend to make it much more complex than it needs to be. My workbench computer (the pictures at the link are quite outdated, since I have added a lot since then) has a simple address-decoding scheme that can be done with a single 74xx00, and allows 32KB ROM, 16KB RAM, and up to 10 I/O ICs (although I'm only using 6, 3 65c22's and 3 65c51's). With a small change, you could have 16KB of ROM and 32KB of RAM, plus again 10 I/O ICs.

Edit: Actually, I think I covered this in my Tips column linked earlier. It's several pages, so be sure you keep going after page 1. There's stuff there on debugging, construction, I/O, and other things too.


I glanced at the specifications of the decoder and it didn't seem that much worse than the NAND/AND. But granted, I am new to reading specs so I'll take your word for it.

I see it now. Your scheme is kind of brilliant, and much better than what I had in mind!

Sorry if I skip ahead, I have no one at work to talk to about my ideas about so I get overexcited ;) I will take some time to read your thread thoroughly.


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

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
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...


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

Joined: Thu May 28, 2009 9:46 pm
Posts: 8239
Location: Midwestern USA
GARTHWILSON wrote:
About your address decoding: demultiplexers are kind of slow in propagation delays.

It depends. A 74F138 has a typical prop delay of 6ns, according to the TI data sheet. 74ABT gates are down to 2-3ns in most cases. If your address decoding logic isn't too complicated you'll get performance well above what we would normally require in our home-brew circuits. I can run the POC unit at 12.5 MHz, and it has 74AC logic.

Quote:
Also, beginners tend to make it much more complex than it needs to be.

Yeppers. Get that single engine plane flying before you start designing the four engine jumbo jet. :D

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 17, 2011 8:58 am 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 48
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 :) Still, I like plans of grand designs in theory. It's fun theorizing. But my head is far ahead of my actual design skills so what you guys are saying regarding a simple addressing scheme etc makes perfect sense to me.

I made a quick attempt at modifying the simple addressing scheme to support 32KB RAM and 16 KB ROM (just for the fun of it; for starters, it doesn't really matter which is 16 KB and which is 32 KB). The Alliance AS6C1008-55PCN 128 KB SRAM has one active-high CE2 and one active-low /CE:

Modified version of Garth's Address decoding:
/A15 = NOT A15
/Phi2 = NOT Phi2
SRAM CS2 = A15
SRAM /CS = /Phi2
SRAM /OE = GND
EEPROM /CS = A15 NAND A14
I/Ox /CS2 = /A15 NAND A14
I/Ox CS1 = Ax+3, x = (1..10)


Oh, and one question. While lurking a few weeks ago I found a post recommending what chip technology to use for new designs. It said something about "rather than LS or HC, choose... in that order". I have searched but I can't seem to find it. As I ordered the glue logic, I vaguely recalled that "ACT" was the technology of choice, so that's what I chose in my order. But now I'm thinking I might have remembered it wrong. Do you guys remember which thread I mean or maybe can point me in the right direction here. Or maybe it doesn't matter much, as long as we're talking < 4 MHz systems.... ? As you can see, still behind on my digital technology skills, but here to learn right? :)

Thanks again guys.


Last edited by JohanFr on Thu Nov 17, 2011 9:14 am, edited 1 time in total.

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

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: