I changed my code to :
LCD displays "test" , nO problemCode:main: LCDOUT $FE, 1 LCDOUT $FE, $C0, "test" hserout ["test" ] pause 1000 goto main
Terminal program displays:"
ÈKÛ¼ìÿ ( String )
C8 4B DB BC EC FF (Hex)
I changed my code to :
LCD displays "test" , nO problemCode:main: LCDOUT $FE, 1 LCDOUT $FE, $C0, "test" hserout ["test" ] pause 1000 goto main
Terminal program displays:"
ÈKÛ¼ìÿ ( String )
C8 4B DB BC EC FF (Hex)
Its a problem with your serial baud settings for your pic.
Change the SPBRG value to 64 like this:
DEFINE HSER_SPBRG 64
You could probably even remove that line altogether.
"I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams
thanks Kamikaze
After few hours trying any possible setup, I solved the problem
The problem is with HSPLL config.
If I change the config to:
_FOSC_HS_1H
define osc 10, it works
but if I change the config to :
_FOSC_HSPLL_HS_1H
define osc 40, it did not work as expected
HSPLL suppose to multiply the frequency, and if I define osc to 40 ( 4x ) it should be working right out of the box , right ? Or did I forget something ?
Could anyone share information about this ?
The PLL expects an input frequency that is a multiple of 4, which your 10 Mhz clock is not.
For this PIC I usually use a 4Mhz crystal with _PLLDIV_1_1L, _CPUDIV_OSC1_PLL2_1L, and _USBDIV_2_1L which results in a 48Mhz clock for the processor.
Have a look at the table in the data sheet on pages 29 and 30.
edit: also have a look at the figure on page 24 - it shows that the PLL must have a 4Mhz input.
Last edited by Kamikaze47; - 25th August 2008 at 09:56.
"I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams
Bookmarks