PDA

View Full Version : How to simulate in EXCEL ?



Johan
- 27th June 2007, 08:53
I'd like to simulate PBP's SIN function in MS Excel
How to do that ? Is it as simple as x = x * 360/256 ?

Johan

Acetronics2
- 27th June 2007, 09:07
Hi, Johan

May be like this ... ???


http://www.electronic-engineering.ch/microchip/software/tablegenerator.html

some more features here ... but one day, you'll appreciate !!!

Regards

Alain

Johan
- 27th June 2007, 09:47
Alain,

What I need is much simpler than that, I just want to know the result of simple sine calcluation (PBP :8bit) like this:
SIN 0 = ?
SIN 64 = ?
SIN 255 = ?

In the PBP manual it says the result is -127 to 127, does that mean SIN 0 = -127 SIN 255 = 127 ?

Johan

Acetronics2
- 27th June 2007, 10:38
Hi, Johan

values are "normally" given

0 gives 0
64 gives 127
128 gives 0

... 192 gives 129 ... but as High bit set ... means - 127 (use SDEC for printing)

255 might give ... 253 which means ..-3 ( 2's complement )

and , of course back to 0 for 256

Alain

Johan
- 27th June 2007, 18:08
I found out I just had to interpolate the values to find the right result.
Thanks for your help.


PBP Sine table ( intrpolated ) 0,16,32,48,64,80,96,112,128,144,160,176,192,208,22 4,240,256 = 0,32,64,96,127,96,64,48,32,0,-32,-48,-64,-96,-127,-96,-64,-48,-32,0