Question About Sine Table
lardom
Posts: 1,659
in Propeller 1
The sine table in main ROM goes from $E000 to $F001. There are 2,049 16-bit samples in that memory block. I guess that means there are 4,098, or 4097, 32-bit registers. Does that mean sine samples repeat every two longs?
Comments
I wrote some test Spin code that displayed 4 digit integer sine values from 0° to 90°. The results were close enough but a lot still wasn't clear to me.
I'll order a DAC and see if I can produce a sine wave.
I thought you found "MathTestSine" in that thread but I suppose it's also possible to have found it on my GitHub.
BTW, I'm glad you found the program helpful.
The attached tutorial program in Spin produces a 1Hz sine and suggests outputting it to an LED see the pulsations.
Below is the table lookup method. You can see that a full circle is 13 bits, and the top two point to quadrants 0--3. The lower 11 bits get shifted one place left in order to point to a word address in the sine table. The address at $F001 helps to tie the ends together as it transitions into quadrants 1 and 3.
@"Tracy Allen" All four quadrants using duty mode with an RC circuit sounds like an excellent test. That's what I'll do. Thank you.
@localroger so hub ram is byte addressed and cog ram is long addressed. Got it.👍
https://forums.parallax.com/discussion/83915/spin-code-examples-for-the-beginner-public-version/p7