http://ww1.microchip.com/downloads/en/DeviceDoc/Explorer 16 User Guide 51589a.pdf
Appendix A contains all the schematics for the explorer board
Appendix A contains all the schematics for the explorer board
No, it's not. You're writing to j but not reading from it, so the value of j is never used. The value returned from main() and the values written to volatile-marked fields such as I/O port registers is unchanged whether you do j=sin(x) or not, so the compiler is free to optimize that away.The compiler warns me when a value is not used, but because 1, I am initializing the variable to a value and 2, I am making j equal to the value of sin(x), j is definitely used even if optimization was enabled.
Sarcasm?! I'm trying really hard to help you by eliminating possible problems. I'm not all that familiar with the parts and the setup but all systems have common threads. The data sheets for the two parts carry explicit warnings that seemed to me to indicate that making an assumption without specific knowledge was risky. I was trying to eliminate that as a source of error. It seemed more likely than a bad library routine which is used by vast numbers of people.If you cared to look at the oscillator setup in each of these datasheets, you would have realised they are identical. The reason why there are two different reference guides is because the current (not working properly) pic has an onboard DAC which has it's own section on DAC clocking. Every microchip example code for the dsPIC33F has the same oscillator code. thankyou for the help but less sarcasm would be appreciated
Still not good enough if you don't use that variable. Making it volatile should work, but implementation of volatile is allowed to be compiler-specific.OK, I will read from j and put it into another variable.
bretm has been addressing the 'unused variable' issue, which caught my attention as well. The thing that you want to ask yourself is whether the external user would even notice any difference if a computation were omitted.Here's the code I have just run to include your test papabravo:
http://pastebin.com/YbCZJTiH
When PLL is disabled, i = 1.5707964, j = 1.0 and k = 6. When PLL is enabled, i = 1.5707964, j = 3.4115467 and k = 6. I am absolutely baffled.