beginners' 6502 articles in the works

Let's talk about anything related to the 6502 microprocessor.
rwiker
Posts: 294
Joined: 03 Mar 2011

Re: beginners' 6502 articles in the works

Post by rwiker »

ElEctric_EyE wrote:
I'm definately interested in your tables Garth. Is hex straight binary? I was thinking of using them, maybe the SIN table, for doing circles in my graphics plotting routines using the 16-bit 65Org16. Things are so darn busy right now, I'm finding it difficult to spare even a few minutes a day on my projects!
For circle plotting in anything controlled by a 6502, it is probably easier to use sin'x = cos x and cos'x = -sin x directly; this gives you

x0 = r
y0 = 0

then

x1 = x0 - d * y0
y1 = y0 + d * x0

x2 = x1 - d * y1
y2 = y2 + d * x1

etc

A suitable value for d might be (surprise!) 1/256.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: beginners' 6502 articles in the works

Post by GARTHWILSON »

You're talking Cordic, right? (I am aware of it, but not knowledgeable in it.) But with the tables, taking the SIN of an angle is even faster than the single multiplication in the Cordic algorithm.
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?
rwiker
Posts: 294
Joined: 03 Mar 2011

Re: beginners' 6502 articles in the works

Post by rwiker »

GARTHWILSON wrote:
You're talking Cordic, right? (I am aware of it, but not knowledgeable in it.) But with the tables, taking the SIN of an angle is even faster than the single multiplication in the Cordic algorithm.
Nope, not cordic... it's just a simple approximative generator for sin & cos. By using dx=dy=1/256, you don't need to do multiplication or division - only subtraction and addition.
User avatar
Arlet
Posts: 2353
Joined: 16 Nov 2010
Location: Gouda, The Netherlands
Contact:

Re: beginners' 6502 articles in the works

Post by Arlet »

rwiker wrote:
x0 = r
y0 = 0

then

x1 = x0 - d * y0
y1 = y0 + d * x0

x2 = x1 - d * y1
y2 = y2 + d * x1
The disadvantage is that the values for x,y will keep getting smaller with this method, so if you plot x,y repeatedly, you get a spiral.

If you do it like this:

x = x - d * y
y = y + d * x

Then you get an ellipse instead of a spiral.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: beginners' 6502 articles in the works

Post by BigEd »

User avatar
BigDumbDinosaur
Posts: 9426
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: beginners' 6502 articles in the works

Post by BigDumbDinosaur »

BigEd wrote:
Y'all got my head spinning! :lol:
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: beginners' 6502 articles in the works

Post by GARTHWILSON »

I added another page to the 6502 primer. It starts with a whole-computer schematic of a really basic 6502 computer, then after that it's mostly circuits to interface real-world stuff to the computer-- hence the name, "circuit potpourri." I have more to add, but I'm going to take a little break before continuing.
http://wilsonminesco.com/6502primer/potpourri.html

What's there so far:
  • First: a very basic whole-computer schematic
  • Connecting I/O devices
    • Using the 6522's shift register for tons of output bits
    • Using the 6522's shift register for tons of input bits
    • Using the 6522's shift register for both input and output
    • SS22: Using the 6522's shift register for a link between computers
    • Converting to and from higher-voltage logic
    • driving 12V relay coils
    • High-voltage shift registers
    • Interfacing to I²C
    • Keypads and keyboards
    • Displays
    • Printers
    • Digital-to-analog (D/A) converters, or DACs
    • Digital potentiometer
    • Analog-to-digital (A/D) converters, or ADCs
    • A note about A/D and D/A jitter (and other performance considerations)
    • Jeff Laughton's circuit tricks, for ultra-fast I/O (single-cycle!), and re-mapping op codes
    • Non-typical power-supply circuits run by the 6522 and digital components
Several circuits have accompanying 65c02 assembly driver code, either inline or linked in a separate .asm file.
Last edited by GARTHWILSON on Mon Dec 22, 2014 10:14 am, edited 1 time in total.
Reason: added two more sub-sections to the circuit potpourri page
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?
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: beginners' 6502 articles in the works

Post by GARTHWILSON »

6502 gets another promotion! My site is featured as "website of the day" at http://www.eeweb.com/, a professional engineers' resource website, about 2/3 of the way down, in the middle column.
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?
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: beginners' 6502 articles in the works

Post by BigEd »

Well done! Should we prepare to welcome some new members?
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Re: beginners' 6502 articles in the works

Post by ElEctric_EyE »

GARTHWILSON wrote:
6502 get another promotion! My site is featured as "website of the day" at http://www.eeweb.com/, a professional engineers' resource website, about 2/3 of the way down, in the middle column.
Nice Garth!
User avatar
BigDumbDinosaur
Posts: 9426
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: beginners' 6502 articles in the works

Post by BigDumbDinosaur »

GARTHWILSON wrote:
6502 gets another promotion! My site is featured as "website of the day" at http://www.eeweb.com/, a professional engineers' resource website, about 2/3 of the way down, in the middle column.
That, and the article mentions that the 6502 continues to be produced in high volume.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
mkarcz
Posts: 31
Joined: 04 Jan 2012
Location: Florida
Contact:

Re: beginners' 6502 articles in the works

Post by mkarcz »

Congratulations are in order.
Marek Karcz
---
"Don't worry. We've got our best people working on it."
Post Reply