6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 4:30 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Dec 02, 2015 7:37 pm 
Offline
User avatar

Joined: Mon May 04, 2015 10:55 am
Posts: 26
Location: UK
This is my first time designing and building a SBC. I originally intended to build this project over the Summer so that I could mention it in my university application, but I didn't have the time to actually start construction up until recently.

My eventual goal for this project is to write a CHIP-8 emulator that can play games on a 128x64 graphical LCD.

Currently, the hardware consists of:
- R65C02P4 CPU
- 128K SRAM (32K addressable)
- 128K EEPROM (16K addressable)
- R65C22P4 VIA
- MC86B50 UART

This is the current state of the project: (sorry for poor image quality)
Attachment:
IMG_0004.JPG
IMG_0004.JPG [ 371.73 KiB | Viewed 1058 times ]

Attachment:
IMG_0005.JPG
IMG_0005.JPG [ 247.98 KiB | Viewed 1058 times ]

So far I have the ROM, RAM, VIA and a 20x4 character LCD working. At first, I spent ages trying to diagnose a hardware issue, but It turned out to be just a software error - I had my address byte-order wrong! The clock signal is currently being generated by an arduino, but only because I'm waiting for an oscillator to be delivered. Since WW sockets are fairly hard to come by, I decided to solder SIL headers to the front of the PCB instead, which seems to be working fine so far. You may have noticed sockets for a ZX Spectrum keyboard, which I hope to wire up soon. When the project is finished, I'll probably house it inside the Spectrum's case, although I might 3D print one.

I have a couple of questions:
- Despite what the datasheet says, is the 68B50 likely to run off a 4MHz clock if I put it in ÷16 mode?
- Is implementing memory paging as simple as connecting the spare address lines to an output port on the VIA?

Also, I would like to thank Garth Wilson for his excellent 6502 primer, which I probably wouldn't have managed without.

P.S. Should I have put this in the Newbies' section?


Last edited by DavidBuchanan on Sun Jan 28, 2018 6:53 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 03, 2015 1:43 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
DavidBuchanan wrote:
This is my first time designing and building a SBC. I originally attended to build this project over the Summer so that I could mention it on my personal statement, but I didn't have the time to actually start construction up until recently.

Congratulations!

Quote:
- Is implementing memory paging as simple as connecting the spare address lines to an output port on the VIA?

It certainly depends on what you mean by "memory paging", because there are varying levels of sophistication. You're going to want to make some careful decisions about where in your memory map you want to page. For manual paging, the simplest method would be to limit it to a portion, like $4000 to $7fff ... that way, you wouldn't have to worry about losing and/or having to carefully maintain your zero and stack pages, or your ROM vectors. For demand paging, you would almost certainly need a lot more hardware assistance than a VIA, but the details have been lost in my foggy college memories from a few decades ago.

Quote:
Also, I would like to thank Garth Wilson for his excellent 6502 primer, which I probably wouldn't have managed without.

Garth is awesome.

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 13, 2015 12:22 am 
Offline
User avatar

Joined: Mon May 04, 2015 10:55 am
Posts: 26
Location: UK
Minor update:

The character LCD is now wired directly to the data bus, and I have added the graphical LCD:

Attachment:
IMG_0007.jpg
IMG_0007.jpg [ 123.75 KiB | Viewed 986 times ]


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 13, 2015 4:47 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
Thankyou for the compliments. There's more I would like to write about (and plenty of other things I would like to see others write about regarding the 6502 & '816 which I myself am definitely not qualified to), but I should to get back to building for a while before I take on any new writing projects. They always turn out to be a lot more work than I anticipated.

To add to what Mike said about doing banking by just adding some address lines via a VIA: If the banked range is just for data, it will probably be easier. If you have program material in other banks, going from bank to bank within that banked-memory window—say that window is address range $4000 to $7FFF like Mike's example—will require some sort of tricks like what Jeff is famous for. Otherwise, you would need to jump back to main memory, change the bank bits, then jump back into the bank window of $4000-7FFF. (Jeff or someone can set me straight if I'm forgetting something.) Changing the bank bits while you're in that window and making it work would range somewhere between difficult and impossible.

_________________
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: Sun Dec 13, 2015 8:08 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
GARTHWILSON wrote:
Changing the bank bits while you're in that window and making it work would range somewhere between difficult and impossible.

...which is why the 65C816 exists. :D

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


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 13, 2015 9:25 am 
Offline
User avatar

Joined: Mon May 04, 2015 10:55 am
Posts: 26
Location: UK
Thanks for the paging advice. To be honest, at this point I have no need for memory paging, because I can't think of any programs to write that would need more than 32k. I also plan to implement SD card storage at some point, so I don't think I'll ever run out of ROM space.

One untested idea that I just had was to use paging for simple multitasking - each task has its own page (and therefore its own stack), and the pages are switched out on a timer interrupt.


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 13, 2015 10:26 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
DavidBuchanan wrote:
Thanks for the paging advice. To be honest, at this point I have no need for memory paging, because I can't think of any programs to write that would need more than 32k.

I can think of many, many uses for a huge data space though. 32KB is an awful lot to fill with program.

Quote:
One untested idea that I just had was to use paging for simple multitasking - each task has its own page (and therefore its own stack), and the pages are switched out on a timer interrupt.

I have an article on simple methods for multitasking without a multitasking OS, for systems that lack the resources to implement a multitasking OS, or where hard realtime requirements would rule one out anyway, at http://wilsonminesco.com/multitask/ . The "Stacks potpourri" page and a couple of the other pages of the stacks treatise address matters relevant to multitasking as well.

Although each task may want its own hardware stack and ZP space, you'll probably also want some ZP space that's common to all tasks.

_________________
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  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: barrym95838, Google [Bot] and 39 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: