Use of internal oscillator
Posted: Mon Jan 16, 2006 6:13 pm
We've just answered a technical support question which I thought may interest other FlowCode users, so here's the question, followed by an answer:
Next, at the beginning of the main flowchart in your program, add a 'C' icon and write the following line into it:
This will set the internal oscillator block to run at 8MHz. Other speeds can also be set, e.g. for 4MHz, use 0x60. See the 16F88 datasheet for more info.
That should be it. Remember to set the appropriate clock speed in the PIC...Clock Speed window, otherwise your program's delays may be calculated incorrectly and your 100ms pause may take a few minutes!
The chip in question needs to be configured to use the internal oscillator block, so in the configuration screen (PIC...Configure...) select one of the INTRC options for the oscillator selection drop-down.How do I use the internal oscillator of the 16F88 chip within FlowCode?
Next, at the beginning of the main flowchart in your program, add a 'C' icon and write the following line into it:
Code: Select all
osccon = 0x70;
That should be it. Remember to set the appropriate clock speed in the PIC...Clock Speed window, otherwise your program's delays may be calculated incorrectly and your 100ms pause may take a few minutes!