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.
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.
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.
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
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.
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.
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.