PIC 18's are very popular, but they are a bit trickier to configure. Things to keep in mind:
PBP OSC setting does NOT set up the pic for you. It is just for the compilier to know how to set the delays like pause, serin/serout, i2cread/write, and so forth. To get the PIC to run at the speed YOU want, you will have to read the oscillator section for the PIC you are using to see what bits need to be set in what registor. The 18's are more to learn then the 16's.
There is no 1 answer for your question of how to set "it" up for 4mHz. We don't know what "it" is. We will help you, as dave is trying, but like Dave asked, what PIC are you using.
As for your first question in your first post, the answer is this. The correct procedure is to understand the oscillator section of the datasheet for the PIC you want to use. Ask plenty of questions to help with that understanding. Blink an LED at some speed (I like 1/2 second on then off) to verify things are correct. When they are, everything else will be easy. Some folks like to use "hello world" from the comm port for this part, for me that is harder. With that all I know if its right or wrong. With the LED, I can tell if it's too fast or too slow also. I consider the LED a bit easier for me and people who don't do this stuff everyday. Heres my blink, works on EVERY 8 bit PIC so I never have to modify it:
Code:
main:
high led
pause 500
low led
pause 500
goto main
Of course LED needs to be set before hand.
Posted at the same time, now I see the pic you have
Bookmarks