Flowcode 7 Installed
Total Page:16
File Type:pdf, Size:1020Kb
Getting Started Guide Getting Started Guide Introduction Flowcode is an Integrated Development Environment (IDE) for programming microcontrollers such as 8, 16 and 32bit PIC, Arduino and ARM devices. It achieves this by using flowcharts instead of text based languages, thus making programming simpler and faster. Flowcode also contains hundreds of pre-made component libraries, allowing users to interface with a host of sensors, inputs and outputs and electro-mechanical components with ease. Despite its simplicity and ease of use, Flowcode is a powerful tool allowing users to develop even the most complex of embedded systems. Flowcode supports both Matrix and 3rd party hardware. In this guide we will create examples based on three different sets of hardware; 1. Matrix EB006 multi-programmer and EB083 development board 2. Arduino Uno and Matrix EB083 development board 3. Microchip Xpress development board Prerequisites • A Windows based PC with a copy of Flowcode 7 installed Should haves for this guide • Supported hardware – a list covered in this guide is provided above • USB cable to both power and program the microcontroller of choice What we’ll cover in this guide? This guide will be split into two main sections: In section 1 we will provide an overview of the Flowcode IDE. How users interact with the environment, add components to the simulation panel and create flowcharts. In section 2 we will run through three examples which will increase in complexity and teach you how to create microcontroller programs. Copyright © 2016 Matrix Technology Solutions Ltd. 2 Getting Started Guide Section 1: The Flowcode IDE In this section we will provide an overview of Flowcode, detailing the programming interface and how users interact with it to create microcontroller programs. Copyright © 2016 Matrix Technology Solutions Ltd. 3 Getting Started Guide Creating a project When you first launch Flowcode you will be presented with the following splash screen. For the first run through we want to start a new project as this gives us a blank canvas to go over the IDE. Later we will look at the use of pre-configured template files. Once a new project is started, you need to select the correct microcontroller. Did you know? As we are using an EB006 board, with the default PIC16F1937 attached, we Flowcode can will need to ensure Flowcode has the corresponding chip selected. When program hundreds using Matrix hardware, this has automatically been configured for the of different correct config properties and clock speed etc. microcontrollers. All are slightly different, and as such, it is essential that you select exactly the right microcontroller you are using. Copyright © 2016 Matrix Technology Solutions Ltd. 4 Getting Started Guide If you are using the EB006; If you are using the Microchip Xpress board; 1. Select the PIC8bit devices 2. Select the PIC16F family from 1. Select PIC8bit within the PIC8bit devices 2. Select ‘Misc’ family 3. Select the 16F1937 – ensure you do 3. Select ‘Microchip MPLAB Xpress’ NOT select the Low Voltage (LV) 4. Press ‘OK’ version 4. Press ‘OK’ – We do not need to configure any other options at this point If you are using the Arduino Uno; 1. Select AVR 2. Select the ‘Arduino’ family 3. Select Arduino Uno R3 PDIP 4. Press ‘OK’ 2 3 1 4 Did you know? You can change the microcontroller at any point during your development. Select the ‘Project Options’ window by clicking Build- >Project Options- >Choose a Target from the main menu at the top of the screen. Copyright © 2016 Matrix Technology Solutions Ltd. 5 Getting Started Guide Once Flowcode has opened you will be presented with a blank IDE as seen below; 7 1 6 5 3 4 2 1. Components 5. Main Window Provides access to the component This is where you create library. Double click or drag flowcharts. All programs will have components onto the simulation a ‘BEGIN’ and ‘END’, you must fill panel. in the gaps in between with the programming icons from point 2. Simulation Panel (4). Where all your components will live. Note; all components you 6. Project Explorer wish to use must be added to the This is where variables and simulation panel. macros (functions) are created, edited and viewed. 3. Panel Properties Here users select which pin/ 7. Toolbar port of the microcontroller the We use the icons in this toolbar components are connected to. to simulate and program our hardware. 4. Command Toolbox Drag and drop programming icons onto the Flowchart window (5) to construct your program. Copyright © 2016 Matrix Technology Solutions Ltd. 6 Getting Started Guide The simulation panels In this next section we will walk you through the 3D interface. The 2D control panel is very similar in operation to the 3D simulation panel, except the Z-axis is locked. Once you have mastered the 3D simulation panel you will quickly understand the 2D control panel. 1 3 4 2 1. Simulation panel controls There are two methods in which you can interact with the 1 2 3 simulation panel; Camera and Cursor mode. It is a dynamic b. Cursor Mode allows you to menu, and selecting the ‘Arrow’ move (1), rotate (2) and scale icon will change the functionality (3) objects. To ‘free move’ the of the three icons to its right. In object in the panel, left click camera mode; and hold the object and drag. Alternatively, if you want to a. You can pan (1), rotate (2) move your object along a and zoom (3) the camera. constrained axis, left mouse To pan and rotate, hold the click on the local axes and left mouse button and drag. drag. Rotate and scale work To zoom, drag a box to the in a similar way. required size or use the mouse wheel to zoom in/ out. Copyright © 2016 Matrix Technology Solutions Ltd. 7 Getting Started Guide 2. Orientation axes 4. Save camera The 3-axes in the top left corner With the ‘save camera’ button you of the simulation panel allow you can save and load custom camera to align the camera back to an angles to allow you to swap axis. between your custom positions. 3. Tools In this tool box you can adjust the configuration properties of the simulation panel; change background colour, snap to grid, lighting modes and more. Copyright © 2016 Matrix Technology Solutions Ltd. 8 Getting Started Guide Section 2: Flowcode Examples We will now run through several examples; LED flasher, creating a latch and finally the use of an LCD screen to create a counter. Each will increase in complexity and at the same time reduce in provided information, requiring you to remember what you’ve learnt in previous examples. Copyright © 2016 Matrix Technology Solutions Ltd. 9 Getting Started Guide Template files Flowcode comes with a selection simulation panel, and be configured of template files which are made to correctly. assist you with development. These are based on popular development For our first example we will use a boards from Matrix and 3rd party template file and in example 2 and 3 equipment such as Microchip, we will create a new blank project, to Digikey and Arduino. The template demonstrate both processes. To use file will have all the necessary template files, start a new project and hardware components added to the choose ‘Open Template’. You will be presented with the following screen. If you are using the EB006 and EB083 board, navigate to the 16F1937 section and select ‘EB083’. Flowcode will open and have the EB083 development board configured as standard. We are now ready to begin example 1. Copyright © 2016 Matrix Technology Solutions Ltd. 10 Getting Started Guide Example 1: LED flasher In this example we will create an LED Since we are using a template flasher which will introduce you to we already have an LED on our the most basic Flowcode features. simulation panel on our EB083 This will run in simulation and can be board. Ensure that the configuration downloaded to hardware. properties are as seen below. We will be using rhe LED connected to To make an LED flasher we will simply PORTA.0. turn the LED on and off, repeatedly. Copyright © 2016 Matrix Technology Solutions Ltd. 11 Getting Started Guide Now we will create our flowchart. To Drag a Loop over to your flowchart make our microcontroller execute as seen below. By default the loop code indefinitely we add a while(1) command is set to be a while(1) loop to our flowchart. This loop loop, so it does not need any further condition essentially means that configuration. whatever code is placed within our loop will execute, forever. Did you know? The small red star above any icons alerts you that your flowchart hasn’t been saved since you added this icon. Copyright © 2016 Matrix Technology Solutions Ltd. 12 Getting Started Guide With our while(1) loop added we can now focus on turning the LED on and off. Since an LED is an output, we will use the ‘Output’ icon. Drag an output icon across onto your flowchart, as seen below, ensuring it sits within the while loop. Copyright © 2016 Matrix Technology Solutions Ltd. 13 Getting Started Guide You will now need to configure the output icon. This is done by double clicking it to view its properties. Our LED is connected to PORTA.0, so we must configure our properties to match this. Finally, since we want to turn the LED on we write a value of ‘1’ in the ‘variable or value’ box. To make an LED flash we must turn it on and off. Place another output icon on your flowchart, below the original, and configure it as before.