The @ DEVICE statements are always at the top of my program. It automatically sets up my programmer when I load the file.
If you change the crystal speed you will need to alter your timing. For now I would just mess around with 4mhz until you find your way around. If it works then great!
The reason you need to adjust as you change the crystal speed is because the timer function is directly proportional to the crystal. Faster the crystal the faster the timer function will interrupt. If you move to a 20mhz crystal your interrupt will be 5 times faster. So instead of 1 second in your clock program it will be 200ms.
One thing to remember, most everyone here learned by reading the manual and experimenting. You may have to experiment to answer some of your questions. You may want to pick up Nuts and Volts magazine this month. They are doing a series on PICs and PICBasic, very good if you’re just starting out.
http://www.nutsvolts.com/




Bookmarks