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

All times are UTC




Post new topic Reply to topic  [ 72 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
PostPosted: Mon Jun 25, 2012 8:38 am 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 279
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 25, 2012 8:59 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 25, 2012 2:30 pm 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 279
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 25, 2012 4:46 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 25, 2012 5:09 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
We're going in circles!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 25, 2012 5:45 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8230
Location: Midwestern USA
BigEd wrote:

Y'all got my head spinning! :lol:

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 30, 2012 9:25 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
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.

_________________
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?


Last edited by GARTHWILSON on Mon Dec 22, 2014 10:14 am, edited 1 time in total.
added two more sub-sections to the circuit potpourri page


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 06, 2014 9:54 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 06, 2014 10:04 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Well done! Should we prepare to welcome some new members?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 06, 2014 11:48 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
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!

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 07, 2014 3:28 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8230
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 07, 2014 4:02 am 
Offline
User avatar

Joined: Wed Jan 04, 2012 4:28 am
Posts: 31
Location: Florida
Congratulations are in order.

_________________
Marek Karcz
---
"Don't worry. We've got our best people working on it."


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

All times are UTC


Who is online

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