MikroElektronika white logo
  • Products
    • Click Boards
      • Wireless Connectivity
        • GPS/GNSS
        • GSM/LTE
        • LTE IoT
        • BT/BLE
        • WiFi
        • RFID/NFC
        • GSM+GPS
        • 6LoWPAN
        • ZigBee
        • UWB
        • SigFox
        • Sub-1 GHz Transceievers
        • 2.4 GHz Trancevers
        • LoRa
        • WiFi+BLE
      • Sensors
        • Biometrics
        • Gas
        • Magnetic
        • Motion
        • Optical
        • Pressure
        • Proximity
        • Temperature & humidity
        • Current sensor
        • Miscellaneous
        • Environmental
        • Force
        • Inductance
        • RF meter
        • Click Shields
        • Click Bundles
      • Interface
        • Adapter
        • CAN
        • Port expander
        • RS485
        • USB
        • 1-Wire
        • RS232
        • Ethernet
        • LIN
        • PWM
        • Current
        • DALI
        • I2C
        • Fiber optics
        • SPI
        • DMX
        • CXPI
        • Click Shields
        • Click Bundles
      • Display & LED
        • LED Drivers
        • LED Matrix
        • LED Segment
        • OLED
        • LCD
        • TFT
        • Click Shields
        • Click Bundles
      • Miscellaneous
        • Relay
        • Optocoupler
        • ID
        • Proto
        • Encryption
        • Click Shields
        • Click Bundles
      • Mixed Signal
        • ADC
        • Measurements
        • DAC
        • Digital potentiometer
        • ADC-DAC
        • Click Shields
        • Click Bundles
      • Storage
        • EEPROM
        • FLASH
        • FRAM
        • microSD
        • MRAM
        • SRAM
        • EERAM
        • ReRAM
        • DRAM
        • Click Shields
        • Click Bundles
      • Motor Control
        • Brushed
        • Brushless
        • Servo
        • Stepper
        • Click Shields
        • Click Bundles
      • Audio & Voice
        • Amplifier
        • Microphone
        • Speakers
        • Signal Processing
        • Speech recognition
        • FM
        • MP3
        • Click Shields
        • Click Bundles
      • HMI
        • Capacitive
        • Pushbutton/Switches
        • Potentiometers
        • Rotary encoder
        • Haptic
        • Fingerprint
        • Click Shields
        • Click Bundles
      • Clock & Timing
        • RTC
        • Clock generator
        • Click Shields
        • Click Bundles
      • Power Management
        • Battery charger
        • Boost
        • Buck
        • Linear
        • Buck-Boost
        • Wireless Charging
        • Power Switch
        • USB-C PD
        • Click Shields
        • Click Bundles
      • Click Bundles
      • Click Shields
    • NECTO
      • NECTO Studio
    • Compilers
      • PIC
        • C
          • NECTO Studio
          • mikroC PRO for PIC
        • Basic
          • mikroBasic PRO for PIC
        • Pascal
          • mikroPascal PRO for PIC
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual TFT AI
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • dsPIC/PIC24
        • C
          • NECTO Studio
          • mikroC PRO for dsPIC
        • Basic
          • mikroBasic PRO for dsPIC
        • Pascal
          • mikroPascal PRO for dsPIC
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • PIC32
        • C
          • NECTO Studio
          • mikroC PRO for PIC32
        • Basic
          • mikroBasic PRO for PIC32
        • Pascal
          • mikroPascal PRO for PIC32
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • ARM
        • C
          • NECTO Studio
          • mikroC PRO for ARM
        • Basic
          • mikroBasic PRO for ARM
        • Pascal
          • mikroPascal PRO for ARM
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual TFT AI
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • AVR
        • C
          • NECTO Studio
          • mikroC PRO for AVR
        • Basic
          • mikroBasic PRO for AVR
        • Pascal
          • mikroPascal PRO for AVR
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • FT90x
        • C
          • mikroC PRO for FT90x
        • Basic
          • mikroBasic PRO for FT90x
        • Pascal
          • mikroPascal PRO for FT90x
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • 8051
        • C
          • mikroC PRO for 8051
        • Basic
          • mikroBasic PRO for 8051
        • Pascal
          • mikroPascal PRO for 8051
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
    • Dev Boards
      • PIC (8-bit)
        • 8th Generation
          • Fusion for PIC v8
          • EasyPIC PRO v8
          • EasyPIC PRO v8 over USB-C
          • EasyPIC v8
          • EasyPIC v8 over USB-C
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyPIC PRO v7a
          • PICPLC16 v7a
          • EasyPIC v7a
          • EasyPIC PRO v7
          • EasyPIC v7
        • 6th Generation
          • PICPLC16 v6
      • dsPIC/PIC24 (16-bit)
        • 8th Generation
          • EasyPIC v8 PIC24/dsPIC33
          • EasyPIC v8 for dsPIC30
          • EasyPIC v8 for dsPIC30 over USB-C
          • Fusion for PIC v8
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyPIC Fusion v7
          • EasyPIC v7 for dsPIC30
        • 6th Generation
          • Easy24-33 v6
      • PIC32 (32-bit)
        • 8th Generation
          • Fusion for PIC32
          • Fusion for PIC32 over USB-C
          • Fusion for PIC v8
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyPIC Fusion v7
      • ARM (32-bit)
        • 8th Generation
          • Fusion for ARM v8
          • Fusion for ARM v8 over USB-C
          • Fusion for STM32 v8
          • Fusion for STM32 over USB-C
          • Fusion for KINETIS v8
          • Fusion for Kinetis v8 over USB-C
          • Fusion for TIVA v8
          • Fusion for TIVA v8 over USB-C
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyMx PRO v7a STM32
          • EasyMx PRO v7 STM32
          • EasyMx PRO v7 Tiva
      • AVR (8-bit)
        • 8th Generation
          • EasyAVR v8
          • EasyAVR PRO v8
          • EasyAVR PRO v8 over USB-C
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyAVR v7
        • 6th Generation
          • AVRPLC16 v6
      • 8051 (8-bit)
        • 7th generation
          • BIG8051
        • 6th Generation
          • Easy8051 v6
      • PSoC (8-bit)
        • 6th Generation
          • UNI-DS6 Development System
      • RISC-V (32bit)
        • 8th Generation
          • UNI-DS v8
          • UNI-DS v8 over USB-C
      • Universal Boards
        • 8th Generation
          • UNI-DS v8
          • UNI-DS v8 over USB-C
          • Fusion for PIC v8
          • Fusion for ARM v8
        • 7th Generation
          • EasyPIC Fusion v7
        • 6th Generation
          • UNI-DS6
          • mikroBoard for PIC 80-pin
          • mikroBoard for AVR
          • mikroBoard for dsPIC
          • mikroBoard for PSoC
          • mikroBoard for 8051
          • mikroBoard for PIC 40-pin
          • mikroBoard for ARM
          • mikroBoard for ARM 144-pin
      • IoT - Wearable
        • Hexiwear
          • Hexiwear
          • Hexiwear Power User Pack
          • Hexiwear Docking Station
          • Hexiwear Battery Pack
          • Hexiwear Color Pack
          • Hexiwear Workstation
      • Analog Boards
        • 7th Generation
          • Analog System Lab Kit PRO
    • Starter Boards
      • PIC (8-bit)
        • Clicker
          • PIC clicker
        • Clicker 2
          • Clicker 2 for PIC18FJ
          • Clicker 2 for PIC18FK
        • Clicker 4
          • Clicker 4 for PIC18F
          • UNI Clicker
        • Ready
          • Ready for PIC Board
          • Ready for PIC (DIP28)
          • PIC-Ready2 Board
          • MMC Ready Board
        • StartUSB
          • StartUSB for PIC
      • dsPIC/PIC24 (16-bit)
        • Clicker 2
          • Clicker 2 for PIC24
          • Clicker 2 for dsPIC33
        • Clicker 4
          • UNI Clicker
        • Ready
          • dsPIC-Ready1 Board
          • dsPIC-Ready2 Board
          • DsPIC-Ready3 Board
          • dsPIC-Ready4 Board
      • PIC32 (32-bit)
        • Clicker
          • PIC32MX clicker
          • 6LoWPAN Clicker
          • PIC32MZ clicker
        • Clicker 2
          • Clicker 2 for PIC32MX
          • Clicker 2 for PIC32MZ
        • Clicker 4
          • UNI Clicker
        • MINI
          • MINI-32 Board
          • MINI-32 for PIC32MZ
        • Flip&Click
          • Flip&Click PIC32MZ
      • ARM (32-bit)
        • Clicker
          • RA4M1 Clicker
          • Kinetis Clicker
          • MSP432 Clicker
          • CEC1702 clicker
          • CEC1302 Clicker
          • STM32 M4 clicker
        • Clicker 2
          • Clicker 2 for STM32
          • Clicker 2 for Kinetis
          • Clicker 2 for CEC1702
          • Clicker 2 for MSP432
          • Clicker 2 for CEC1302
          • Clicker 2 for PSoC 6
        • Clicker 4
          • Clicker 4 for STM32F745VG
          • Clicker 4 for STM32F4
          • Clicker 4 for TMPM3H
          • Clicker 4 for TMPM4K
          • Clicker 4 for STM32
          • UNI Clicker
        • MINI
          • MINI-M4 for STM32
          • MINI-M4 For Kinetis
          • MINI-M4 for Tiva
          • MINI-M4 for Stellaris
          • MINI-M4 for MSP432
          • MINI-M0 for STM32
        • Flip&Click
          • Flip&Click SAM3X
      • AVR (8-bit)
        • Clicker 4
          • UNI Clicker
        • MINI
          • MINI-AT Board - 3.3V
          • MINI-AT Board - 5V
        • Ready
          • Ready for AVR Board
          • Ready For XMEGA
          • mikroXMEGA Board
          • AVR-Ready2 Board
        • StartUSB
          • StartUSB for AVR
      • 8051 (8-bit)
        • Ready
          • 8051-Ready Board
      • FT90x (32-bit)
        • Clicker 2
          • Clicker 2 for FT90x
      • Miscellaneous
        • USB
          • USB Wizard
          • Quail
          • FlowPaw Kit
      • Universal Boards
        • Clicker 4
          • UNI Clicker
    • Prog-Debug
      • PIC (8-bit)
        • CODEGRIP
          • UNI CODEGRIP
          • UNI CODEGRIP - USB-C
          • CODEGRIP for PIC
          • CODEGRIP for PIC USB-C
        • mikroProg
          • mikroProg for PIC
      • dsPIC/PIC24 (16-bit)
        • CODEGRIP
          • UNI CODEGRIP
          • UNI CODEGRIP - USB-C
          • CODEGRIP for PIC
        • mikroProg
          • mikroProg for dsPIC
      • PIC32 (32-bit)
        • CODEGRIP
          • UNI CODEGRIP
          • UNI CODEGRIP - USB-C
          • CODEGRIP for PIC
          • CODEGRIP for PIC USB-C
        • mikroProg
          • mikroProg for PIC32
      • ARM (32-bit)
        • CODEGRIP
          • UNI CODEGRIP
          • UNI CODEGRIP USB-C
          • CODEGRIP for ARM
          • CODEGRIP for ARM USB-C
          • CODEGRIP for STM32
          • CODEGRIP for KINETIS
          • CODEGRIP for Tiva
          • CODEGRIP for Tiva USB-C
        • mikroProg
          • mikroProg for STM32
          • mikroProg for Tiva
          • mikroProg for Kinetis
          • mikroProg for CEC
          • mikroProg for MSP432
          • mikroProg for PSoC 5LP
      • AVR (8-bit)
        • CODEGRIP
          • CODEGRIP for AVR
          • CODEGRIP for AVR - USB-C
          • UNI CODEGRIP
          • UNI CODEGRIP - USB-C
        • mikroProg
          • mikroProg for AVR
      • 8051 (8-bit)
        • mikroProg
          • mikroProg for 8051
      • FT90x (32-bit)
        • mikroProg
          • mikroProg for FT90x
    • Smart Displays
      • 2.8"
        • ARM (32-bit)
        • AVR (8-bit)
        • dsPIC/PIC24 (16-bit)
        • PIC (8-bit)
        • PIC32 (32-bit)
      • 3.5"
        • ARM (32-bit)
        • FT90x (32-bit)
        • PIC (8-bit)
        • PIC32 (32-bit)
      • 4.3"
        • ARM (32-bit)
        • FT90x (32-bit)
        • PIC (8-bit)
        • PIC32 (32-bit)
      • 5"
        • ARM (32-bit)
        • FT90x (32-bit)
        • PIC32 (32-bit)
      • 7"
        • ARM (32-bit)
        • FT90x (32-bit)
    • MCU Cards
      • PIC (8-bit)
        • 8th Generation
        • 7th Generation
        • 6th Generation
      • dsPIC/PIC24 (16-bit)
        • 8th Generation
        • 7th Generation
        • 6th Generation
      • PIC32 (32-bit)
        • 8th Generation
        • 7th Generation
      • ARM (32-bit)
        • 8th Generation
        • 7th Generation
      • AVR (8-bit)
        • 8th Generation
      • RISC-V (32bit)
        • 8th Generation
    • Accessories
      • TFT Displays
      • LCD Displays
      • LED Displays
      • E-Paper Displays
      • Sensors
      • Headers and Connectors
      • Wire Jumpers and Cables
      • Antennas
      • Batteries
      • RFID/NFC
      • Proto
      • Motors
      • Storage
      • Power
      • Adapters
      • Interface
      • Input/Output
      • Miscellaneous
      • FANware
      • MCUs
      • Books
    • Kits
      • PIC Kits
      • dsPIC/PIC24 Kits
      • PIC32 Kits
      • ARM Kits
      • AVR Kits
      • FT90x Kits
      • 8051 Kits
  • Shop
  • EmbeddedWiki
  • Support
    • Helpdesk
    • Contact us
    • Forum
    • LibStock
    • Learn
    • Let's make
    • Books
  • Services
    • Planet Debug
    • Design Service
    • Product Customization
    • Contract Manufacturing
    • Premium Technical Support
  • News
  • My profile
  • Privacy settings
  • Activity
  • Sign out

Your shoppingcart is empty.
Continue shopping.

MikroElektronika white logo
  • Products
    • click boards icon Click Boards
      • Wireless Connectivity
        • GPS/GNSS
        • GSM/LTE
        • LTE IoT
        • BT/BLE
        • WiFi
        • RFID/NFC
        • GSM+GPS
        • 6LoWPAN
        • ZigBee
        • UWB
        • SigFox
        • Sub-1 GHz Transceievers
        • 2.4 GHz Trancevers
        • LoRa
        • WiFi+BLE
      • Sensors
        • Biometrics
        • Gas
        • Magnetic
        • Motion
        • Optical
        • Pressure
        • Proximity
        • Temperature & humidity
        • Current sensor
        • Miscellaneous
        • Environmental
        • Force
        • Inductance
        • RF meter
        • Click Shields
        • Click Bundles
      • Interface
        • Adapter
        • CAN
        • Port expander
        • RS485
        • USB
        • 1-Wire
        • RS232
        • Ethernet
        • LIN
        • PWM
        • Current
        • DALI
        • I2C
        • Fiber optics
        • SPI
        • DMX
        • CXPI
        • Click Shields
        • Click Bundles
      • Display & LED
        • LED Drivers
        • LED Matrix
        • LED Segment
        • OLED
        • LCD
        • TFT
        • Click Shields
        • Click Bundles
      • Miscellaneous
        • Relay
        • Optocoupler
        • ID
        • Proto
        • Encryption
        • Click Shields
        • Click Bundles
      • Mixed Signal
        • ADC
        • Measurements
        • DAC
        • Digital potentiometer
        • ADC-DAC
        • Click Shields
        • Click Bundles
      • Storage
        • EEPROM
        • FLASH
        • FRAM
        • microSD
        • MRAM
        • SRAM
        • EERAM
        • ReRAM
        • DRAM
        • Click Shields
        • Click Bundles
      • Motor Control
        • Brushed
        • Brushless
        • Servo
        • Stepper
        • Click Shields
        • Click Bundles
      • Audio & Voice
        • Amplifier
        • Microphone
        • Speakers
        • Signal Processing
        • Speech recognition
        • FM
        • MP3
        • Click Shields
        • Click Bundles
      • HMI
        • Capacitive
        • Pushbutton/Switches
        • Potentiometers
        • Rotary encoder
        • Haptic
        • Fingerprint
        • Click Shields
        • Click Bundles
      • Clock & Timing
        • RTC
        • Clock generator
        • Click Shields
        • Click Bundles
      • Power Management
        • Battery charger
        • Boost
        • Buck
        • Linear
        • Buck-Boost
        • Wireless Charging
        • Power Switch
        • USB-C PD
        • Click Shields
        • Click Bundles
      • Click Bundles
      • Click Shields
    • necto icon NECTO
      • NECTO Studio
    • compilers icon Compilers
      • PIC
        • C
          • NECTO Studio
          • mikroC PRO for PIC
        • Basic
          • mikroBasic PRO for PIC
        • Pascal
          • mikroPascal PRO for PIC
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual TFT AI
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • dsPIC/PIC24
        • C
          • NECTO Studio
          • mikroC PRO for dsPIC
        • Basic
          • mikroBasic PRO for dsPIC
        • Pascal
          • mikroPascal PRO for dsPIC
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • PIC32
        • C
          • NECTO Studio
          • mikroC PRO for PIC32
        • Basic
          • mikroBasic PRO for PIC32
        • Pascal
          • mikroPascal PRO for PIC32
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • ARM
        • C
          • NECTO Studio
          • mikroC PRO for ARM
        • Basic
          • mikroBasic PRO for ARM
        • Pascal
          • mikroPascal PRO for ARM
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual TFT AI
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • AVR
        • C
          • NECTO Studio
          • mikroC PRO for AVR
        • Basic
          • mikroBasic PRO for AVR
        • Pascal
          • mikroPascal PRO for AVR
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • FT90x
        • C
          • mikroC PRO for FT90x
        • Basic
          • mikroBasic PRO for FT90x
        • Pascal
          • mikroPascal PRO for FT90x
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
      • 8051
        • C
          • mikroC PRO for 8051
        • Basic
          • mikroBasic PRO for 8051
        • Pascal
          • mikroPascal PRO for 8051
        • Additional Software
          • CODEGRIP WiFi license
          • CODEGRIP SSL license
          • Visual TFT
          • Visual GLCD
          • Package Manager
          • mikroBootloader
          • CAN calculator
          • GLCD Font Creator
          • Timer Calculator
          • MikroPlot
    • dev boards icon Dev Boards
      • PIC (8-bit)
        • 8th Generation
          • Fusion for PIC v8
          • EasyPIC PRO v8
          • EasyPIC PRO v8 over USB-C
          • EasyPIC v8
          • EasyPIC v8 over USB-C
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyPIC PRO v7a
          • PICPLC16 v7a
          • EasyPIC v7a
          • EasyPIC PRO v7
          • EasyPIC v7
        • 6th Generation
          • PICPLC16 v6
      • dsPIC/PIC24 (16-bit)
        • 8th Generation
          • EasyPIC v8 PIC24/dsPIC33
          • EasyPIC v8 for dsPIC30
          • EasyPIC v8 for dsPIC30 over USB-C
          • Fusion for PIC v8
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyPIC Fusion v7
          • EasyPIC v7 for dsPIC30
        • 6th Generation
          • Easy24-33 v6
      • PIC32 (32-bit)
        • 8th Generation
          • Fusion for PIC32
          • Fusion for PIC32 over USB-C
          • Fusion for PIC v8
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyPIC Fusion v7
      • ARM (32-bit)
        • 8th Generation
          • Fusion for ARM v8
          • Fusion for ARM v8 over USB-C
          • Fusion for STM32 v8
          • Fusion for STM32 over USB-C
          • Fusion for KINETIS v8
          • Fusion for Kinetis v8 over USB-C
          • Fusion for TIVA v8
          • Fusion for TIVA v8 over USB-C
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyMx PRO v7a STM32
          • EasyMx PRO v7 STM32
          • EasyMx PRO v7 Tiva
      • AVR (8-bit)
        • 8th Generation
          • EasyAVR v8
          • EasyAVR PRO v8
          • EasyAVR PRO v8 over USB-C
          • UNI-DS v8
          • UNI-DS v8 over USB-C
        • 7th Generation
          • EasyAVR v7
        • 6th Generation
          • AVRPLC16 v6
      • 8051 (8-bit)
        • 7th generation
          • BIG8051
        • 6th Generation
          • Easy8051 v6
      • PSoC (8-bit)
        • 6th Generation
          • UNI-DS6 Development System
      • RISC-V (32bit)
        • 8th Generation
          • UNI-DS v8
          • UNI-DS v8 over USB-C
      • Universal Boards
        • 8th Generation
          • UNI-DS v8
          • UNI-DS v8 over USB-C
          • Fusion for PIC v8
          • Fusion for ARM v8
        • 7th Generation
          • EasyPIC Fusion v7
        • 6th Generation
          • UNI-DS6
          • mikroBoard for PIC 80-pin
          • mikroBoard for AVR
          • mikroBoard for dsPIC
          • mikroBoard for PSoC
          • mikroBoard for 8051
          • mikroBoard for PIC 40-pin
          • mikroBoard for ARM
          • mikroBoard for ARM 144-pin
      • IoT - Wearable
        • Hexiwear
          • Hexiwear
          • Hexiwear Power User Pack
          • Hexiwear Docking Station
          • Hexiwear Battery Pack
          • Hexiwear Color Pack
          • Hexiwear Workstation
      • Analog Boards
        • 7th Generation
          • Analog System Lab Kit PRO
    • starter boards icon Starter Boards
      • PIC (8-bit)
        • Clicker
          • PIC clicker
        • Clicker 2
          • Clicker 2 for PIC18FJ
          • Clicker 2 for PIC18FK
        • Clicker 4
          • Clicker 4 for PIC18F
          • UNI Clicker
        • Ready
          • Ready for PIC Board
          • Ready for PIC (DIP28)
          • PIC-Ready2 Board
          • MMC Ready Board
        • StartUSB
          • StartUSB for PIC
      • dsPIC/PIC24 (16-bit)
        • Clicker 2
          • Clicker 2 for PIC24
          • Clicker 2 for dsPIC33
        • Clicker 4
          • UNI Clicker
        • Ready
          • dsPIC-Ready1 Board
          • dsPIC-Ready2 Board
          • DsPIC-Ready3 Board
          • dsPIC-Ready4 Board
      • PIC32 (32-bit)
        • Clicker
          • PIC32MX clicker
          • 6LoWPAN Clicker
          • PIC32MZ clicker
        • Clicker 2
          • Clicker 2 for PIC32MX
          • Clicker 2 for PIC32MZ
        • Clicker 4
          • UNI Clicker
        • MINI
          • MINI-32 Board
          • MINI-32 for PIC32MZ
        • Flip&Click
          • Flip&Click PIC32MZ
      • ARM (32-bit)
        • Clicker
          • RA4M1 Clicker
          • Kinetis Clicker
          • MSP432 Clicker
          • CEC1702 clicker
          • CEC1302 Clicker
          • STM32 M4 clicker
        • Clicker 2
          • Clicker 2 for STM32
          • Clicker 2 for Kinetis
          • Clicker 2 for CEC1702
          • Clicker 2 for MSP432
          • Clicker 2 for CEC1302
          • Clicker 2 for PSoC 6
        • Clicker 4
          • Clicker 4 for STM32F745VG
          • Clicker 4 for STM32F4
          • Clicker 4 for TMPM3H
          • Clicker 4 for TMPM4K
          • Clicker 4 for STM32
          • UNI Clicker
        • MINI
          • MINI-M4 for STM32
          • MINI-M4 For Kinetis
          • MINI-M4 for Tiva
          • MINI-M4 for Stellaris
          • MINI-M4 for MSP432
          • MINI-M0 for STM32
        • Flip&Click
          • Flip&Click SAM3X
      • AVR (8-bit)
        • Clicker 4
          • UNI Clicker
        • MINI
          • MINI-AT Board - 3.3V
          • MINI-AT Board - 5V
        • Ready
          • Ready for AVR Board
          • Ready For XMEGA
          • mikroXMEGA Board
          • AVR-Ready2 Board
        • StartUSB
          • StartUSB for AVR
      • 8051 (8-bit)
        • Ready
          • 8051-Ready Board
      • FT90x (32-bit)
        • Clicker 2
          • Clicker 2 for FT90x
      • Miscellaneous
        • USB
          • USB Wizard
          • Quail
          • FlowPaw Kit
      • Universal Boards
        • Clicker 4
          • UNI Clicker
    • prog-debug icon Prog-Debug
      • PIC (8-bit)
        • CODEGRIP
          • UNI CODEGRIP
          • UNI CODEGRIP - USB-C
          • CODEGRIP for PIC
          • CODEGRIP for PIC USB-C
        • mikroProg
          • mikroProg for PIC
      • dsPIC/PIC24 (16-bit)
        • CODEGRIP
          • UNI CODEGRIP
          • UNI CODEGRIP - USB-C
          • CODEGRIP for PIC
        • mikroProg
          • mikroProg for dsPIC
      • PIC32 (32-bit)
        • CODEGRIP
          • UNI CODEGRIP
          • UNI CODEGRIP - USB-C
          • CODEGRIP for PIC
          • CODEGRIP for PIC USB-C
        • mikroProg
          • mikroProg for PIC32
      • ARM (32-bit)
        • CODEGRIP
          • UNI CODEGRIP
          • UNI CODEGRIP USB-C
          • CODEGRIP for ARM
          • CODEGRIP for ARM USB-C
          • CODEGRIP for STM32
          • CODEGRIP for KINETIS
          • CODEGRIP for Tiva
          • CODEGRIP for Tiva USB-C
        • mikroProg
          • mikroProg for STM32
          • mikroProg for Tiva
          • mikroProg for Kinetis
          • mikroProg for CEC
          • mikroProg for MSP432
          • mikroProg for PSoC 5LP
      • AVR (8-bit)
        • CODEGRIP
          • CODEGRIP for AVR
          • CODEGRIP for AVR - USB-C
          • UNI CODEGRIP
          • UNI CODEGRIP - USB-C
        • mikroProg
          • mikroProg for AVR
      • 8051 (8-bit)
        • mikroProg
          • mikroProg for 8051
      • FT90x (32-bit)
        • mikroProg
          • mikroProg for FT90x
    • smart displays icon Smart Displays
      • 2.8"
        • ARM (32-bit)
        • AVR (8-bit)
        • dsPIC/PIC24 (16-bit)
        • PIC (8-bit)
        • PIC32 (32-bit)
      • 3.5"
        • ARM (32-bit)
        • FT90x (32-bit)
        • PIC (8-bit)
        • PIC32 (32-bit)
      • 4.3"
        • ARM (32-bit)
        • FT90x (32-bit)
        • PIC (8-bit)
        • PIC32 (32-bit)
      • 5"
        • ARM (32-bit)
        • FT90x (32-bit)
        • PIC32 (32-bit)
      • 7"
        • ARM (32-bit)
        • FT90x (32-bit)
    • mcu cards icon MCU Cards
      • PIC (8-bit)
        • 8th Generation
        • 7th Generation
        • 6th Generation
      • dsPIC/PIC24 (16-bit)
        • 8th Generation
        • 7th Generation
        • 6th Generation
      • PIC32 (32-bit)
        • 8th Generation
        • 7th Generation
      • ARM (32-bit)
        • 8th Generation
        • 7th Generation
      • AVR (8-bit)
        • 8th Generation
      • RISC-V (32bit)
        • 8th Generation
    • accessories icon Accessories
      • TFT Displays
      • LCD Displays
      • LED Displays
      • E-Paper Displays
      • Sensors
      • Headers and Connectors
      • Wire Jumpers and Cables
      • Antennas
      • Batteries
      • RFID/NFC
      • Proto
      • Motors
      • Storage
      • Power
      • Adapters
      • Interface
      • Input/Output
      • Miscellaneous
      • FANware
      • MCUs
      • Books
    • kits icon Kits
      • PIC Kits
      • dsPIC/PIC24 Kits
      • PIC32 Kits
      • ARM Kits
      • AVR Kits
      • FT90x Kits
      • 8051 Kits
  • Shop
  • EmbeddedWiki
  • Support
    • Helpdesk
    • Contact us
    • Forum
    • LibStock
    • Learn
    • Let's make
    • Books
  • Services
    • Planet Debug
    • Design Service
    • Product Customization
    • Contract Manufacturing
    • Premium Technical Support
  • News
  • Price :

    More info
Reset filter
  • 0
Authentication
Account

Create account

Forgot your password?

Your cart is empty !
View cart ( )
  1. Home
  2. ebooks
  3. PIC Microcontrollers - Programming in C
  4. analog-modules
MikroElektronika books

3.9 Analog Modules

 

The A/D converter module has the following features:

  • The converter generates a 10-bit binary result using the method of successive approximation and stores the conversion results into the ADC registers (ADRESL and ADRESH);
  • There are 14 separate analog inputs;
  • The A/D converter converts an analog input signal into a 10-bit binary number;
  • The minimum resolution or quality of conversion may be adjusted to various needs by selecting voltage references Vref- and Vref+.
pic-microcontrollers-programming-in-c-chapter-03-image-130

A/D CONVERTER

Even though the use of A/D converter seems to be very complicated, it is basically very simple, simpler than using timers and serial communication module, anyway.
pic-microcontrollers-programming-in-c-chapter-03-image-131
The operation of A/D converter is in control of the bits of four registers:
  • ADRESH Contains high byte of conversion result;
  • ADRESL Contains low byte of conversion result;
  • ADCON0 Control register 0; and
  • ADCON1 Control register 1.

ADRESH and ADRESL Registers

The result obtained after converting an analog value into digital is a10-bit number that is to be stored in the ADRESH and ADRESL registers. There are two ways of handling it - left and right justification which simplifies its use to a great extent. The format of conversion result depends on the ADFM bit of the ADCON1 register. In the event that the A/D converter is not used, these registers may be used as general-purpose registers.
pic-microcontrollers-programming-in-c-chapter-03-image-132

A/D ACQUISITION REQUIREMENTS

In order to enable the ADC to meet its specified accuracy, it is necessary to provide a certain time delay between selecting specific analog input and measurement itself. This time is called 'acquisition time' and mainly depends on the source impedance. There is an equation used to calculate this time accurately, which in the worst case amounts to approximately 20uS. So, if you want the conversion to be accurate, don’t forget this important detail.

ADC CLOCK PERIOD

The time needed to complete a one-bit conversion is defined as TAD. It is required to be at least 1,6 uS. One full 10-bit A/D conversion is slightly longer than expected and amounts to 11 TAD periods. Since both clock frequency and source of A/D conversion are specified by software, it is necessary to select one of the available combinations of bits ADCS1 and ADCS0 before the voltage measurement on some of the analog inputs starts. These bits are stored in the ADCON0 register.
ADC CLOCK SOURCE ADCS1 ADCS0 DEVICE FREQUENCY (FOSC)
20 Mhz 8 Mhz 4 Mhz 1 Mhz
Fosc/2 0 0 100 nS 250 nS 500 nS 2 uS
Fosc/8 0 1 400 nS 1 uS 2 uS 8 uS
Fosc/32 1 0 1.6 uS 4 uS 8 uS 32 uS
Frc 1 1 2 - 6 uS 2 - 6 uS 2 - 6 uS 2 - 6 uS
Any change in the system clock frequency will affect the ADC clock frequency, which may adversely affect the ADC result. Device frequency characteristics are shown in the table above. The values in the shaded cells are outside of the range recommended.
pic-microcontrollers-programming-in-c-chapter-03-image-133

HOW TO USE THE A/D CONVERTER?

In order to enable the A/D converter to run without problems as well as to avoid unexpected results, it is necessary to consider the following:
  • A/D converter does not differ between digital and analog signals. In order to avoid errors in measurement or chip damage, pins should be configured as analog inputs before the process of conversion starts. Bits used for this purpose are stored in the TRIS and ANSEL (ANSELH) registers;
  • When reading the port with analog inputs, the state of the corresponding bits will be read as a logic zero (0); and
  • Roughly speaking, voltage measurement in the converter is based on comparing input voltage with internal scale which has 1024 marks (210 = 1024). The lowest scale mark stands for the Vref- voltage, whilst its highest mark stands for the Vref+ voltage. Figure below shows selectable voltage references as well as their minimum and maximum values.
pic-microcontrollers-programming-in-c-chapter-03-image-134

ADCON0 Register

pic-microcontrollers-programming-in-c-chapter-03-image-135
ADCS1, ADCS0 - A/D Conversion Clock Select bits select clock frequency used for internal synchronization of A/D converter. It also affects duration of conversion.
ADCS1 ADCS2 CLOCK
0 0 Fosc/2
0 1 Fosc/8
1 0 Fosc/32
1 1 RC *
* Clock is generated by internal oscillator which is built in the converter. CHS3-CHS0 - Analog Channel Select bits select a pin or an analog channel for A/D conversion, i.e. voltage measurement:
CHS3 CHS2 CHS1 CHS0 CHANNEL PIN
0 0 0 0 0 RA0/AN0
0 0 0 1 1 RA1/AN1
0 0 1 0 2 RA2/AN2
0 0 1 1 3 RA3/AN3
0 1 0 0 4 RA5/AN4
0 1 0 1 5 RE0/AN5
0 1 1 0 6 RE1/AN6
0 1 1 1 7 RE2/AN7
1 0 0 0 8 RB2/AN8
1 0 0 1 9 RB3/AN9
1 0 1 0 10 RB1/AN10
1 0 1 1 11 RB4/AN11
1 1 0 0 12 RB0/AN12
1 1 0 1 13 RB5/AN13
1 1 1 0 CVref
1 1 1 1 Vref = 0.6V
GO/DONE - A/D Conversion Status bit determines current status of conversion:
  • 1 - A/D conversion is in progress.
  • 0 - A/D conversion is complete. This bit is automatically cleared by hardware when the A/D conversion is complete.
ADON - A/D On bit enables A/D converter.
  • 1 - A/D converter is enabled.
  • 0 - A/D converter is disabled.
Let's do it in mikroC...
/* This example code reads analog value from channel 2 and displays it on PORTB and
PORTC as 10-bit binary number.*/

#include <built_in.h>
unsigned int adc_rd;

void main() {
    ANSEL = 0x04;               // Configure AN2 as analog pin
    TRISA = 0xFF;               // PORTA is configured as input
    ANSELH = 0;                 // Configure all other AN pins as digital I/O
    TRISC = 0x3F;               // Pins RC7 and RC6 are configured as outputs
    TRISB = 0;                  // PORTB is configured as an output
    
    do {
        temp_res = ADC_Read(2); // Get 10-bit result of AD conversion
        PORTB = temp_res;       // Send lower 8 bits to PORTB
        PORTC = temp_res >> 2;  // Send 2 most significant bits to RC7, RC6
    } while(1);                 // Remain in the loop
}

ADCON1 Register

pic-microcontrollers-programming-in-c-chapter-03-image-136
ADFM - A/D Result Format Select bit
  • 1 - Conversion result is right justified. Six most significant bits of the ADRESH are not used.
  • 0 - Conversion result is left justified. Six least significant bits of the ADRESL are not used.
VCFG1 - Voltage Reference bit selects negative voltage reference source needed for the operation of A/D converter.
  • 1 - Negative voltage reference is applied to the Vref- pin.
  • 0 - Power supply voltage Vss is used as negative voltage reference source.
VCFG0 - Voltage Reference bit selects positive voltage reference source needed for the operation of A/D converter.
  • 1 - Positive voltage reference is applied to the Vref+ pin.
  • 0 - Power supply voltage Vdd is used as positive voltage reference source.

In Short

In order to measure voltage on an input pin by the A/D converter, the following should be done: Step 1 - Port configuration:
  • Write a logic one (1) to a bit of the TRIS register, thus configuring the appropriate pin as an input.
  • Write a logic one (1) to a bit of the ANSEL register, thus configuring the appropriate pin as an analog input.
Step 2 - ADC module configuration:
  • Configure voltage reference in the ADCON1 register.
  • Select ADC conversion clock in the ADCON0 register.
  • Select one of input channels CH0-CH13 of the ADCON0 register.
  • Select data format using the ADFM bit of the ADCON1 register.
  • Enable A/D converter by setting the ADON bit of the ADCON0 register.
Step 3 - ADC interrupt configuration (optionally):
  • Clear the ADIF bit.
  • Set the ADIE, PEIE and GIE bits.
Step 4 - Wait for the required acquisition time to pass (approximately 20uS). Step 5 - Start conversion by setting the GO/DONE bit of the ADCON0 register. Step 6 - Wait for ADC conversion to complete.
  • It is necessary to check in the program loop whether the GO/DONE pin is cleared or wait for an A/D interrupt (must be previously enabled).
Step 7 - Read ADC results:
  • Read the ADRESH and ADRESL registers.

ANALOG COMPARATOR

In addition to A/D converter, there is another module, which until quite recently has been embedded only in integrated circuits belonging to the so called analog electronics. Owing to the fact that it is hardly possible to find any more complex automatic device which in some way does not use these circuits, two high quality comparators, along with additional electronics, are integrated into the microcontroller and connected to its pins. How does a comparator operate? Basically, the analog comparator is an amplifier which compares the magnitude of voltages at two inputs. It has two inputs and one output. Depending on which input has a higher voltage (analog value), a logic zero (0) or logic one (1) (digital values) will appear on its output:
pic-microcontrollers-programming-in-c-chapter-03-image-137
  • When the analog voltage at Vin- is higher than that at Vin+, the output of the comparator is a digital low level.
  • When the analog voltage at Vin+ is higher than that at Vin-, the output of the comparator is a digital high level.
The PIC16F887 microcontroller has two such voltage comparators the inputs of which are connected to I/O pins RA0-RA3, whereas the outputs are connected to the RA4 and RA5 pins. There is also a voltage reference internal source on the chip itself, which will be discussed later. These two circuits are under control of the bits stored in the following registers:
  • CM1CON0 is in control of comparator C1;
  • CM2CON0 is in control of comparator C2;
  • CM2CON1 is in control of comparator C2;

VOLTAGE REFERENCE INTERNAL SOURCE

One of two analog voltages provided on the comparator inputs is usually stable and unchangeable. It is called 'voltage reference'(Vref). To generate it, both external and special internal voltage source can be used. When the voltage source is selected, Vref is derived from it by means of a ladder network consisting of 16 resistors which form a voltage divider. The voltage source is selectable through the both ends of the divider by the VRSS bit of the VRCON register. In addition, the voltage fraction provided by the resistor ladder network may be selected through the bits VR0-VR3 and used as a voltage reference. See figure below.
pic-microcontrollers-programming-in-c-chapter-03-image-138
The comparator voltage reference has 2 ranges each containing 16 voltage levels. Range selection is controlled by the VRR bit of the VRCON register. The selected voltage reference CVref may be output to the RA2/AN2 pin. Even though the main idea was to obtain varying voltage reference for the operation of analog modules, a simple A/D converter is obtained thereby as well. This converter is very useful in some situations. Its operation is under control of the VRCON register.

COMPARATORS AND INTERRUPT

Every change of the logic state of any comparator’s output causes the flag bit CMIF of the register PIR to be set. Such changes will also cause an interrupt if the following bits are set:
  • The CMIE bit of the PIE register = 1;
  • The PEIE bit of the INTCON register = 1; and
  • The GIE bit of the INTCON register = 1.
If an interrupt is enabled, any change on the comparator’s output when the microcontroller is set in Sleep mode can cause the microcontroller to exit that mode and proceed with normal operation.

OPERATION DURING SLEEP

The comparator, if enabled before entering the Sleep mode, remains active during Sleep. If the comparator is not used to wake up the device, power consumption can be minimized in the Sleep mode by turning the comparator off. It is performed by clearing the CxON bit of the CMxCON0 register. To enable the comparator to wake up the microcontroller from sleep, the CxIE bit of the IE2 register and the PEIE bit of the INTCON register must be set. The instruction following the Sleep instruction is always executed after exiting the Sleep mode. If the GIE bit of the INTCON register is set, the device will execute the Interrupt Service Routine.

CM1CON0 Register

pic-microcontrollers-programming-in-c-chapter-03-image-139
Bits of this register are in control of the comparator C1. It mainly affects the configuration of its inputs. To understand it better, look at figure below which shows only a part of electronics directly affected by the bits of this register.
pic-microcontrollers-programming-in-c-chapter-03-image-140
C1ON - Comparator C1 Enable bit enables comparator C1.
  • 1 - Comparator C1 is enabled.
  • 0 - Comparator C1 is disabled.
C1OUT - Comparator C1 Output bit is the output of the comparator C1. If C1POL = 1 (comparator output is inverted)
  • 1 - Analog voltage at C1Vin+ is lower than analog voltage at C1Vin-.
  • 0 - Analog voltage at C1Vin+ is higher than analog voltage at C1Vin-.
If C1POL = 0 (comparator output is non-inverted)
  • 1 - Analog voltage at C1Vin+ is higher than analog voltage at C1Vin-.
  • 0 - Analog voltage at C1Vin+ is lower than analog voltage at C1Vin-.
C1OE Comparator C1 Output Enable bit.
  • 1 - Comparator C1OUT output is connected to the C1OUT pin.*
  • 0 - Comparator output is internal only.

* In order to enable the C1OUT bit to be present on the pin, two conditions must be met: C1ON = 1 (comparator must be on) and the corresponding TRIS bit = 0 (pin must be configured as an output).

C1POL - Comparator C1 Output Polarity Select bit enables the state of the comparator C1 output to be inverted.
  • 1 - Comparator C1 output is inverted.
  • 0 - Comparator C1 output is non-inverted.
C1R - Comparator C1 Reference Select bit
  • 1 - Non-inverting input C1Vin+ is connected to the reference voltage C1Vref.
  • 0 - Non-inverting input C1Vin+ is connected to the C1IN+ pin.
C1CH1, C1CH0 - Comparator C1 Channel Select bit
C1CH1 C1CH0 COMPARATOR C1VIN- INPUT
0 0 Input C1Vin- is connected to the C12IN0- pin
0 1 Input C1Vin- is connected to the C12IN1- pin
1 0 Input C1Vin- is connected to the C12IN2- pin
1 1 Input C1Vin- is connected to the C12IN3- pin

CM2CON0 Register

pic-microcontrollers-programming-in-c-chapter-03-image-141
Bits of this register are in control of the comparator C2. Similar to the previous case, figure below shows a simplified schematic of the circuit affected by the bits of this register.
pic-microcontrollers-programming-in-c-chapter-03-image-142
C2ON - Comparator C2 Enable bit enables comparator C2.
  • 1 - Comparator C2 is enabled; and
  • 0 - Comparator C2 is disabled.
C2OUT - Comparator C2 Output bit is the output of the comparator C2. If C2POL = 1 (comparator output inverted)
  • 1 - Analog voltage at C1Vin+ is lower than analog voltage at C1Vin-.
  • 0 - Analog voltage at C1Vin+ is higher than analog voltage at C1Vin-.
If C2POL = 0 (comparator output non-inverted)
  • 1 - Analog voltage at C1Vin+ is higher than analog voltage at C1Vin-.
  • 0 - Analog voltage at C1Vin+ is lower than analog voltage at C1Vin-.
C2OE - Comparator C2Output Enable bit
  • 1 - Comparator C2OUT output is connected to the C2OUT pin.*
  • 0 - Comparator output is internal only.

* In order to enable the C2OUT bit to be present on the pin, two conditions must be met: C2ON = 1 (comparator must be on) and the corresponding TRIS bit = 0 (pin must be configured as an output).

C2POL - Comparator C2 Output Polarity Select bit enables the state of the comparator C2 output to be inverted.
  • 1 - Comparator C2 output is inverted.
  • 0 - Comparator C2 output is non-inverted.
C2R - Comparator C2 Reference Select bit
  • 1 - Non-inverting input C2Vin+ is connected to the reference voltage C2Vref.
  • 0 - Non-inverting input C2Vin+ is connected to the C2IN+ pin.
C2CH1, C2CH0 Comparator C2 Channel Select bit
C2CH1 C2CH0 COMPARATOR C2VIN- INPUT
0 0 Input C2Vin- is connected to the C12IN0- pin
0 1 Input C2Vin- is connected to the C12IN1- pin
1 0 Input C2Vin- is connected to the C12IN2- pin
1 1 Input C2Vin- is connected to the C12IN3- pin

CM2CON1 Register

pic-microcontrollers-programming-in-c-chapter-03-image-143
MC1OUT Mirror Copy of C1OUT bit MC2OUT Mirror Copy of C2OUT bit C1RSEL Comparator C1 Reference Select bit
  • 1 - Selectable voltage CVref is used in the voltage reference C1Vref source.
  • 0 - Fixed voltage reference 0.6V is used in the voltage reference C1Vref source.
C2RSEL - Comparator C2 Reference Select bit
  • 1 - Selectable voltage CVref is used in the voltage reference C2Vref source.
  • 0 - Fixed voltage reference 0.6V is used in the voltage reference C2Vref source.
T1GSS - Timer1 Gate Source Select bit
  • 1 - Timer T1gate source is T1G.
  • 0 - Timer T1gate source is SYNCC2OUT.
C2SYNC - Comparator C2 Output Synchronization bit
  • 1 - Comparator C2 output is synchronized to the falling edge of Timer TMR1 clock.
  • 0 - Comparator output is asynchronous signal.
VRCON Register
pic-microcontrollers-programming-in-c-chapter-03-image-144
VREN Comparator C1 Voltage Reference Enable bit
  • 1 - Voltage reference CVref source is powered on.
  • 0 - Voltage reference CVref source is powered off.
VROE Comparator C2 Voltage Reference Enable bit
  • 1 - Voltage reference CVref is connected to the pin.
  • 0 - Voltage reference CVref is disconnected from the pin.
VRR - CVref Range Selection bit
  • 1 - Voltage reference source is set to low range.
  • 0 - Voltage reference source is set to high range.
VRSS - Comparator Vref Range selection bit
  • 1 - Voltage reference source is in the range of Vref+ to Vref-.
  • 0 - Voltage reference source is in the range of Vdd to Vss (power supply voltage).
VR3 - VR0 CVref Value Selection If VRR = 1 (low range) Voltage reference is calculated using the formula: CVref = ([VR3:VR0]/24)Vdd If VRR = 0 (high range) Voltage reference is calculated using the formula: CVref = Vdd/4 + ([VR3:VR0]/32)Vdds

In Short

In order to properly use built-in comparators, it is necessary to do the following: Step 1 - Module Configuration:
  • In order to select the appropriate mode, bits of the CM1CON0 and CM2CON0 registers should be configured. Interrupt should be disabled on any change of mode.
Step 2 - Internal voltage reference Vref source configuration (only when used). In the VRCON register it is necessary to:
  • Select one of two voltage ranges using the VRR bit.
  • Configure necessary Vref using bits VR3 - VR0.
  • Set the VROE bit if needed.
  • Enable voltage Vref source by setting the VREN bit.
Formula used to calculate voltage reference: VRR = 1 (low range) CVref = ([VR3:VR0]/24)VLADDER VRR = 0 (high range) CVref = (VLADDER/4) + ([VR3:VR0]VLADDER/32) Vladder = Vdd or ([Vref+] - [Vref-]) or Vref+ Step 3 - Start of operation:
  • Enable an interrupt by setting bits CMIE (PIE register), PEIE and GIE (INTCON register).
  • Read the C1OUT and C2OUT bits of the CMCON register.
  • Read the CMIF flag bit of the PIR register. After being set, this bit must be cleared in software.
  In order to synchronize all the processes taking place within the microcontroller, a clock signal must be used, while in order to generate the clock signal, a clock oscillator must be used. As simple as that. This microcontroller has several oscillators capable of working in different modes and this is where the story becomes interesting...

MIKROE

MIKROE is a development tools company dedicated to standardization and time-saving in the embedded industry.

  • About us
  • Success story
  • Contact
  • PressKit
  • Timeline
  • Partners
  • Legal
  • Distributors
  • Legacy Products

SOLUTIONS

  • Click boards™
  • Development boards
  • Mikromedia
  • CODEGRIP
  • NECTO Studio
  • Planet Debug
  • ClickID
  • Click Snap
  • EmbeddedWiki

SUPPORT

  • Helpdesk
  • Forum
  • Libstock
  • Learn
  • Let's Make
  • eBooks
  • Premium TS
  • Design service
  • Product Customization
  • Contract Manufacturing

STANDARD

  • mikroBUS™
  • mikroSDK
  • SiBRAIN
  • DISCON

Prodavnica za inostrano tržište

Nalazite se na prodavnici za inostrano tržište. Da li želite da Vas odvedemo na prodavnicu koja je namenjena za Srbiju?

Prodavnica za inostrano tržište

Nalazite se na prodavnici za inostrano tržište. Da li želite da Vas odvedemo na prodavnicu koja je namenjena za Srbiju?

Daily product releases, special offers, and more

  • FOLLOW US:

  • instagram
  • linkedin
  • facebook
  • github
  • newsletter
  • youtube
  • twitter twitter

Join us

Pridruži nam se

Careers
Internship
Posao
Napravi Click
Praksa
Copyright© 2025 MikroElektronika d.o.o.

Privacy