Page 5 of 5
Re: beginners' 6502 articles in the works
Posted: Mon Jun 25, 2012 8:38 am
by rwiker
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.
Re: beginners' 6502 articles in the works
Posted: Mon Jun 25, 2012 8:59 am
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.
Re: beginners' 6502 articles in the works
Posted: Mon Jun 25, 2012 2:30 pm
by rwiker
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.
Re: beginners' 6502 articles in the works
Posted: Mon Jun 25, 2012 4:46 pm
by Arlet
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.
Re: beginners' 6502 articles in the works
Posted: Mon Jun 25, 2012 5:09 pm
by BigEd
Re: beginners' 6502 articles in the works
Posted: Mon Jun 25, 2012 5:45 pm
by BigDumbDinosaur
Y'all got my head spinning!

Re: beginners' 6502 articles in the works
Posted: Fri Nov 30, 2012 9:25 pm
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.
Re: beginners' 6502 articles in the works
Posted: Fri Jun 06, 2014 9:54 pm
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.
Re: beginners' 6502 articles in the works
Posted: Fri Jun 06, 2014 10:04 pm
by BigEd
Well done! Should we prepare to welcome some new members?
Re: beginners' 6502 articles in the works
Posted: Fri Jun 06, 2014 11:48 pm
by ElEctric_EyE
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!
Re: beginners' 6502 articles in the works
Posted: Sat Jun 07, 2014 3:28 am
by BigDumbDinosaur
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.
Re: beginners' 6502 articles in the works
Posted: Sat Jun 07, 2014 4:02 am
by mkarcz
Congratulations are in order.