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

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: My First Project!
PostPosted: Sun Sep 06, 2020 12:01 am 
Offline

Joined: Sat Sep 05, 2020 11:58 pm
Posts: 5
I've Begun Working on A Project with the 6502 and hope to create a working computer,
here are my current specs:
(hopefully) 8Mhz Clock
44kB of Ram
4kB of I/O Space
16kB of ROM

I'm posting here to wonder if there is anything that i'm doing wrong with my Schematic design which is necessary to fix.

Any Help welcome, Thanks!


Attachments:
Reformat.PNG
Reformat.PNG [ 45.96 KiB | Viewed 1530 times ]


Last edited by wDavies on Mon Sep 07, 2020 9:59 pm, edited 2 times in total.
Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Sun Sep 06, 2020 5:20 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
It's much harder to follow a netlist written around boxes than it is a real schematic. The main thing I see however, if I'm looking at it straight, is that there's nothing keeping RAM from being written to during the Φ2-low time. The address is not guaranteed to be valid before the R/W line goes down; so without Φ2, you could write to invalid addresses. The bug could be awfully hard to track down just from a software standpoint. You can either qualify the RAM's WR\ with Φ2, or, if the RAM is fast enough, you can simply not even select the RAM until Φ2 rises.

The other thing you'll want to change is to de-bounce the reset circuit.

These things and a lot more are discussed in the 6502 primer at http://wilsonminesco.com/6502primer/ which was written to answer a ton of questions and problems that kept coming up on the forum. It has 22 logically organized pages covering the various aspects of making your own 6502 computer and being successful. (Several of the pages could also be applied to other processors as well.)

_________________
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: My First Project!
PostPosted: Sun Sep 06, 2020 9:02 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
(Welcome, wDavies! It might be good to know where you got your inspiration from and what references you're using. Are you going for a PCB, or using breadboard, or something in between?)


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Sun Sep 06, 2020 10:45 am 
Offline

Joined: Sat Sep 05, 2020 11:58 pm
Posts: 5
BigEd wrote:
(Welcome, wDavies! It might be good to know where you got your inspiration from and what references you're using. Are you going for a PCB, or using breadboard, or something in between?)

I got my inspiration from channels like Ben Eater and 8-Bit Guy on YouTube, I'm also just very intrigued in electronics and programming and would like to make something to link the two!
I'm looking to end up with some form of PCB, although will probably test the design on a Breadboard.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Sun Sep 06, 2020 10:46 am 
Offline

Joined: Sat Sep 05, 2020 11:58 pm
Posts: 5
GARTHWILSON wrote:
It's much harder to follow a netlist written around boxes than it is a real schematic. The main thing I see however, if I'm looking at it straight, is that there's nothing keeping RAM from being written to during the Φ2-low time. The address is not guaranteed to be valid before the R/W line goes down; so without Φ2, you could write to invalid addresses. The bug could be awfully hard to track down just from a software standpoint. You can either qualify the RAM's WR\ with Φ2, or, if the RAM is fast enough, you can simply not even select the RAM until Φ2 rises.

The other thing you'll want to change is to de-bounce the reset circuit.

These things and a lot more are discussed in the 6502 primer at http://wilsonminesco.com/6502primer/ which was written to answer a ton of questions and problems that kept coming up on the forum. It has 22 logically organized pages covering the various aspects of making your own 6502 computer and being successful. (Several of the pages could also be applied to other processors as well.)


The RAM has a 17ns read time, so i'll probably just qualify WR with Phi2. Thanks for the information!

edit: i have fixed the problem and have therefore updated the schematic's photo


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Sun Sep 06, 2020 3:05 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Sounds good!


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Sun Sep 06, 2020 3:39 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
I notice your SRAM chips is 32k x 8. Anything addressed from 0x8000 to 0xAFFF will be a duplicate of addresses 0x0000 to 0x2FFF. It would be simpler to just use A15 as the CS for the SRAM to limit access to 0x000 to 0x7FFF. You could eliminate the NOR chip in that case. Use a spare NAND gate to invert A15 and feed that into 2b of the NAND to qualify the CS with PHI2.

If wiring to a breadboard, you might start with a 1 MHz clock to prove your design. Be sure to use bypass capacitors for all of your IC's, especially if you are clocking above 1 MHz.

Best wishes!

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Sun Sep 06, 2020 7:23 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8513
Location: Midwestern USA
wDavies wrote:
I've Begun Working on A Project with the 6502 and hope to create a working computer...

Could you please post the schematic in monochrome.

As for a read/write circuit, here is what I use. It works for any asynchronous hardware that has separate /RD and /WD inputs. Note that this circuit is not to be used with any 65xx peripheral hardware.

Attachment:
File comment: Read/Write Qualified with Ø2
read_write_qualify_alt.gif
read_write_qualify_alt.gif [ 46.98 KiB | Viewed 1614 times ]

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


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Sun Sep 06, 2020 11:31 pm 
Offline

Joined: Sat Sep 05, 2020 11:58 pm
Posts: 5
Thank you for all the replies, i will be sure to implement all of them into the Schematic, however i've been wondering, Would it be possible to use the Arduino Nano, or the atmega 328P as a Graphics Processor? In theory, it would be able to take characters from the CPU (after being addressed in the IO space), and an XY position and it would interface with some form of VGA driver?


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Mon Sep 07, 2020 7:20 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
wDavies wrote:
Thank you for all the replies, i will be sure to implement all of them into the Schematic, however i've been wondering, Would it be possible to use the Arduino Nano, or the atmega 328P as a Graphics Processor? In theory, it would be able to take characters from the CPU (after being addressed in the IO space), and an XY position and it would interface with some form of VGA driver?


In theory, yes. In practice yes, but its not easy.

There are many ATmega/Arduino video devices out there - including some here. Google for "Arduino TVout" for many examples.

The issue is making the ATmega and the 6502 talk. If you have serial then it's fine, but if not, then it starts to become more challenging. An ATmega running at 16Mhz might just be able to act as a register device directly to a 6502 bus running at 1Mhz. Maybe. You need to be able to reliably sample the edge of a 1Mhz clock (the 'chip select' signal that your decoding generates), then read the data directly off the data bus, but the timing is tight and you have less than 0.5µS to do it. (8 cycles on a 16Mhz ATmega)

You can decouple the timing issues using the VIA in handshake mode. You write the byte to the VIA, it generates the "strobe" signal which the ATmega is listening for, then the ATmega reads the byte, sends the 'ack' signal back to the VIA which then signals to the 6502 side that it can send another byte. You can then invent your own protocol for sending bytes over, however the speed that the ATmega will be governed by the spare CPU cycles it has left over from 'racing the beam' to generate the video signal.

Making the ATmega generate characters is not hard, making it generate graphics is harder. I put together a system (Atmega12804p) to generate a 320x240x1 display for my early 6502 systems but later abandoned that idea - mostly because generating that video signal (and this was PAL composite video, not VGA) required between 60 and 70% of all cycles that the ATmega had and I had other uses for it. (Like serial and SD card access)

This: https://www.youtube.com/watch?v=09zhGUbVxdU is a quick demo of that ATmega system. (There was no 6502 at that point)

If you want VGA, then Quinn Dunki's Veronica project is a good read: http://quinndunki.com/blondihacks/?page_id=1761 She uses n ATmega with external RAM to implement a low resolution VGA system. It's very tight AVR assembler though.

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Mon Sep 07, 2020 8:08 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
I would strongly caution against feature creep, especially on a first project. You (probably) don't yet know what you don't know, about building and debugging, so keep the first machine as simple as possible, and get it working. You can follow on with more sophisticated designs - there's lots of headroom - but if you get bogged down in an over-ambitious first build that might be the end of your interest, or turn an interesting journey into a slog.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Mon Sep 07, 2020 8:39 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
BigEd wrote:
I would strongly caution against feature creep, especially on a first project. You (probably) don't yet know what you don't know, about building and debugging, so keep the first machine as simple as possible, and get it working. You can follow on with more sophisticated designs - there's lots of headroom - but if you get bogged down in an over-ambitious first build that might be the end of your interest, or turn an interesting journey into a slog.


Wise words!

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Mon Sep 07, 2020 3:52 pm 
Offline

Joined: Sat Sep 05, 2020 11:58 pm
Posts: 5
I have decided that i will leave out VGA for my first project, and will instead use something like Serial to interface to a program like PuTTY on a computer and then use that as a pseudo-display, does anyone have any recommendations on how to achieve this goal


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Fri Sep 11, 2020 7:41 pm 
Offline

Joined: Sun May 13, 2018 5:49 pm
Posts: 255
wDavies wrote:
Serial to interface to a program like PuTTY on a computer and then use that as a pseudo-display, does anyone have any recommendations on how to achieve this goal
I'd highly recommend taking Garth up on his suggestion to read his excellent primer at http://wilsonminesco.com/6502primer/. It has everything you will need to know and then some. You will find information on serial interfacing in section 14 (labeled "I/O ICs").

I suspect you will also be interested in sections 2 (Address Decoding), 7 (Reset Circuits), and I recommend checking out 17 (General Steps for A Successful Project) for a nice listing of the decisions you will need to make and the general order to approach the tasks you will want to complete so that you don't get overwhelmed.

You may also want to look at other people's projects. This will show you how others have solved various issues from reset circuits to address decoding to memory maps. You're welcome to look at my 65C02 based computer at https://github.com/SamCoVT/SBC and you'll find many others on 6502.org and here in the forums.

If you get stuck or would like some advice on a decision you are trying to make, feel free to come back and ask (beware that you may get several different answers, but usually all of them are helpful). When posting schematics, make sure to convert them to black and white first.

To directly answer your question, I used a 65C51 ACIA (Asynchronous Communications Interface Adapter) for serial and designed my board to accept a FTDI USB to 5V TTL-level serial cable. There is a bug in the WDC version of this chip (with several possible software fixes discussed in Garth's primer, of course). I avoided this on my 65C02 design by purchasing an older Rockwell brand 65C51 instead.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Project!
PostPosted: Fri Sep 11, 2020 8:00 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
wDavies wrote:
I have decided that i will leave out VGA for my first project, and will instead use something like Serial to interface to a program like PuTTY on a computer and then use that as a pseudo-display, does anyone have any recommendations on how to achieve this goal


This is how my Ruby 6502 and '816 systems work. I have code in the 6502 side to send out text and data using a well defined set of codes, so I can move the cursor, clear screen and so on. Then there is a 'shim' bit of code inside an ATmega which translates these codes into ANSI terminal codes and from there into minicom or putty. (or a real serial terminal - the ATmega is a "host" processor in my system providing serial port, filing system and a few other minor things.

OR rather than use minicom/putty, I also wrote my own terminal program that's capable of graphics - in this case, the ATmega just passes the codes through unchanged. (I've recently switched from minicom to putty as I think it's ANSI emulation is better)

The "well defined set of codes" on the 6502 side are identical to the codes used in the BBC Micro VDU system rather than just starting with ANSI codes - that way I can run BBC Basic on my systems as well as other applications that might run on a Beeb and have all the graphics and cursor control available without changes.

Demo to my graphics terminal (which is written in C and uses SDL): https://www.youtube.com/watch?v=rPGCT0lah4Q

and to a real serial terminal: https://www.youtube.com/watch?v=Bg-DcjrJ8g0

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


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

All times are UTC


Who is online

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