You yust should set USBPPL and PPLDIV to 48MHz, or divide by 12 if you use 48MHz resonator.
I think that code is good.
You yust should set USBPPL and PPLDIV to 48MHz, or divide by 12 if you use 48MHz resonator.
I think that code is good.
Ahmadabuomar,
Another possible problem ...
According to your picture ...
Low Voltage Programming (LVP) is Enabled.
You could put a pull-down resistor on RB5/PGM, but you probably want to disable it completely since you are using the full PORTB in your program.
And pedja089, you can't use a 48Mhz resonator with the 4550's.
Maximum frequency using the main oscillator is 25Mhz.
You can use an external TTL (canned) 48Mhz oscillator with EC mode.
<br>
DT
The top line says DEFINE OSC 48
Which seems correct from the image of the configs which shows an 8Mhz crystal with HS_PLL that gives 96Mhz.
The USBPLL is /2 so the USB gets 48Mhz, and the CPUDIV is also /2 so it's running at 48Mhz.
Except for the LVP, it all seems good.
Well, might want to disable XINST too.
<br>
DT
thx for ur reply
i ll try to disable lvp and xinst and see what happen
brb
OMG, it worked
thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaank you Darrel for taking time to read the code and reply me. thank u very much
and thx pedja for trying to help.
Darrel, why LVP is so important in this case?
i thought LVP stands for low voltage programming. and since i used k128 usb programmer i thought lvp must be enabled ( i read once that k128 uses low voltage programming for usb compatible pics).
Great News! And you're welcome.
I'm not familiar with the K128 ...
But with a quick look at the schematic in the datasheet, it seems to use a series of diodes and capacitors to increase the voltage and applies it to VPP.
They have several different programmers.
The LVP comment might have been directed at a different product.
But when LVP is enabled ... anytime RB5/PGM goes HIGH ... it's just like taking MCLR/VPP to 13V.
If it's left floating, the PIC could be constantly entering Program Mode from input noise.
<br>
DT
Bookmarks