2012-06-25, 19:47:17
For those of you looking to run @ 40 MIPS with an 8 MHz crystal (explorer 16) on a ds33fj256gp710a, I put the following code in the user init area (user_code.inc):
Also, the fcy needs to be changed to 40000000 in settings.inc.
I hope that helps someone else as it took me forever to find! (I'm not much of an assembly guy...)
Code:
mov #0x0000,w0 ;CLKDIV=0
mov w0,CLKDIV
mov #0x0026,w0 ;PLLFBD=38
mov w0,PLLFBD
wait_for_lock:
btss OSCCON,#LOCK ;wait for PLL lock
goto wait_for_lock
Also, the fcy needs to be changed to 40000000 in settings.inc.
I hope that helps someone else as it took me forever to find! (I'm not much of an assembly guy...)