Intermediate
30 min

Elevate your equipment's comfort with EMC2103 and MK64FN1M0VDC12

Quietly efficient, delightfully cool

Fan 6 Click with Clicker 2 for Kinetis

Published Jul 26, 2023

Click board™

Fan 6 Click

Dev Board

Clicker 2 for Kinetis

Compiler

NECTO Studio

MCU

MK64FN1M0VDC12

Take charge of your comfort with our fan speed management system, allowing you to adjust fan speeds for a personalized cooling experience easily

A

A

Hardware Overview

How does it work?

Fan 6 Click is based on the EMC2103, an SMBus-compliant fan controller with up to 3 external and one internal temperature channel from Microchip. It allows the user to program temperatures generated from external sources to control the fan speed. This functionality also supports DTS data from the CPU. By pushing DTS or standard temperature values into dedicated registers, the external temperature readings can be used with the external diode(s) and internal diode to control the fan speed. The EMC2103 from Microchip also includes a hardware programmable temperature limit and dedicated system shutdown output for thermal protection of critical circuitry. The EMC2103 supports a high or low-frequency PWM driver. The output can be configured as either push-pull or open drain, and the frequency ranges from 9.5Hz to 26kHz in four programmable frequency bands. The EMC2103 includes an RPM-based Fan Speed Control Algorithm. This fan control algorithm uses Proportional, Integral, and Derivative terms to automatically approach and

maintain the system's desired fan speed to an accuracy directly proportional to the accuracy of the clock source. The EMC2103 supports DTS (Intel's Digital Temperature Sensor) data in the Fan Control Look-Up Table. Intel's DTS data is a positive number representing the processor's relative temperature below a fixed value called TCONTROL, which generally equals 100°C for Intel Mobile processors. For example, a DTS value of 10°C means the actual processor temperature is 10°C below TCONTROL or equal to 90°C. The EMC2103's RPM-based Fan Speed Control Algorithm has programmable configuration settings for parameters such as ramp-rate control and spin-up conditions. The fan driver automatically detects and attempts to alleviate a stalled/stuck fan condition while also asserting the ALR pin. The tachometer measurement circuitry is used in conjunction with the RPM-based Fan Speed Control Algorithm to update the fan driver output. Additionally, it can be used in Direct Setting mode as a diagnostic for host-based fan

control. This method monitors the TACH signal in real-time. It constantly updates the tachometer measurement by reporting the number of clocks between a user's programmed number of edges on the TACH signal. The External Diode 1 channel can support a diode-connected transistor (such as a 2N3904) or a substrate transistor requiring the BJT or transistor model (such as those found in a CPU or GPU). The External Diode 2 channel supports any diode connection or can be configured to operate in an anti-parallel diode (APD) mode. The MIC2253 is a constant frequency, pulse-width modulated (PWM) peak current-mode step-up regulator. A reference voltage is fed into the PWM engine, where the duty cycle output of the constant frequency PWM engine is computed from the error, or difference, between the REF and FB voltages. The PWM engine encompasses the circuit blocks to implement a current-mode boost switching power supply, allowing Fan 6 click to drive a 12V fan.

Fan 6 Click hardware overview image

Features overview

Development board

Clicker 2 for Kinetis is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit ARM Cortex-M4F microcontroller, the MK64FN1M0VDC12 from NXP Semiconductors, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a JTAG programmer connector, and two 26-pin headers for interfacing with external electronics. Its compact design with clear and easily recognizable silkscreen markings allows you to build gadgets with unique functionalities and

features quickly. Each part of the Clicker 2 for Kinetis development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the Clicker 2 for Kinetis programming method, using a USB HID mikroBootloader or an external mikroProg connector for Kinetis programmer, the Clicker 2 board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Micro-B cable, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or

using a Li-Polymer battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several user-configurable buttons and LED indicators. Clicker 2 for Kinetis is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

Clicker 2 for Kinetis dimensions image

Microcontroller Overview

MCU Card / MCU

default

Architecture

ARM Cortex-M4

MCU Memory (KB)

1024

Silicon Vendor

NXP

Pin count

121

RAM (Bytes)

262144

Used MCU Pins

mikroBUS™ mapper

General-Purpose I/O
PB2
AN
Shutdown
PB11
RST
Enable
PC4
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
General-Purpose I/O
PA10
PWM
Alert Interrupt
PB13
INT
NC
NC
TX
NC
NC
RX
I2C Clock
PD8
SCL
I2C Data
PD9
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Schematic

Fan 6 Click Schematic schematic

Step by step

Project assembly

Clicker 2 for PIC32MZ front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Clicker 2 for Kinetis as your development board.

Clicker 2 for PIC32MZ front image hardware assembly
GNSS2 Click front image hardware assembly
Prog-cut hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
Micro B Connector Clicker 2 Access - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
Flip&Click PIC32MZ MCU step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

Track your results in real time

Application Output via Debug Mode

1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.

2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.

DEBUG_Application_Output

Software Support

Library Description

This library contains API for Fan 6 Click driver.

Key functions:

  • fan6_read_eeprom - This function reads 256 bytes from EEPROM

  • fan6_set_pwm_mode - This function sets Fan on PWM mode and determines Fan speed (PWM duty)

  • fan6_read_tachometer - This function reads current tachometer value and calculates that value in rpm

Open Source

Code example

This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.

/*!
 * \file 
 * \brief Fan6 Click example
 * 
 * # Description
 * This demo application reads tachometer value which is calculated as rpm value, and reads
 * temperature of external diode in celsius value.
 *
 * The demo application is composed of two sections :
 * 
 * ## Application Init 
 * Initializes device configuration.
 * 
 * ## Application Task  
 * Reads tachometer value which is calculated as rpm value, and reads
 * temperature of external diode in celsius value. All this results logs on USB UART. Repeats operation
 * every 500 ms.
 * 
 * \author MikroE Team
 *
 */
// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "fan6.h"

// ------------------------------------------------------------------ VARIABLES

static fan6_t fan6;
static log_t logger;

static uint32_t tachometer;
static uint8_t duty_cycle = 0;

// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( void )
{
    log_cfg_t log_cfg;
    fan6_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    fan6_cfg_setup( &cfg );
    FAN6_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    fan6_init( &fan6, &cfg );
    
    fan6_enable_device( &fan6, 1 );
    Delay_ms( 500 );
    
    fan6_default_cfg( &fan6 );
    tachometer = 0;
}

void application_task ( void )
{
    float temp_diode;

    temp_diode = fan6_get_temperature( &fan6, FAN6_INTERNAL_TEMP_READ_REG );
    log_printf( &logger, "Temperature of DIODE is: %f - Cels \r\n", temp_diode );
    
    fan6_set_pwm_mode( &fan6, duty_cycle );
    
    duty_cycle += 5;
    
    tachometer = fan6_read_tachometer( &fan6 );
    log_printf( &logger, "Tachometer value is: %lu rpm \r\n", tachometer );
    log_printf( &logger, "---------------------------------------- \r\n", tachometer );
    
    Delay_ms( 500 );
}

void main ( void )
{
    application_init( );

    for ( ; ; )
    {
        application_task( );
    }
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.