TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 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 (136736 times)
  2. FAT32 Library (69950 times)
  3. Network Ethernet Library (55941 times)
  4. USB Device Library (46266 times)
  5. Network WiFi Library (41886 times)
  6. FT800 Library (41170 times)
  7. GSM click (28983 times)
  8. PID Library (26413 times)
  9. mikroSDK (26360 times)
  10. microSD click (25376 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: 3821 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

LR 3 click

0

LR 3 Click is a compact add-on board that contains a long-range transceiver. This board features the 32001345, RF technology-based SRD transceiver, which operates at a frequency of 868MHz from Mipot.

[Learn More]

Hall Current 3 click

0

Hall current 3 click is a very accurate current measurement Click board™, which utilizes the Hall effect to provide a precise and reliable measurement of reasonably high current. Its most distinctive feature is a very low series resistance of only 0.7mΩ, making this device a nearly-perfect ammeter.

[Learn More]

PULSE click

2

PULSE click is a pulse generator with an adjustable frequency. It carries the NEN555 precision timer capable of producing highly accurate time delays.

[Learn More]