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

All times are UTC




Post new topic Reply to topic  [ 128 posts ]  Go to page 1, 2, 3, 4, 5 ... 9  Next
Author Message
PostPosted: Wed Dec 05, 2018 8:00 pm 
Offline

Joined: Wed Dec 05, 2018 7:52 pm
Posts: 48
Hi Guys,

First of all I apologize if the question that I will ask is very simple. I'm working on a personal project to assemble a 6502 PC.

The question is: I currently use the EEPROM AT28C256 directly connected to the 6502 processor. Is it addressing from 0x00000 to 0x07FFF correct?

How do I have 6502 read the FFFC and FFFD reset vectors?

My code is:

kernel.cfg
Quote:
MEMORY
{
ROM: start=$8000, size=$8000, type=ro, define=yes, fill=yes, file=%O;
}

SEGMENTS
{
CODE: load=ROM, type=ro;
VECTORS: load=ROM, type=ro, offset=$7ffa;
}


kernel.s
Code:
          .setcpu "6502"
          .segment "VECTORS"

          .word   loop
          .word   loop
          .word   loop

          .code
loop:     lda #$12
          jmp loop


I asked for help .. I already researched in several sources and I can not :-(

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 05, 2018 8:22 pm 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Welcome.

The 32KB EEPROM's addresses will be 0000-$7FFF, but they will show up in the range of $8000-$FFFF of the processor.

The 6502 primer should have everything you need to know.

_________________
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: Wed Dec 05, 2018 11:59 pm 
Offline

Joined: Wed Dec 05, 2018 7:52 pm
Posts: 48
Hi GARTHWILSON,

Thanks for the reply and the link. I had read enough of him but I will reread more closely.

But to be clear, I mean then when I set:

Quote:
ROM: start=$8000, size=$8000, type=ro, define=yes, fill=yes, file=%O;


does the processor read the 0x0000 as if it were 0x8000? Following this logic, 7FFC and 7FFD will be the reset vectors?


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 12:08 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
If I understand you correctly, yes, you have it right. Various programmers' software and commands will work differently regarding things like how to tell them the offset; but as long as you end up with the right thing in the EEPROM, the target computer won't care how you got there. I'm not familiar with your particular programmer, so I don't know what the "type=ro, define=yes, fill=yes, file=%O;" part means.

_________________
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: Thu Dec 06, 2018 12:26 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
hitlp wrote:
does the processor read the 0x0000 as if it were 0x8000? Following this logic, 7FFC and 7FFD will be the reset vectors?

Yes. The processor has 16 address lines (A15-A0), and this means there are 65,636 (or 64K) possible addresses it can output.

The EEPROM has only 15 address lines (A14-A0), yielding 32K possible addresses. A15 (the sixteenth address line) from the processor is something the EEPROM and its programming software have no knowledge of. They think 32K is the entire universe! :P But your wiring should be such that this 32K starts at $8000 from the processor's POV.

Be sure to read Garth's primer. If you still have questions about your own project, it'll help if you post a schematic so we can refer to the actual wiring without guessing. (Photos are always nice, of course, and they can also be helpful.)

cheers (and welcome!),
Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 2:39 am 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
It sounds like you have built a prototype. Can you share the schematic you are working with and how you wish to map the memory into the 64K address space of the 6502?

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 6:43 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
Dr Jefyll wrote:
The EEPROM has only 15 address lines (A14-A0), yielding 32K possible addresses. A15 (the sixteenth address line) from the processor is something the EEPROM and its programming software have no knowledge of. They think 32K is the entire universe! :P But your wiring should be such that this 32K starts at $8000 from the processor's POV.


Even though the EEPROM has only 15 lines, if you don't handle the 16th bit (i.e. just wire up the EEPROM to A0-A14), then the entirety of your computers memory will a) be duplicated, half below $8000 and half above, and, b) will be entirely EEPROM, which can not work -- it needs 0000-01FF at a minimum as RAM.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 12:14 pm 
Offline

Joined: Wed Dec 05, 2018 7:52 pm
Posts: 48
Dr Jefyll wrote:
Even though the EEPROM has only 15 lines, if you don't handle the 16th bit (i.e. just wire up the EEPROM to A0-A14), then the entirety of your computers memory will a) be duplicated, half below $8000 and half above, and, b) will be entirely EEPROM, which can not work -- it needs 0000-01FF at a minimum as RAM.


This is the point I did not understand. How is half the memory divided? In my project:

-> I connected A0-A14 (from the processor) to the A0-A14 of the AT28C256;
-> The A15 of the processor is off;
-> WE is on VCC;
-> CE is on GND;
-> OE is on GND;

I know that I have to study more, but anyway thanks for the answers. :-)


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 1:33 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
One common arrangement -- a typical system -- is when the processor sees RAM in the bottom 32K and ROM (or EPROM or EEPROM) in the top 32K.

A0-A14 (from the processor) would attach to A0-A14 of both the RAM and the ROM. And somehow (there are various ways of arranging this) A15 of the processor would, when low, activate the RAM (via its CE, OE and WE). Likewise, when A15 is high it would be ROM that gets activated instead.

Thus the RAM (whose own internal universe is just 32K) is only active when the processor outputs addresses 0 to $7FFF -- ie, addresses with A15 = 0. The ROM (also with an internal universe of only 32K) is active only when the processor outputs addresses $8000 to $FFFF -- ie, addresses with A15 = 1.

Your present arrangement lacks any connection from A15, and the ROM (because its CE and OE are always low) is active whether A15 is high or low. IOW, when the processor asks for the lower 32K it gets ROM, and when it asks for the upper 32K it gets ROM. The ROM is active in both cases.

In this configuration you'll be able to do certain limited tests. For example, your loop should work. But it won't be long before you'll want some RAM (and I/O) attached! :)
Code:
loop:     lda #$12
          jmp loop

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 3:55 pm 
Offline

Joined: Wed Dec 05, 2018 7:52 pm
Posts: 48
Dr Jefyll, wow you blowed my mind now! lol

I think that I've got now. Thanks guys! You are amazing.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 5:10 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Glad I could help. ( Golly! :shock: )

Speaking of limited tests, another one that's quite useful is to fill the ROM entirely with $EA or similar (and still with the present arrangement of ROM occupying the entire address space). This simulates the action of a so-called NOP generator, documented elsewhere on this forum (just do a search). It's a good way of verifying your existing hardware before you try adding RAM and I/O.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 7:44 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
As was said, since the EEPROM is always enabled, and nothing is done with A15, here's what the computer sees.

Given the addresses $2000 and $A000.

In binary, they look like this:
Code:
$2000  0010 0000 0000 0000
$A000  1010 0000 0000 0000

You can see if you remove the most significant bit (A15), they both become:
Code:
X010 0000 0000 0000

Which makes them identical. Both CPU addresses reference the same point in the EEPROM.

So, were you to use the CPU to "dump" the entirety of the 64K space, you'd find that the ranges $0000-$7FFF and $8000-$FFFF have identical contents.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 8:00 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
Dr Jefyll wrote:
( Golly! :shock: )

That word always seems out of place to me, but it still makes me smile, because it reminds me of those two awesome black guys from the movie Airplane:

https://youtu.be/RrZlWw8Di10

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 8:06 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
barrym95838 wrote:
Dr Jefyll wrote:
( Golly! :shock: )

That word always seems out of place to me, but it still makes me smile, because it reminds me of those two awesome black guys from the movie Airplane:

https://youtu.be/RrZlWw8Di10



LOL.

Greatest comedy of all time. I've seen it so many times that I can quote almost the entire movie.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2018 12:24 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
cbmeeks wrote:
barrym95838 wrote:
Dr Jefyll wrote:
( Golly! :shock: )

That word always seems out of place to me, but it still makes me smile, because it reminds me of those two awesome black guys from the movie Airplane:

https://youtu.be/RrZlWw8Di10



LOL.

Greatest comedy of all time. I've seen it so many times that I can quote almost the entire movie.


If you love Airplane, you must watch Zero Hour, the movie that it's a remake of.

Folks think that Airplane is just a spoof on the genre of Airport movies. And while there's some truth to that, it's actually a solid scene for scene, same story, same dialog remake of the movie Zero Hour. (FYI, if you haven't seen the actual movie 'Airport', it's really good! The sequels get a bit more and more over the top, but the original is really good. I do have a soft spot for Airport '75 though.)

Trying to watch the original Zero Hour without busting out laughing is quite difficult.

TCM once ran them back to back. It was fabulous.


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

All times are UTC


Who is online

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