TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139254 times)
  2. FAT32 Library (71751 times)
  3. Network Ethernet Library (57122 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42404 times)
  7. GSM click (29835 times)
  8. mikroSDK (28078 times)
  9. PID Library (26885 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

FAN 6 click

Rating:

5

Author: MIKROE

Last Updated: 2019-11-28

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Brushless

Downloaded: 3252 times

Not followed.

License: MIT license  

The Fan 6 click is a Click board which features EMC2103, an SMBus compliant fan controller with up to up to 3 external and 1 internal temperature channels. The fan driver can be operated using two methods each with two modes. The methods include an RPM based Fan Speed Control Algorithm and a direct PWM drive setting.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "FAN 6 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "FAN 6 click" changes.

Do you want to report abuse regarding "FAN 6 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Fan 6 click

Fan 6 click

Native view of the Fan 6 click board.

View full image
Fan 6 click

Fan 6 click

Front and back view of the Fan 6 click board.

View full image

Library Description

Initializes and defines I2C driver and driver functions which have ability to controls the operation of the fan by writting to registers and reading from registers. Functions also offer a choice to communicate with EEPROM and check tachometer value and temperature value of internal or external diode. Also, there is an option to change operation mode of fan. For more details check documentation.

Key functions:

  • void fan6_writeReg( const uint8_t register_address, const uint16_t transfer_data ) - Function writes 16-bit or 8-bit data to register.
  • uint16_t fan6_readReg( const uint8_t register_address ) - Function reads 16-bit or 8-bit data from register.
  • uint8_t fan6_receiveByte( const uint8_t register_address ) - Function sends register address and reads byte from that address, without writting address again, every time when function be called.
  • uint32_t fan6_readTachometer( void ) - Function reads current tachometer value and calculates that value in rpm.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes I2C driver and configures FAN 6, sets minimal duty (drive), frequency, update and spin up time, and puts FAN 6 on PWM mode with maximal speed (100 percents, 0xFF). Also sets GPIO 1 as input pin and GPIO 2 as output pin and enables device.
  • Application Task - (code snippet) - 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.
void applicationTask()
{
    tachometer = fan6_readTachometer();
    LongWordToStr( tachometer, text );
    mikrobus_logWrite( "Tachometer value is: ", _LOG_TEXT );
    mikrobus_logWrite( text, _LOG_TEXT );
    mikrobus_logWrite( " rpm", _LOG_LINE );
    
    tempDiode = fan6_getTemperature( _FAN6_EXTDIODE1_TEMP_READ_REG, &temperatureSign );
    FloatToStr( tempDiode, text );
    mikrobus_logWrite( "Temperature of DIODE is: ", _LOG_TEXT );
    if (temperatureSign)
        mikrobus_logWrite( "-", _LOG_TEXT );
    mikrobus_logWrite( text, _LOG_TEXT );
    mikrobus_logWrite( " Cels", _LOG_LINE );
    
    mikrobus_logWrite( "", _LOG_LINE );
    Delay_ms( 500 );
}

Other mikroE Libraries used in the example:

  • Conversions
  • I2C
  • UART

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.

ALSO FROM THIS AUTHOR

NFC 5 Click

0

NFC 5 Click is a compact add-on board designed for advanced NFC applications. This board features the ST25R3918, a multipurpose NFC transceiver from STMicroelectronics. This Click board™ is built to cater to the growing needs of the Internet of Things (IoT) ecosystem, providing robust NFC reader functionalities, passive peer-to-peer communication, and card emulation modes with outstanding analog performance. Its notable features include exceptional read range with minimal power output, advanced noise reduction, and compatibility with ISO14443, ISO15693, and NFC Forum Tag types 1, 2, 4, and 5.

[Learn More]

GNSS RTK 3 DA Click

0

GNSS RTK 3 Click is a compact add-on board that enhances the precision of position data derived from satellite-based positioning systems. This board features the LC29HDA, a dual-band, multi-castellation GNSS module from Quectel. This module supports the concurrent reception of all five global GNSS constellations: GPS, BDS, Galileo, GZSS, and GLONASS. It can receive and track many visible satellites in multi-bands, significantly mitigating the multipath effect in deep urban canyons and improving positioning accuracy.

[Learn More]

mikroBootloader

10

To make it as simple as possible to program MCUs on our dev boards, most of them come with a preloaded USB-HID bootloader. While the bootloader firmware is specific to each chip, the PC utility for loading your HEX file to the target microcontroller is universal. It’s done in four steps and takes less than 20 seconds.

[Learn More]