6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Jun 25, 2024 5:58 am

All times are UTC




Post new topic Reply to topic  [ 72 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Sat Apr 28, 2012 8:25 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Garth - good work! You've pulled together lots of useful experience and references there.

Dajgoro - Jeff Tranter wrote a couple of articles about cc65 bringup on his replica1 recently which might help you.

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 28, 2012 2:05 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1014
Location: near Heidelberg, Germany
Very good article indeed.

In the address decoding page, you could probably add a timing diagram with phi2, address lines and
how the setup times etc add up (what you now explain in words).

Is it not normally the capital Phi letter? You're using the lower case phi letter, which looks
strange to me. In fact in your diagram it indeed is the capital phi.

anecdotal evidence: that the VIA needs CS before Phi2 is the reason it does not work out of the
box on the C64, where the address bus is shared with the video chip (using phi1). So you had to
delay the rising edge of phi2 a bit.

On the memory map page you start using 6502 opcodes, but knowing them is not a prerequisite.
Ok, maybe be implicit because why build a 6502 computer without knowing it...
Maybe a kind of side box explaining say that :'"STA" means "STore Accumulator", storing the
general purpose accumulator register to a memory address given by the addressing mode', or
what "LDX" and "TSX" mean. Would introduce some of the basics in a simple way, for those
that just "walk by"

On 74xx timing, for example a Philipps 74ALS138 has 22ns max prop. delay - twice as fast as 'LS.

On the mistery pins: the /SO pin was used in the commodore floppies (VC1541 and relatives, not
the older PET drives though) to check if a byte was ready to be read from the input shift registers,
resp. when it was ready to put another byte on the output shift register. Here is an excerpt from
the VC1541 ROM. Note the BVC at $F4D4

; read sector

F4D1 20 0A F5 JSR $F50A
F4D4 50 FE BVC $F4D4
F4D6 B8 CLV
F4D7 AD 01 1C LDA $1C01
F4DA 91 30 STA ($30),Y
F4DC C8 INY
F4DD D0 F5 BNE $F4D4

On the wirewrap page you may want to (and are hereby allowed to :-) show the picture I
give on this page: http://www.6502.org/users/andre/csa/vdc/index.html with a comparison
of the very first version of my video card (as not to do it) and how it compares to
today's custom-made board. It DID work though!

In the I/O ICs you could mention that it's pretty easy to even add intel-like I/O ICs like
the 16550 UART by creating /RD and /WR from Phi2 and R/-W. Also Intel-compatible Ethernet
chips have been connected directly to the 6502 bus, as well as USB ICs, for example here
http://www.6502.org/users/andre/csa/usb/index.html (shameless self-plug :-)
And maybe a warning that the 6551 control lines are internally connected with internal state, which you might
not want, so better look at the datasheet.

For the displays, even if you would not recommend it anymore, you could mention that even the
first PCs used 6845 (compatible with 6545) based video cards and those were used in the PET
(and the Apple??) for example.

Great read! Thanks for sharing!

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 28, 2012 2:58 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
BigEd wrote:
Dajgoro - Jeff Tranter wrote a couple of articles about cc65 bringup on his replica1 recently which might help you.Ed


I was more thinking about how to set it to work with custom sbc hardware, but the tutorial explains mostly how to compile and run programs.


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 28, 2012 3:31 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
I was hoping his patch to fixup for Replica1 would shed some light on that. But I didn't investigate.


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 28, 2012 3:42 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
It does, but a tutorial would be still appreciated...


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 28, 2012 3:45 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Did you check the docs? There's a chapter on customising for a new target.

Edit: I've only used the assembler, in target=none mode.


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 28, 2012 3:52 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
Thanks, that is helpful, i looked for that lots of times, but i was unable to find it...
But anyway there could be some mention of this in this beginners tutorials...


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 28, 2012 4:17 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1696
Location: Sacramento, CA
Chris Ward also re-targeted CC65 for his system. His code can be found here:

http://www.chrisward.org.uk/6502/files/cc65-lib.zip

There are batch files that control the build process using the Windows (DOS) version of CC65.

Daryl


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 29, 2012 7:15 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
fachat wrote:
Very good article indeed.

In the address decoding page, you could probably add a timing diagram with phi2, address lines and
how the setup times etc add up (what you now explain in words).

Not a bad idea. It'll take more time than I want to put into it this weekend, at least to make it as clear as I would like, so it might have to wait.

Quote:
Is it not normally the capital Phi letter? You're using the lower case phi letter, which looks
strange to me. In fact in your diagram it indeed is the capital phi.

I don't like the font on the one that shows which is more-or-less the Times New Roman or the Gentium font. I'll change it when I figure out how. Because of my New Testament Greek study helps, I've been using the SBL Greek font, lower case, looking like a squashed-down "o" with the line going through it slanting a little. The manufacturers, often not having the Greek character set, used a capital O or a 0 with the / through it since the slash would be too far off-center in the lower-case o. Done correctly, the capital has a perfectly vertical line, and usually has serifs on the ends of it, with the ends (and the serifs) sometimes even inside the O for at least one of the fonts.

Quote:
anecdotal evidence: that the VIA needs CS before Phi2 is the reason it does not work out of the
box on the C64, where the address bus is shared with the video chip (using phi1). So you had to
delay the rising edge of phi2 a bit.

That's what I put at the bottom of http://6502.org/users/garth/projects.php?project=7 in my project pages, an I/O expansion board for the C64. I just went and added it as a comment in parentheses to the primer, although it would not be necessary for someone who's making his own 6502 computer.

Quote:
On the memory map page you start using 6502 opcodes, but knowing them is not a prerequisite.
Ok, maybe be implicit because why build a 6502 computer without knowing it...
Maybe a kind of side box explaining say that :'"STA" means "STore Accumulator", storing the
general purpose accumulator register to a memory address given by the addressing mode', or
what "LDX" and "TSX" mean. Would introduce some of the basics in a simple way, for those
that just "walk by"

The first line of the intro says, "So you've decided to build a 6502 computer-- or maybe you're still deciding. You've been looking at the 6502 instruction set and [...]" I added a note explaining anyway. There are many 6502 mnemonics throughout the set though, especially in the programming tips section.

Quote:
On 74xx timing, for example a Philipps 74ALS138 has 22ns max prop. delay - twice as fast as 'LS.

ACT is faster (12ns max from E3 to On\), but I was aiming to keep the beginning builder from the problems that the accompanying faster rise times can produce if construction is poor.

Quote:
On the mistery pins: the /SO pin was used in the commodore floppies [...]

That's the only place I've heard of it, and it's an application where math routines would not be running to be interfered with. I just added a mention of it.

Quote:
On the wirewrap page you may want to (and are hereby allowed to :-) show the picture I
give on this page: http://www.6502.org/users/andre/csa/vdc/index.html with a comparison
of the very first version of my video card (as not to do it) and how it compares to
today's custom-made board. It DID work though!

Thanks. I added it.

Quote:
In the I/O ICs you could mention that it's pretty easy to even add intel-like I/O ICs like
the 16550 UART by creating /RD and /WR from Phi2 and R/-W.

It's there, and refers to the circuit given in the "Clock Generation" section, but I moved it so it won't hide so easily.

Quote:
Also Intel-compatible Ethernet
chips have been connected directly to the 6502 bus, as well as USB ICs, for example here
http://www.6502.org/users/andre/csa/usb/index.html (shameless self-plug :-)

Very nice, but too complex for beginners. I think if I try USB, it will be with something like the Maxim MAX3421E which uses SPI.

Quote:
And maybe a warning that the 6551 control lines are internally connected with internal state, which you might
not want, so better look at the datasheet.

That's in the RS-232 primer which is linked: "The only thing I don't like about the 65c51 is that a couple of the controls are merged into the same control bit, where it would be nice to be able to control them separately instead."

Quote:
For the displays, even if you would not recommend it anymore, you could mention that even the
first PCs used 6845 (compatible with 6545) based video cards and those were used in the PET
(and the Apple??) for example.

I added a 1-line paragraph saying so, and that the Commodore 128 used the 8564.

_________________
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 Apr 29, 2012 8:52 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Hi Garth - two small comments: your home page doesn't yet link to your new work, and the head post of this thread doesn't either. Worth updating?

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 29, 2012 9:35 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
Near the bottom of my home page it says,
New (4/27/12): 6502 PRIMER: Building your own 6502 computer
I'll go put the link in the head post of the topic now.

_________________
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 Apr 29, 2012 9:52 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Oh, I see, yes. I had noticed it was on your Links page (which is also splendid) - but from the appearance of the top row on the Primer index page, I'd assumed you'd intended that top row always to be a three-part list. In other words, that the Primer was a first-class feature together with the Links. My mistake.

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 29, 2012 5:32 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8230
Location: Midwestern USA
fachat wrote:
Is it not normally the capital Phi letter? You're using the lower case phi letter, which looks
strange to me. In fact in your diagram it indeed is the capital phi.

In electrical engineering, "phase" is referred to with the Ø character. Hence I refer to PHI2 in anything I write as Ø2.

BTW, I've taken a quick look at Garth's stuff. Lots of excellent stuff to help the 6502 beginner realize success with his/her first project. Good job, Garth! :D

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


Last edited by BigDumbDinosaur on Sun Apr 29, 2012 5:55 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 29, 2012 5:48 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Capital Phi should be Φ in your HTML. Maybe this letter: Φ

See this test page - each browser will show it differently. Don't try to specify font information in HTML, that's a bad idea.

Cheers
Ed

Edit: I see BDD is using 'LATIN CAPITAL LETTER O WITH STROKE' (Ø - test page)

Edit: maybe Φ and Ø respectively will be widely supported.


Last edited by BigEd on Sun Apr 29, 2012 6:07 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 29, 2012 5:53 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8230
Location: Midwestern USA
GARTHWILSON wrote:
Near the bottom of my home page it says,
New (4/27/12): 6502 PRIMER: Building your own 6502 computer
I'll go put the link in the head post of the topic now.

I like the fact that you start your articles series with a rationale for using the 65xx family, as opposed to, say, the MC6800, or for you 16 bit enthusiasts (that would be me), the MC68000. While opinions on which microprocessor is "best" for hobby usage are often expressed with religious fervor, your rationale states good technical and practical reasons for using the 65xx family.

In a website that I am building about my SBC endeavors, I present a similar rationale, as follows:

    Why the W65C816S processor? Aren't 65xx processors obsolete?

    Good questions! I chose the W65C816S for several reasons:

      Familiarity. I have been writing assembly language programs for the 65xx family almost since its inception. Needless to say, I have a large body of accumulated knowledge that can be easily transferred to the '816. Why start from scratch with a different processor and incur a huge learning curve?

      Performance. The '816 can get a lot done as measured in wall clock time. Typically, an '816 running at 20 MHz can execute between 3 million and 10 million instructions per second (MIPS). That's very good for a design that was conceived in the early 1980s, in fact, better than most of its contemporaries. Also, interrupt latency is very low, much lower than comparable designs, such as the Motorola 68000 family. In fact, using the proper programming techniques, interrupt latency can be as low as two machine cycles.

      Adaptability. The '816 uses the same basic bus architecture as the rest of the 65xx family, which makes it "hobby-friendly" and thus highly adaptable to a variety of devices. The '816 also includes some hardware management signals that are not present on the eight bit family members. These signals can ease the complication of adapting non-65xx family peripheral silicon, as well as improve overall system stability.

      Scalability. As it has a fully static CMOS core, the performance of the '816 is in direct proportion to the phase-two (Ø2) clock rate. In fact, Ø2 can be halted in either phase and the '816 will indefinitely maintain its state.

      Reentrancy. The '816 has some special hardware stack instructions, such as LDA (1,S),Y, that facilitate the creation of fully reentrant subroutines, as well as simplified parameter passing via the stack.

      Cost. The '816 can be readily obtained from sources such as Jameco and Mouser for less than ten US dollars. Other parts, such as I/O chips and glue logic, are also inexpensive and readily available.

    As for the question of obsolescence, both the W65C02S and W65C816S are in current production and are found in numerous products, often as part of a microcontroller or other custom device. You are probably using the 'C02 or '816 every day without knowing it, as these processors are at the core of many consumer products (my microwave oven has a 65C02 in its controller). The 65xx family is even found in some medical devices, such as implantable defibrillators.

    So the Why? is Why not? and no, the 65xx family isn't at all obsolete.

Feel free to borrow anything from it that you may find useful.

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


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

All times are UTC


Who is online

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