Tableau de comparaison à clic
Tableau de comparaison à clic
Le Comparator Click Board™ de MikroElektronika est un comparateur de tension sur une carte complémentaire Click Board™ comportant un comparateur de tension de précision LM2903. Ce circuit intégré LM2903 comprend deux comparateurs de tension indépendants, deux paires de bornes à vis (deux bornes à vis supplémentaires sont destinées aux connexions GND) et deux potentiomètres.
Il peut être utilisé avec une alimentation simple ou double sur une large plage de tensions. Les bornes à vis permettent à l'utilisateur de connecter des entrées séparées, tandis que les deux potentiomètres, placés entre les bornes à vis et le circuit intégré, configurent la tension de consigne. Chaque entrée possède sa propre broche d'interruption sur le support, c'est-à-dire une via la broche MikroBUS INT, l'autre à la place de la broche MikroBUS AN par défaut.
Le Comparator Click Board™ est conçu pour utiliser une alimentation 3,3 V ou 5 V.
IC/module: LM2903 IC
The LM2903 IC consists of two independent precision voltage comparators on the Click Board™ that operate over an extensive range of voltages. The comparators can operate from a single power supply as well as dual supplies.
How Does The Comparator Click Board Work?
When paired with analog sensors, the Comparator Click Board™ allows user to hook up an analog signal. The voltage from this analog signal is used as an input and compared with the physical value set as a reference by using the potentiometer. The device will then digitally check if your input voltage is higher or lower than the referenced value. If the input value exceeds, an interrupt signal is triggered.
Power: Single-Supply or Dual Supplies
The Comparator Click Board™ is designed to be used with single or dual power supply. For single power supply,
Software Support
Library Description
The library covers all the necessary functions to control the Comparator Click Board™. The Comparator Click Board™ communicates with the device via GPIO driver. This library contains drivers for check state of the OUT1 and OUT2 pin function.
Key Functions
- uint8_t comparator_checkOutputOne() - Check state of the OUT1 pin function.
- uint8_t comparator_checkOutputTwo() - Check state of the OUT2 pin function.
Example Description
The application is composed of three sections:
- System Initialization - Initializes GPIO and LOG structures, sets AN and INT pins as input and start to write log.
- Application Initialization - Initialization driver enables - GPIO also, write log.
- Application Task - (code snippet) This is an example which demonstrates the use of Comparator click board. Comparator clicks checks state of the OUT1 and OUT2 pins. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB uart changes for every 1 sec.
void applicationTask() { outStateOne = comparator_checkOutputOne(); outStateTwo = comparator_checkOutputTwo(); mikrobus_logWrite( " Output One : ", _LOG_TEXT ); if ( outStateOne ) mikrobus_logWrite( "High", _LOG_LINE ); else mikrobus_logWrite( "Low", _LOG_LINE ); mikrobus_logWrite( " Output Two : ", _LOG_TEXT ); if ( outStateTwo ) mikrobus_logWrite( "High", _LOG_LINE ); else mikrobus_logWrite( "Low", _LOG_LINE ); mikrobus_logWrite( "-------------------", _LOG_LINE ); Delay_1sec(); }
Other mikroE Libraries used in the example:
GPIO
UART
Conversion
Additional notes and informations
Depending on the development board you are using, you may need a USB UART click, USB 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
Software Support
Library Description
The library covers all the necessary functions to control the Comparator Click Board™. The Comparator Click Board™ communicates with the device via GPIO driver. This library contains drivers for check state of the OUT1 and OUT2 pin function.
Key Functions
- uint8_t comparator_checkOutputOne() - Check state of the OUT1 pin function.
- uint8_t comparator_checkOutputTwo() - Check state of the OUT2 pin function.
Example Description
The application is composed of three sections:
- System Initialization - Initializes GPIO and LOG structures, sets AN and INT pins as input and start to write log.
- Application Initialization - Initialization driver enables - GPIO also, write log.
- Application Task - (code snippet) This is an example which demonstrates the use of Comparator click board. Comparator clicks checks state of the OUT1 and OUT2 pins. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB uart changes for every 1 sec.
void applicationTask() { outStateOne = comparator_checkOutputOne(); outStateTwo = comparator_checkOutputTwo(); mikrobus_logWrite( " Output One : ", _LOG_TEXT ); if ( outStateOne ) mikrobus_logWrite( "High", _LOG_LINE ); else mikrobus_logWrite( "Low", _LOG_LINE ); mikrobus_logWrite( " Output Two : ", _LOG_TEXT ); if ( outStateTwo ) mikrobus_logWrite( "High", _LOG_LINE ); else mikrobus_logWrite( "Low", _LOG_LINE ); mikrobus_logWrite( "-------------------", _LOG_LINE ); Delay_1sec(); }
Other mikroE Libraries used in the example:
GPIO
UART
Conversion
Additional notes and informations
Depending on the development board you are using, you may need a USB UART click, USB 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
Tableau de comparaison à clic
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.