In the math line using the Pic XC32/16 compiler, thanks to the sin() function, it should evaluate everything as a float until it is converted into an integer for the table word. This code is so simple, it is easy to test in M-Chip's compiler and view your table's memory contents.
Here is my test code in basic:
const pi = atn(1) * 4
dim as integer n,sin_t
for n=0 to 90
sin_t = sin(pi*(n/90)/2) * 16384
Print sin_t;",";
next n
END
Here is the output:
0, 286, 572, 857, 1143, 1428, 1713, 1997, 2280, 2563,
2845, 3126, 3406, 3686, 3964, 4240, 4516, 4790, 5063, 5334,
5604, 5872, 6138, 6402, 6664, 6924, 7182, 7438, 7692, 7943,
8192, 8438, 8682, 8923, 9162, 9397, 9630, 9860, 10087, 10311,
10531, 10749, 10963, 11174, 11381, 11585, 11786, 11982, 12176, 12365,
12551, 12733, 12911, 13085, 13255, 13421, 13583, 13741, 13894, 14044,
14189, 14330, 14466, 14598, 14726, 14849, 14968, 15082, 15191, 15296,
15396, 15491, 15582, 15668, 15749, 15826, 15897, 15964, 16026, 16083,
16135, 16182, 16225, 16262, 16294, 16322, 16344, 16362, 16374, 16382,
16384,
There is a slight rounding error of 1 compared to the original table, but, This is the targeted 1/4 sine wave.