Hi yuheiwai.
Welcome to the Flowcode forums.
Within the Component Libraries ribbon, select Search and enter intosc.
That with display the internal oscillator helper component, just select add to 2D panel.
Right-click on the helper and select properties.
Within properties select the frequency you want the internal osc to run at.
The correct code will be displayed for you to copy. e.g.
Highlight the code by clicking on it and you can copy using the right-click context menu.
Add a C Code icon from the Command Icons section to the very top of Main.
Note: Any new icons/components added must be placed below the OSCCON C code icon.
The last thing to do is to select Project Options from the Build ribbon.
Enter the frequency in MHz e.g 0.031 for 31KHz.
Within Configure.
Change:
Oscillator Selection to INTOSC oscillator
Watchdog Timer Enable to disabled.
MCLR to Disabled (Only If you have not got MCLR line pulled up to the supply voltage)
PLL Enable to Disabled
Low-Voltage Programming Enabled to Disabled (If programming via ICSP)
After selecting Modify you should be good to go.
Just make sure the
one-second flasher test is correct, before creating your project.
At such a low speed there may be components that don't run as expected, so be aware of that.