TOP Contributors

  1. MIKROE (2663 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 (137112 times)
  2. FAT32 Library (70239 times)
  3. Network Ethernet Library (56129 times)
  4. USB Device Library (46444 times)
  5. Network WiFi Library (42080 times)
  6. FT800 Library (41408 times)
  7. GSM click (29124 times)
  8. mikroSDK (26567 times)
  9. PID Library (26504 times)
  10. microSD click (25491 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
Example

V to Hz 2 click

Rating:

5

Author: MIKROE

Last Updated: 2018-08-20

Package Version: 1.0.0.0

Example: 1.0.0.0

Category: Measurements

Downloaded: 3218 times

Not followed.

License: MIT license  

V to Hz 2 click is a device that converts an analog voltage input signal into a pulse wave signal of a certain frequency.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "V to Hz 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "V to Hz 2 click" changes.

Do you want to report abuse regarding "V to Hz 2 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

Example Blog

V to Hz 2 click

V to Hz 2 click

Native view of the V to Hz 2 click board.

View full image
V to Hz 2 click

V to Hz 2 click

Front and back view of the V to Hz 2 click board.

View full image

Library Description

Library initializes and defines GPIO driver and performs commands that can enable or disable the device and get frequency (FOUT) by getting the state of the INT pin. For more details check the documentation.

Key functions :

  • void vtohz2_enable( uint8_t state ) - The function performs enabling and disabling of the device.
  • uint8_t vtohz2_getFreqOut( void ) - The function gets the out frequency on mikrobus INT pin.

Example description

The application is composed of three sections:

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes GPIO driver, performs the device enable and sets the pwm frequency. Also writes help with the possible instructions.
  • Application Task - (code snippet) - Checks which command be entered on UART and sets the pwm duty cycle depending on the entered command.
void applicationTask()
{
 if (UART_Rdy_Ptr())
 {
 rxDat = UART_Rd_Ptr();

 if ((rxDat == '+') && (percCheck < 100))
 {
 pwmDutySum += onePercPwm;
 percCheck += 1;
 }
 else if ((rxDat == '-') && (percCheck > 0))
 {
 pwmDutySum -= onePercPwm;
 percCheck -= 1;
 }
 else if ((rxDat == '*') && (percCheck <= 90))
 {
 pwmDutySum += tenPercPwm;
 percCheck += 10;
 }
 else if ((rxDat == '/') && (percCheck >= 10))
 {
 pwmDutySum -= tenPercPwm;
 percCheck -= 10;
 }
 else if (rxDat == 'h')
 {
 vtohz2_writeHelp();
 }

 pwmDuty = pwmDutySum;
 vtohz2_setSpeed( pwmDuty );

 mikrobus_logWrite( "PWM Duty is : ", _LOG_TEXT );
 WordToStr( percCheck, text );
 mikrobus_logWrite( text, _LOG_TEXT );
 mikrobus_logWrite( " %", _LOG_LINE );
 }
}

Additional functions :

  • void vtohz2_writeHelp() - Writes instructions that perform the determined commands.
  • void vtohz2_setSpeed( uint16_t pwm_duty ) - Determines the desired pwm duty cycle and checks the limit of the pwm duty.
  • void vtohz2_pwmInit( uint32_t pwm_freq ) - Initializes the PWM with the desired frequency and calculates the maximal value of the pwm duty cycle.


Other mikroE Libraries used in the example:

  • Conversions
  • PWM
  • 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

GSM 3 click

5

GSM3 click carries SIM800H, a quad-band (850/900/1800/1900MHz) GSM/GPRS module that transmits voice, sms and data information. Utilizing the module’s full potential, GSM3 click also has an audio input/output connection pad (for a microphone and earphones, which can also be used as an FM antenna).

[Learn More]

Magneto 9 click

0

Magneto 9 Click is a compact add-on board that contains a low-power, accurate, and reliable magnetic sensing device. This board features the A1359, dual tracking output linear hall-effect sensor from Allegro MicroSystems.

[Learn More]

TMR Angle click

5

TMR Angle Click is a Click board perfectly suited for developing applications that range from steering angle applications with the highest functional safety requirements to motors for wipers, pumps and actuators and electric motors in general.

[Learn More]