TOP Contributors

  1. MIKROE (2652 codes)
  2. Alcides Ramos (351 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 (136613 times)
  2. FAT32 Library (69814 times)
  3. Network Ethernet Library (55881 times)
  4. USB Device Library (46217 times)
  5. Network WiFi Library (41859 times)
  6. FT800 Library (41073 times)
  7. GSM click (28942 times)
  8. PID Library (26401 times)
  9. mikroSDK (26313 times)
  10. microSD click (25327 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: 3816 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

Speed Radar click

0

Speed Radar Click is a compact add-on board that comes with a radar motion detector. This board features the K-LD2, a radar transceiver from RFbeam. It is a 24GHz radar with a detection distance for humans of up to 15m and cars of up to 30m. Its digital structure makes it easy to use in an MCU-based application or as a standalone device where movement detection or even a speed measurement is required.

[Learn More]

TempHum click

0

Temp&Hum Click carries ST’s HTS221 temperature and relative humidity sensor.

[Learn More]

nRF T click - Example

0

This is a sample program which demonstrates the use of nRF T click. Programmer uses RF module for communication between two development systems. Each module can be used as transmitter and receiver.

[Learn More]