Professional Documents
Culture Documents
Mikroc: Pro For Ft90X
Mikroc: Pro For Ft90X
th n
g ti
tin jec
ea ro
Cr st p
f ir
mikroC
PRO for FT90x
TO OUR VALUED CUSTOMERS
Nebojsa Matic
General Manager
page 2
Table of Contents
1. Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 04
2. Activating compiler license . . . . . . . . . . . . . . . . . . . . . . . . . 05
3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 08
4. Hardware Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5. Creating a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
Step 1 - Project Settings . . . . . . . . . . . . . . . . . . . . . . . .14
Step 2 - Add files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Step 3 - Include Libraries . . . . . . . . . . . . . . . . . . . . . . . .22
Step 4 - Finishing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Blank new project created . . . . . . . . . . . . . . . . . . . . . . 26
6. Code Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7. Building the Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8. Changing Project Settings . . . . . . . . . . . . . . . . . . . . . . . . . .32
9. More examples .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4
page 3
1. Installation
mikroC PRO for FT90x is a full-featured ANSI C compiler
for FT90x devices from FTDI Chip®. It features an intuitive
IDE, powerful compiler with advanced optimizations, lots
of hardware and software libraries, and additional tools
that will help you in your work. The compiler comes with a
comprehensive Help file and lots of ready-to-use examples
designed to get you started in no time. Compiler license
includes free upgrades and product lifetime tech support,
so you can rely on our help while developing.
www.mikroe.com/mikroc/ft90x
page 4
2. Activating compiler license
MikroElektronika compiler license (full or time trial) is the
permission to use the MikroElektronika compiler with
all its features. License is granted to the customer by
MikroElektronika as a licensor. The customer must purchase
the license rights and then apply a License Activation
Key to unlock the compiler and remove the demo limit.
The customer is bound to comply with the Terms of Usage
defined in the Software License Agreement.
0123-4567-89AB-CDEF
Registration Key
Software registration unlocks the access to Live Software
0123-4567 Updates, Technical Support and other benefits. Use the
Registration Key during Software Registration procedure.
page 7
3. Overview
mikroC PRO for FT90x organizes applications into projects
consisting of a single project file (file with the .mcpf9
extension) and one or more source files (files with the .c
extension). The mikroC PRO for FT90x compiler allows you
to manage several projects at a time. Source files can be
compiled only if they are part of the project.
02 06
07
03 05
08
04
page 10
Figure 4-1:
Hardware connection schematics
VCC-3.3V
VCC-3.3V VCC-1.2V
R36
10K
C42
100nF
100
99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
82
81
80
79
78
77
76
U1
GPIO16
GPIO15
GPIO14
GPIO13
VCC3V3
GPIO12
GPIO11
GPIO10
GPIO9
GPIO8
GPIO7
GPIO6
VDDBAT
RTC_XI/RTC_CLKIN
RTC_XIO
TXON
RXIN
VCC3V3
RREFSET
VCC1V2
VCC3V3
AGND
DAC_REFP
TXOP
RXIP
1 75
GPIO17 HRREF
GPIO18-LD2 2 74
GPIO18 AGND
3 73
GPIO19 H_DP
4 72
GPIO20 H_DM
5 71
GPIO21 DRREF
6 70
GPIO22 D_DP
7 69
GPIO23 D_DM
8 68
GPIO24 VCC3V3
9 67
GPIO25 VCC1V2
FTDI
10 66
GPIO26 XIO
11 65
GPIO27 XI/CLKIN
2K2
R2
12 64
GPIO28 VCC3V3
13 63
GPIO29 VCC1V2
14 62
GPIO30 GPIO5
LED2
15
16
17
GPIO31
GPIO32 FT900Q GPIO4
GPIO3
61
60
59
GPIO33 GPIO2
18 58
GPIO34 GPIO1
19 57
GPIO35 GPIO0
20 56
GPIO34-LD1
GPIO36 GPIO66
21 55
GPIO37 GPIO65
22 54
GPIO38 GPIO64
23 53
GPIO39 GPIO63
24 52
GPIO40 GPIO62
STESTRESTN
25 51
GPIO41 GPIO61
FSOURCE
RESETN
VCC3V3
GPIO42
GPIO43
GPIO44
GPIO45
GPIO46
GPIO47
GPIO48
GPIO49
GPIO50
GPIO51
GPIO52
GPIO53
GPIO54
GPIO55
GPIO56
GPIO57
GPIO58
GPIO60
DEBUG
GND
LED1
VPP
0
TP
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
2K2
R1
R35
10K
page 11
5. Creating the first project
The New Project Wizard (Figure 5-1) will guide you through
the process of creating a new project. The introductory
window of this application contains a list of actions to be
performed when creating a new project.
page 12
Figure 5-1:
Introductory window of the New Project Wizard
01
01 Click Next.
page 13
Step 1 - Project Settings
page 14
Figure 5-2: You can specify project name, path, device
and clock in the first step
page 15
Step 1 - Project Settings
If you do not want to use the suggested path for storing your
new project, you can change the destination folder. In order
to do that, follow a simple procedure:
page 16
Figure 5-3: Change the destination folder
using Browse For Folder dialog
01
02
03
page 17
Step 1 - Project Settings
page 18
Figure 5-4: Enter project name and change
device clock speed if necessary
01
02
03
page 19
Step 2 - Add files
01 Click Next.
page 20
Figure 5-5: Add existing headers, sources
or other files if necessary
01
page 21
Step 3 - Include Libraries
02 Click Next.
page 22
Figure 5-6: Include all libraries in the
project, which is a default configuration.
01
02
page 23
Step 4 - Finishing
02 Click Finish.
page 24
Figure 5-7: Choose whether to open Edit Project
window after dialog closes.
01
02
page 25
Blank new project created
page 26
Figure 5-8:
New blank project is created with your configuration
page 27
6. Code example
Time has come to do some coding. First thing we need to do is
to initialize the GPIO to act as digital output.
while(1){
GPIO_PIN60_bit = ~GPIO_PIN60_bit;
Delay_ms(500);
GPIO_PIN17_bit = ~GPIO_PIN17_bit;
Delay_ms(500);
}
page 28
LedBlinking.c - source code
1 void main() {
2
3 //Set LED1 & LED2 to be digital outputs
4 GPIO_Pin_Digital_Output(_GPIO_PIN_NUM_60);
5 GPIO_Pin_Digital_Output(_GPIO_PIN_NUM_17);
6
7 //Turn OFF both LED1 & LED2
8 GPIO_PIN60_bit = 0;
9 GPIO_PIN17_bit = 0;
10
11 //Toggle LEDs one by one
12 while(1){
13 GPIO_PIN60_bit = ~GPIO_PIN60_bit;
14 Delay_ms(500);
15 GPIO_PIN17_bit = ~GPIO_PIN17_bit;
16 Delay_ms(500);
17 }
18 }
page 29
7. Building the source
When we are done writing our first LedBlinking code, we
can now build the project and create a .HEX file which can
be loaded into our target microcontroller, so we can test the
program on real hardware. “Building” includes compilation,
linking and optimization which are done automatically.
page 30
Figure 7-1:
Listing of project files after building is done
page 31
8. Changing project settings
If you need to change the target microcontroller or
clock speed, you don’t have to go through the new
project wizard all over again. This can be done quickly
in the Edit Project window. You can open it using
Project->Edit Project [CTRL+SHIFT+E] menu option.
page 32
Figure 8-1:
Edit Project Window
02
01
02
03
page 33
9. More examples
page 34
DISCLAIMER
All the products owned by MikroElektronika are protected by copyright law and international copyright treaty.
Therefore, this manual is to be treated as any other copyright material. No part of this manual, including
product and software described herein, may be reproduced, stored in a retrieval system, translated or
transmitted in any form or by any means, without the prior written permission of MikroElektronika. The
manual PDF edition can be printed for private or local use, but not for distribution. Any modification of this
manual is prohibited.
MikroElektronika provides this manual ‘as is’ without warranty of any kind, either expressed or implied,
including, but not limited to, the implied warranties or conditions of merchantability or fitness for a particular
purpose.
MikroElektronika shall assume no responsibility or liability for any errors, omissions and inaccuracies that may
appear in this manual. In no event shall MikroElektronika, its directors, officers, employees or distributors be
liable for any indirect, specific, incidental or consequential damages (including damages for loss of business
profits and business information, business interruption or any other pecuniary loss) arising out of the use
of this manual or product, even if MikroElektronika has been advised of the possibility of such damages.
MikroElektronika reserves the right to change information contained in this manual at any time without prior
notice, if necessary.
TRADEMARKS
The MikroElektronika name and logo, the MikroElektronika logo, mikroC™, mikroBasic™, mikroPascal™,
mikroProg™, EasyFT90x™ v7, mikromedia, clicker 2™, mikroBUS™, click™ boards are trademarks of
MikroElektronika. All other trademarks mentioned herein are property of their respective companies.
All other product and corporate names appearing in this manual may or may not be registered trademarks
or copyrights of their respective companies, and are only used for identification or explanation and to the
owners’ benefit, with no intent to infringe.
Designed by
MikroElektronika Ltd
2015.