PDA

View Full Version : Config help



Sabahan
- 1st September 2014, 22:08
I need to use a crystal of 12 MHz for my project,I read the PBP manual and it state that if the crystal is beyond 4Mhz ,a HS config must be set or the MCU may not work,But they are very limited resource in the manual about config,is there any resource available on the command?

Thank you

HenrikOlsson
- 1st September 2014, 22:27
Hi,
Not wanting to sound like a smart-ass but since you asked for a resource I'm going to send you right back to the manual. Section 4.9 covers the #CONFIG/#ENDCONFIG directive in some detail and there's quite a bit of information on this forum.

/Henrik.

Sabahan
- 2nd September 2014, 01:13
Yes,I read it,it do have some example,but what all those word means?
CONFIG XINST = OFF
CONFIG PLLDIV = 5
CONFIG WDTPS = 512
CONFIG CPUDIV = OSC1

This is part of the example,what is all those word after config means,why 512'why 5?what to be set off,there are no explanation ,what all those number means?

And most of all,how to set the MCU to operate at 12mhz?obviously is not Define osc 12.i tried

richard
- 2nd September 2014, 01:33
And most of all,how to set the MCU to operate at 12mhz?obviously is not Define osc 12.i tried
as has been discussed thousands of times osc must be in upper case ( OSC) and only tells the compiler what osc frequency to base its timing calculations on.


CONFIG XINST = OFF
CONFIG PLLDIV = 5
CONFIG WDTPS = 512
CONFIG CPUDIV = OSC1

are config word (sometimes refered as fuse ) settings for a particular pic chip , they must match the chip you are using and the particular configuration that you want it to adopt.
read the data sheet .
consult your manual on methods of setting the "config word(s) " for your chip

Sabahan
- 2nd September 2014, 09:01
I found something interesting to read,about the config

http://melabs.com/support/config_defaults.htm

richard
- 2nd September 2014, 09:16
if you need more help you will get a better result by providing the forum with your pbp version , the chip you are using and the actual code (in code tags) you have tried

Archangel
- 2nd September 2014, 20:33
if you need more help you will get a better result by providing the forum with your pbp version , the chip you are using and the actual code (in code tags) you have tried

Hi Sabahan,
What Richard said is critical as Configs are handled differently in PBP 3.xx over any prior version. The HS in the config statement simply turns up the power to the OSC so as to enable it to run faster. As stated above DEFINE OSC 12 simply makes PBP aware of the change from default 4 mhz, and has no effect on the actual OSC.

Demon
- 3rd September 2014, 03:38
Yes,I read it,it do have some example,but what all those word means?
CONFIG XINST = OFF
CONFIG PLLDIV = 5
CONFIG WDTPS = 512
CONFIG CPUDIV = OSC1
...

Some reading if you are still on PBP v2.6 or earlier:

http://www.picbasic.co.uk/forum/showthread.php?t=15982

Robert

Sabahan
- 4th September 2014, 01:19
I'm using PBP3,seems that there are not much info on the net on this topic

richard
- 4th September 2014, 01:33
http://lmgtfy.com/?q=picbasic+config