Difference between revisions of "Creating Project"
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Create a new project by either selecting 'New Project' from the 'File' menu (File > New Project), pressing '''Ctrl+N''' on the keyboard or clicking on the '''NEW PROJECT''' button on the Start Page. | Create a new project by either selecting 'New Project' from the 'File' menu (File > New Project), pressing '''Ctrl+N''' on the keyboard or clicking on the '''NEW PROJECT''' button on the Start Page. | ||
− | + | ||
+ | ===App developer=== | ||
+ | [[App_Developer|App Developer]] allows you to easily create programs to control and monitor devices external to the PC. | ||
+ | |||
+ | |||
+ | ===Templates=== | ||
+ | [[Selecting_a_Template|Templates]] are used to aid the user to work more efficiently and allow the user to expand programs much easier and create a common base to work from. | ||
+ | |||
+ | |||
+ | |||
+ | |||
==Selecting a Target Chip== | ==Selecting a Target Chip== | ||
Line 28: | Line 38: | ||
+ | ==Changing the clock speed== | ||
+ | Flowcode needs to know how fast you are clocking your chip so that it can implement the delay function with the correct delay time. | ||
+ | You can alter the chip clock speed at any time by selecting Build > Project Options and entering the correct value of your clock circuit by entering the value within the Clock Speed at the middle right of the project Options window (blue rectangle). | ||
+ | It should be noted that the clock speed affects things like delays, it does not control the hardware speed. | ||
+ | If using an external oscillator, the hardware speed is controlled by a crystal or a resonator | ||
− | + | If using an internal oscillator, in a lot of cases, depending on the target, a C code block with an OSCCON or OSCFRQ value will be required - See [[Internal_Oscillator|Internal Oscillator]] and [[Component:_IntOsc_Helper_(Matrix_Tools)|IntOsc Helper component]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | If using an internal oscillator, in a lot of cases a C code block with an OSCCON value will be required - See [[Internal_Oscillator|Internal Oscillator]] and [[Component:_IntOsc_Helper_(Matrix_Tools)|IntOsc Helper component]] | ||
==Changing configuration settings== | ==Changing configuration settings== |
Latest revision as of 08:48, 25 April 2023
Create the Project
Create a new project by either selecting 'New Project' from the 'File' menu (File > New Project), pressing Ctrl+N on the keyboard or clicking on the NEW PROJECT button on the Start Page.
App developer
App Developer allows you to easily create programs to control and monitor devices external to the PC.
Templates
Templates are used to aid the user to work more efficiently and allow the user to expand programs much easier and create a common base to work from.
Selecting a Target Chip
Each version of Flowcode is capable of generating code for a number of target devices, each one having a different combination of properties and characteristics.
Before you use Flowcode to develop a chip application you will need to choose one of these devices. Helping you make this selection is beyond the remit of this help file. Once you have made your choice of device you will need to make other choices concerning the chip and your circuit - particularly concerning clock speed.
Before getting a program into your chip you will need to take several steps to enter data about your chip into several places:
- Tell Flowcode which chip you are using
- Tell Flowcode what clock speed you are running at
- Tell Flowcode what configuration settings you wish to use
Selecting device type from within Flowcode
You can change devices at any time by selecting Build > Project Options. Simply select the chip type from the 'Choose a Target' (green rectangle), Or right-click on any target and select 'Search' then enter partial characters, e.g 18877. Whatever target device is selected, it will appear on the Target button at the top for you to click (orange rectangle). If you are changing from one microcontroller to another, Flowcode will check that all the commands and components in your flowchart are supported by the new microcontroller. Flowcode will advise you of any potential problems.
Changing the clock speed
Flowcode needs to know how fast you are clocking your chip so that it can implement the delay function with the correct delay time.
You can alter the chip clock speed at any time by selecting Build > Project Options and entering the correct value of your clock circuit by entering the value within the Clock Speed at the middle right of the project Options window (blue rectangle).
It should be noted that the clock speed affects things like delays, it does not control the hardware speed.
If using an external oscillator, the hardware speed is controlled by a crystal or a resonator
If using an internal oscillator, in a lot of cases, depending on the target, a C code block with an OSCCON or OSCFRQ value will be required - See Internal Oscillator and IntOsc Helper component
Changing configuration settings
please refer to the red rectangle in the above image.
The chip can be configured from the 'NEW PROJECT' window, or accessed from the 'Build' menu (Build > Project Options).
Please note that it is important to check the configuration before downloading to a chip.
Please ensure that the chip type and oscillator type are correct for your program as these are the main source of user problems.
Some of the more popular devices will have a default configuration which assumes a few of the more popular settings.
As a rule of thumb any feature you are not specifically using should be disabled.
Leaving any of the following enabled will likely cause issues for your application: low voltage programming, watchdog timer, extended CPU.
Configuring the chip for PICmicros
Clicking on the Configure tab from within the Project Options calls up the Configuration page, which allows you to customize settings for your current chip.
The configuration page can be used to:
Set the oscillator type required
Enable/disable advanced features such as brown out, watchdog timers, low voltage programming, read protection etc.
If you are using Flowcode for the very first time, or have changed development boards, you may need to check the options to set which board you are using.
Manually configuring the chip for PICmicros
See Selecting Compiler Options (PICmicro) for help with switching off the default configuration options that use PPP.
Once you have disabled the default configuration options you can enter your own configuration data. For the PICmicro this data will be sent to the chip every time you perform a compile to chip operation.
An example configuration word for the PIC16 series is
0x2007, 0x3FFC
The 0x2007 is the location in memory of the configuration word and the 0x3FFC is the configuration word itself.
An example set of configuration words for the PIC18 series is
0x300000, 0x00
0x300001, 0x22
0x300002, 0x0D
0x300003, 0x0E
0x300004, 0x00
0x300005, 0x00
0x300006, 0x80
0x300007, 0x00
0x300008, 0x0F
0x300009, 0xC0
0x30000A, 0x0F
0x30000B, 0xE0
0x30000C, 0x0F
0x30000D, 0x40
Configuring the Chip for AVRs
The chip can be configured from the Configure option in the chip menu.
Please note that it is important to check the configuration before downloading to a chip.
Configuration settings for individual devices may be represented by 1, 2 or 3 bytes
The function of many of the individual configuration bits are also device dependent.
The data sheet for the relevant target device should be consulted before sending configuration data.
The default setting is configured to send the hex value 0xdf (223 decimal) to parameter location 0
The parameter locations are:
0 = Fuse High Byte (hfuse)
1 = Fuse Low byte (lfuse)
2 = Extended fuse Byte (efuse)
An example of 3 bytes of configuration data is shown below
OK and Send
Save the configuration data and send to the target device
OK
Confirm the configuration data but do not send to the target device
Note: Configuration memory might have a lower endurance than program memory. Only send configuration data when changes are required.
AVR's can also become locked if incorrect configuration settings are loaded so take care when transferring the settings to a device.