Hello Matrix and forum people!
Help me with config file for the pic 18f25k22. I want the internal oscillator 4x PLL and 16 MHz osc. So far I couldn't manage to do that... Give me a solution please!!!
Thank you!
Sakis
PIC18F25K22 Internal clock config...
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC18F25K22 Internal clock config...
Hello Sakis,
Hopefully this should run as expected, let us know how you get on.
Hopefully this should run as expected, let us know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: PIC18F25K22 Internal clock config...
Thank you for your reply Benj but it doesn't work. First didn't complete the compilation because the osccon was in capital letters(!). After that just bring the first word 0x55 and stop there. I tried to change some parameters from the config but no success...
Sakis
Sakis
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC18F25K22 Internal clock config...
Hello,
Sorry the register name was in v7 upper case format, v6 and earlier require lower case register names.
Try adding this to your C code after the osccon line to try and force the PLL to be enabled. You might also need to change the PLL config setting to disabled as it looks like the PLL and INTOSC can only be enabled via the osctune register.
Let us know how you get on.
Sorry the register name was in v7 upper case format, v6 and earlier require lower case register names.
Might be worth waiting a while, sounds like the device is running a lot slower than expected and hence the 1 second delay is taking many multiples of 1 second.just bring the first word 0x55 and stop there.
Try adding this to your C code after the osccon line to try and force the PLL to be enabled. You might also need to change the PLL config setting to disabled as it looks like the PLL and INTOSC can only be enabled via the osctune register.
Code: Select all
osctune = 0x40; //Enable PLL
while ((osccon2 & 0x80) == 0); //Wait for PLL to become stable
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: PIC18F25K22 Internal clock config...
Hi benj,
doing the config below, I have 4 sec pulce but changing the osccon to 70 it stucks. I need 4 times faster pulses. Maybe the PLL is not enabled...
Regards
Sakis
doing the config below, I have 4 sec pulce but changing the osccon to 70 it stucks. I need 4 times faster pulses. Maybe the PLL is not enabled...
Regards
Sakis
- Attachments
-
- 18F25K22_mod.fcfx
- (4.21 KiB) Downloaded 367 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC18F25K22 Internal clock config...
Maybe try enabling the Internal/External Oscillator Switchover config setting, I seem to remember this helping on another device.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC18F25K22 Internal clock config...
Hello Sakis,
There will be a way to do it, the datasheet says it can be done.
I would have a thorough read of section 2 of the datasheet and see if you can pull out any pearls of wisdom. Googling for example code can also be a good way.
There will be a way to do it, the datasheet says it can be done.
I would have a thorough read of section 2 of the datasheet and see if you can pull out any pearls of wisdom. Googling for example code can also be a good way.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: PIC18F25K22 Internal clock config...
Hi Benj,
finally it works.The only problem I have is that if I enable both A6 & A7 as I/O the prossesor stuck after 1 sec. If the A6 is configured as a Clockout port the PIC is fine...One I/O less!
Thank you for your help!
finally it works.The only problem I have is that if I enable both A6 & A7 as I/O the prossesor stuck after 1 sec. If the A6 is configured as a Clockout port the PIC is fine...One I/O less!
Thank you for your help!
- Attachments
-
- PIC18_TEST_1sec_prototype.fcfx
- (8.33 KiB) Downloaded 363 times