FT90x Specifics

In order to get the most from the mikroC PRO for FT90x compiler, the user should be familiar with certain aspects of FT90x MCU. This knowledge is not essential, but it can provide a better understanding of the FT90x's capabilities and limitations, and their impact on the code writing as well.

Types Efficiency

First of all, the user should know that FT90x's ALU, which performs arithmetic operations, is optimized for working with 32-bit types. Also, it performs hardware multiplication and division on the integer level,
so the floating multiplication and division is slower and consumes more memory comparing it to the integer.
The FT90x supports 64-bit data types, but they are less efficient. They provide higher precision, but lack the code size and the execution.

Nested Calls Limitations

There are no Nested Calls Limitations, except by RAM size. A Nested call represents a function call within the function body, either to itself (recursive calls) or to another function.

Recursive calls, as a form of cross-calling, are supported by mikroC PRO for FT90x, but they should be used very carefully. Also calling functions from interrupt is allowed.
Calling function from both interrupt and main thread is allowed. Be careful because this programming technique may cause unpredictable results if common resources are used in both main and interrupt.

Variable, constant and routine alignment

Simple type variables whose size is 2 bytes are set to alignment 2, those whose size is 4 bytes and larger are set to alignment 4.
Aggregated types are aligned according to the maximal alignment of its member. Routines are always set to alignment 4.

Non-aligned Memory Access

FT90x allows non-aligned memory access but at a performance loss. Each unaligned access causes multiple bus accesses which will cause slower performance.

FT90x Boot Control

Upon reset, boot control takes control of the memory buses and puts the CPU in a reset state. It automatically transfers the data from the flash memory to the program memory, starting from address 0 on both sides, as illustrated below.
In this way, the user code is executed from the program memory, which enables 0 wait states on 100MHz clock.

FT90x Boot Control

FT90x Boot Control

Copyright (c) 2002-2015 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code