Skip to content

This MPLAB X bare metal example in Constant-Current Driver Using the Analog Signal Conditioning (OPAMP) Peripheral (AN3632), shows how to use the OPAMP to implement a constant-current driver using just one external resistor. The OPAMP peripheral also provides the ability to adjust the current setting under firmware control.

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/avr128db48-constant-current-driver-using-opamp-mplab

Repository files navigation

MCHP

Constant-Current Driver Using the Analog Signal Conditioning (OPAMP) Peripheral

A new feature introduced in the AVR® DB MCU is the Analog Signal Conditioning (OPAMP) peripheral. In this example, the OPAMP is used as a constant-current driver using a single external resistor. It can be used to drive a load such as LEDs, with constant current and not constant voltage. The OPAMP peripheral also provides the ability to adjust the current setting under firmware control. The configuration for this example can be seen in the figure above. For more information about setup and code, see the application note.

Related Documentation

Software Used

Hardware Used

Setup

  • Connect the hardware together as seen in the schematic of the application note

Operation

  • Connect the AVR128DB48 Curiosity Nano to a computer using a USB cable
  • Download the zip file or clone the example to get the source code
  • Open avr128db48-constant-current-driver-using-opamp.X in MPLAB
  • Press the make and program button to program the device
  • If no tool has been chosen, a window will open, select the AVR128DB48 Curiosity Nano. Tool can also be choosen in the project settings.

Conclusion

After going through this example you should have a better understanding of how to set up the OPAMP peripheral as a constant current driver for a load.

About

This MPLAB X bare metal example in Constant-Current Driver Using the Analog Signal Conditioning (OPAMP) Peripheral (AN3632), shows how to use the OPAMP to implement a constant-current driver using just one external resistor. The OPAMP peripheral also provides the ability to adjust the current setting under firmware control.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published