Difference between revisions of "Compiling a Flowchart to a Chip"

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
 
<sidebar>Sidebar: Adding Finishing Touches</sidebar>
 
<sidebar>Sidebar: Adding Finishing Touches</sidebar>
'''Introduction'''
+
__NOTOC__
 +
===Introduction===
  
 
Chips can only execute code that is in hexadecimal (hex.) format. Flowcode needs to process your flowcharts (for example TEST.FCF) into a format that a chip can execute Flowcode takes a number of steps:
 
Chips can only execute code that is in hexadecimal (hex.) format. Flowcode needs to process your flowcharts (for example TEST.FCF) into a format that a chip can execute Flowcode takes a number of steps:
Line 23: Line 24:
  
  
'''Compile to C'''
+
===Compile to C===
  
 
Compiles the Flowchart to C code.
 
Compiles the Flowchart to C code.
Line 37: Line 38:
  
  
'''Compile to Hex'''
+
===Compile to Hex===
  
 
Compiles the Flowchart to C code and then compiles the C code to Assembly and Machine code.
 
Compiles the Flowchart to C code and then compiles the C code to Assembly and Machine code.
Line 53: Line 54:
  
  
'''Compiling to chip'''
+
===Compiling to chip===
  
 
Unlike the pervious two methods Compile to chip actually programs the chip after compiling the machine code file.
 
Unlike the pervious two methods Compile to chip actually programs the chip after compiling the machine code file.

Revision as of 12:58, 29 July 2013

<sidebar>Sidebar: Adding Finishing Touches</sidebar>

Introduction

Chips can only execute code that is in hexadecimal (hex.) format. Flowcode needs to process your flowcharts (for example TEST.FCF) into a format that a chip can execute Flowcode takes a number of steps:


1) Compile Flowchart into C code

2) Compile C code into Assembler

3) Assemble the Assembler into Hex

4) Send the Hex code to the chip


Whilst this seems a bit long-winded it has the advantage that it allows you to embed third party C code or Assembly code into your programs without actually getting too bogged down in creating the code - or understanding it.


The various options available allow users to halt the process at various stages so that they can view the resulting code, or check for errors at that code level.


Before compiling your flowchart into a program that can be sent to a chip you will need to ensure you have followed the instructions in the section entitled Selecting a Target Chip.


Compile to C

Compiles the Flowchart to C code.

The resulting C file is saved in the program directory, with a .c extension, and can be viewed or used by external programs.


Select the Compile to C option from the chip menu.

Flowcharts must be saved before they can be transferred and Flowcode will prompt you if this is the case.

You can also use the Compile to C icon on the toolbar.


Compile to Hex

Compiles the Flowchart to C code and then compiles the C code to Assembly and Machine code.

The resulting ASM file is saved in the program directory, with a .asm extension, and can be viewed or used by external programs.

The resulting machine code file is also saved in the program directory with a .hex or .bin extension.


Select the Compile to ASM option from the chip menu.

Flowcharts must be saved before they can be transferred and Flowcode will prompt you if this is the case.

You can also use the Compile to chip icon on the toolbar.


Compiling to chip

Unlike the pervious two methods Compile to chip actually programs the chip after compiling the machine code file.

Compile to chip compiles the Flowchart to C code, then ASM code, then assembles the ASM to Machine code and launches the Programmer application to download the program into the chip.


Select the Compile to chip option from the chip menu to transfer the flowchart to the target microcontroller.

Flowcharts must be saved before they can be transferred and Flowcode will prompt you if this is the case.

You can also use the Compile to chip icon on the toolbar.


Please check your Configuration information before downloading, or if you are having problems: Many perceived errors are as a result of the incorrect set up.


Compiler errors

If the compiler detects any errors during compilation, these errors will be displayed within the Icon Lists panel.


Compiling with non standard applications

Flowcode is optimized for use with the Boost C compiler and linker and the C code may not be appropriate for other compilers.