elecLear78
Member
I am trying to understand the following project
https://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en020394 . This is the application note for AN900 and also downloaded the source code. I am struck with the sine look up table which is provided in the source code
I have understood that from 270 degrees to 180 the sine values are negative and from 180 to 9o they are positive values and hence if i decode the hex values they are the complements for positive and negative values. My question is sin(270) is -1. Is it not required that the table should contain -1? Please help. Where exactly he is extracting -1 from the table.
https://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en020394 . This is the application note for AN900 and also downloaded the source code. I am struck with the sine look up table which is provided in the source code
Code:
TABLE code 0x0600 ;was 0x0100
;below table is from 270 degrees to 90 degrees @ 10 degree resolution; for 20MHz, PR2 = F9, Timer2 1:1 prescale
;sine_table db 0x00,0x02,0x08,0x11,0x1E,0x2E,0x40,0x54,0x69,0x80,0x96,0xAB,0xBF,0xD1,0xE1,0xEE,0xF7,0xFD,0xFF
;below table is from 270 degrees to 90 degrees @ 10 degree resolution; for 16MHz, PR2 = 137, Timer2 1:1 prescale
sine_table db 0x00,0x02,0x08,0x11,0x1E,0x2E,0x40,0x54,0x69,0x80,0x96,0xAB,0xBF,0xD1,0xE1,0xEE,0xF7,0xFD,0xFF