TOP Contributors

  1. MIKROE (2664 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (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 (137133 times)
  2. FAT32 Library (70241 times)
  3. Network Ethernet Library (56131 times)
  4. USB Device Library (46449 times)
  5. Network WiFi Library (42109 times)
  6. FT800 Library (41410 times)
  7. GSM click (29125 times)
  8. mikroSDK (26567 times)
  9. PID Library (26510 times)
  10. microSD click (25507 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 4 click

Rating:

5

Author: MIKROE

Last Updated: 2018-10-19

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Brushless

Downloaded: 3893 times

Not followed.

License: MIT license  

Fan 4 click is a very compact, two-wire fan driver. It utilizes an integrated 5V, DC, brushless-motor driver chip. Its output voltage regulation and current limiting capabilities allow the speed control for the two-wire DC brushless motors.

No Abuse Reported

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

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

Do you want to report abuse regarding "FAN 4 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 4 click

FAN 4 click

Native view of the FAN 4 Click board.

View full image
FAN 4 click

FAN 4 click

Front and back view of the FAN 4 Click board.

View full image

Library Description

The library performs communication with the Fan 4 Click board. The library can send command with the desired output voltage value to the DAC and can receive report from the DAC to check fault conditions. For more details check documentation.

Key functions:

  • T_FAN4_RETVAL fan4_setOutput( uint16_t outputVolt, uint8_t boostStartTimer )  - Function sets the output voltage on the desired value and turns on/off Boost Start Timer.
  • T_FAN4_RETVAL fan4_checkDiagnostic( void ) - Function checks is Thermal Shutdown or Overcurrent Fault happening and returns a diagnostic state.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes I2C interface and puts the DAC voltage value to 0V.
  • Application Task - (code snippet) - Checks the uart command (command symbol) and performs the desired command. Possible commands are incrementing and decrementing voltage by desired step, setting the step value, setting the output voltage on minimum and maximum value. To check all commands take look on legend (L).
void applicationTask()
{
 if (UART_Rdy_Ptr())
 {
 rxDat = UART_Rd_Ptr();

 switch (rxDat)
 {
 case '1' :
 {
 stepVal = _FAN4_DAC_LSB;
 mikrobus_logWrite( "Voltage step is 78mV", _LOG_LINE );
 break;
 }
 case '2' :
 {
 stepVal = _FAN4_DAC_LSB * 2;
 mikrobus_logWrite( "Voltage step is 156mV", _LOG_LINE );
 break;
 }
 case '3' :
 {
 stepVal = _FAN4_DAC_LSB * 3;
 mikrobus_logWrite( "Voltage step is 234mV", _LOG_LINE );
 break;
 }
 case '+' :
 {
 if (voltage <= (_FAN4_MAX_VOLT_SCALE - stepVal))
 {
 voltage += stepVal;
 writeVoltage();
 fan4_setOutput( voltage, _FAN4_BOOST_START_TIMER_DIS );
 }
 else
 {
 mikrobus_logWrite( "Voltage can't be incremented", _LOG_LINE );
 }
 break;
 }
 case '-' :
 {
 if (voltage >= stepVal)
 {
 voltage -= stepVal;
 writeVoltage();
 fan4_setOutput( voltage, _FAN4_BOOST_START_TIMER_DIS );
 }
 else
 {
 mikrobus_logWrite( "Voltage can't be decremented", _LOG_LINE );
 }
 break;
 }
 case '9' :
 {
 if (voltage != _FAN4_MAX_VOLT_SCALE)
 {
 voltage = _FAN4_MAX_VOLT_SCALE;
 mikrobus_logWrite( "Voltage is 4922mV", _LOG_LINE );
 fan4_setOutput( voltage, _FAN4_BOOST_START_TIMER_DIS );
 }
 else
 {
 mikrobus_logWrite( "Voltage is already set on maximum value", _LOG_LINE );
 }
 break;
 }
 case '0' :
 {
 if (voltage != _FAN4_MIN_VOLT_SCALE)
 {
 voltage = _FAN4_MIN_VOLT_SCALE;
 mikrobus_logWrite( "Voltage is 0mV", _LOG_LINE );
 fan4_setOutput( voltage, _FAN4_BOOST_START_TIMER_DIS );
 }
 else
 {
 mikrobus_logWrite( "Voltage is already set on minimum value", _LOG_LINE );
 }
 break;
 }
 case 'L' :
 {
 writeLegend();
 break;
 }
 default :
 {
 break;
 }
 }
 }

 responseCheck = fan4_checkDiagnostic();
 checkResponse();
}

Additional Functions :

  • checkResponse - Checks a response from driver functions and shows results on uart.
  • writeLegend - Writes all possible commands on uart.
  • writeVoltage - Writes current voltage value on uart.


Other mikroE Libraries used in the example:

  • Conversions
  • I2C
  • UART

Additional notes and information

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

RS485 8 click

0

RS485 8 Click is a compact add-on board that enables communication over an RS485 network. This board features the THVD1426, an RS485 transceiver with auto-direction control and ESD protection from Texas Instruments. The THVD1426 offers bus protection for contact discharge, air gap discharge, fast transient burst, and +/-16V bus fault protection.

[Learn More]

Gyro 4 click

5

Gyro 4 Click is a two-axis MEMS gyroscope for optical image stabilization applications. It is equipped with the L20G20IS, that includes a sensing element and an IC interface capable of providing the measured angular rate to the application through an SPI digital interface.

[Learn More]

MINI-M4 STM32 Board Examples

0

Examples for MINI-M4 STM32 Board. Provided examples demonstrate working with on-board LEDs and internal USB HID module.

[Learn More]