Skip to content

Commit

Permalink
MPAE-18859: Updated example for new versions of MPLAB, XC8 and DataVi…
Browse files Browse the repository at this point in the history
…sualizer
  • Loading branch information
Sindre Midjaas authored and egilro committed Nov 18, 2024
1 parent e07305d commit 98479e5
Show file tree
Hide file tree
Showing 32 changed files with 566 additions and 480 deletions.
57 changes: 9 additions & 48 deletions .main-meta/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
"metaDataVersion": "1.0.0",
"category": "com.microchip.ide.project",
"content": {
"metaDataVersion": "1.1.0",
"metaDataVersion": "1.3.0",
"name": "com.microchip.mcu8.mplabx.project.avr128db48-getting-started-with-opamp-mplab",
"version": "1.0.3",
"version": "2.0.0",
"displayName": "Getting Started with Analog Signal Conditioning (OPAMP)",
"projectName": "avr128db48-getting-started-with-opamp-mplab",
"shortDescription": "These MPLAB X bare metal examples in Getting Started with Analog Signal Conditioning (OPAMP) (TB3286), show how the OPAMP can be used on the AVR DB family of microcontrollers.The OPAMP peripheral features up to three internal operational amplifiers.",
"shortDescription": "These MPLAB X bare metal examples in Getting Started with Analog Signal Conditioning (OPAMP) (TB3286), show how the OPAMP can be used on the AVR DB family of microcontrollers.The OPAMP peripheral features up to three internal operational amplifiers.",
"ide": {
"name": "MPLAB X",
"semverRange": ">=5.40.0"
"semverRange": ">=6.20.0"
},
"compiler": [
{
"name": "XC8",
"semverRange": "^2.20.0"
"semverRange": "^2.50.0"
}
],
"dfp": {
"name": "AVR-Dx_DFP",
"semverRange": "^1.4.75"
"semverRange": "^2.6.303"
},
"configurator": {
"name": "N/A",
"semverRange": ""
"semverRange": " "
},
"device": {
"metaDataVersion": "1.0.0",
Expand All @@ -37,44 +37,11 @@
}
},
"author": "Microchip",
"subcategories": [
[
"Peripherals",
"OPAMP"
],
[
"Peripherals",
"ADC"
],
[
"Peripherals",
"DAC"
],
[
"Development Kit",
"AVR128DB48 Curiosity Nano"
],
[
"Supporting Tools",
"MPLAB Data Visualizer"
],
[
"Supporting Tools",
"MPLAB Mindi"
]
],
"peripherals": [
"OPAMP",
"ADC",
"DAC"
],
"peripherals": ["OPAMP", "DAC", "ADC", "TCB", "RTC", "USART"],
"keywords": [
"Analog Signal Conditioning",
"Getting Started",
"Digital-to-Analog Converter",
"Resistor Ladder",
"Adjustable Gain",
"Programmable Gain",
"Operational Amplifier",
"Op Amp",
"Simulation",
Expand All @@ -83,13 +50,7 @@
"Unity Gain Buffer",
"Battery Monitoring",
"Programmable Gain Amplifier",
"PGA",
"Differential Amplifier",
"Instrumentation Amplifier",
"Wheatstone Bridge",
"AVR-DB",
"AVRDB",
"getting-started-with-opamp"
"PGA"
],
"additionalData": {
"longDescription": {
Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,55 @@

# Getting Started with Analog Signal Conditioning (OPAMP)

The Analog Signal Conditioning (OPAMP) peripheral features up to three internal operational amplifiers (op amps). The op amps can be configured to a multitude of different operations using internal multiplexers and resistor laders
The Analog Signal Conditioning (OPAMP) peripheral features up to three internal operational amplifiers (op amps). The op amps can be configured to a multitude of different operations using internal multiplexers and resistor ladders.

The main purpose of op amps is to condition the analog signals before acquisition in a microcontroller or to provide the necessary output drive in control applications
The main purpose of op amps is to condition the analog signals before acquisition in a microcontroller or to provide the necessary output drive in control applications.

These examples show the following configurations of the OPAMP peripheral on the AVR DB family of microcontrollers:
These examples show the following configurations of the OPAMP peripheral on the AVR® DB family of microcontrollers:

* **Simple Op Amp:**
OP0 is connected directly to the pins
* **Voltage Follower:**
OP0 is configured as an voltage follower
OP0 is configured as a voltage follower
* **Non-Inverting PGA:**
OP0 is configured as a non-inverting PGA
* **Differential Amplifier:**
OP0 and OP1 are combined to create a differential amplifier
OP0 and OP1 are combined to create a differential amplifier
* **Instrumentation Amplifier:**
OP0, OP1 and OP2 are combined to create an instrumentation amplifier


## Related Documentation

* [TB3286 - Getting Started with Analog Signal Conditioning (OPAMP)](https://microchip.com/DS90003286)
* [TB3286 - Getting Started With Analog Signal Conditioning (OPAMP)](https://microchip.com/DS90003286)
* [AVR128DB48 Device Page](https://www.microchip.com/wwwproducts/en/AVR128DB48)
* [AVR128DB48 Curiosity Nano User Guide](https://www.microchip.com/DS50003037)


## Software Used

* [MPLAB® X IDE](https://www.microchip.com/mplab/mplab-x-ide) 5.40 or later
* MPLAB AVR-Dx_DFP version 1.4.75 or later
* For the Atmel Studio version of these projects, please go to [this repository](https://github.com/microchip-pic-avr-examples/avr128db48-getting-started-with-opamp-studio)
* [MPLAB® X IDE](https://www.microchip.com/mplab/mplab-x-ide) v6.20 or later
* [MPLAB® XC8](http://www.microchip.com/mplab/compilers) v2.50 or later
* MPLAB® AVR-Dx_DFP v2.6.303 or later
* [MPLAB® Data Visualizer Stand alone](https://www.microchip.com/mplab/mplab-data-visualizer) v1.3.1677 or later
* For the Atmel Studio version of these projects, please refer to [this repository](https://github.com/microchip-pic-avr-examples/avr128db48-getting-started-with-opamp-studio)

## Hardware Used

* [AVR128DB48 Curiosity Nano](https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/EV35L43A)

## Setup

All examples can be completed using the AVR128DB48 Curiosity Nano without any extra components
All examples can be completed using the AVR128DB48 Curiosity Nano without any extra components.

## Operation

* Connect the AVR128DB48 Curiosity Nano to a computer using a USB cable
* Clone the repository or download the zip to get the source code
* Open the .X projects with MPLAB
* Press *Make and Program Device* to run the example
* Open the `.X` projects with MPLAB
* Press **Make and Program Device** to run the example


## Summary

After going through these examples you should have a better understanding of how to configure the the OPAMP peripheral to achieve different modes of operation.
These examples facilitate a better understanding of how to configure the the OPAMP peripheral to achieve different modes of operation.
2 changes: 1 addition & 1 deletion data-visualizer/differential-amplifier.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"scheme":2,"settings":{"chart":{"panels":{"primary-graph":{"cursors":[],"trackSizes":{"vertical":[],"horizontal":[]}}},"axisProps":{"9f4944ca-04af-4cf8-9dac-3e55ba84894a":{"panelId":"primary-graph","active":false,"offset":-511,"scale":1020,"type":"data"},"74f1d19a-2ebe-4137-a4f6-ee05c6d2ae00":{"panelId":"primary-graph","active":false,"offset":-511,"scale":1020,"type":"data"},"primary-graph":{"panelId":"primary-graph","active":true,"offset":4539.114441643243,"scale":0.11841535675830528,"type":"time"}},"axisPositions":{"9f4944ca-04af-4cf8-9dac-3e55ba84894a":{"panelId":"primary-graph","orientation":"vertical","alignment":"before","track":0,"order":0},"74f1d19a-2ebe-4137-a4f6-ee05c6d2ae00":{"panelId":"primary-graph","orientation":"vertical","alignment":"before","track":0,"order":0},"primary-graph":{"panelId":"primary-graph","orientation":"horizontal","alignment":"after","track":0,"order":0}},"plotProps":{"f6198e62-9287-4eac-9cfc-b8d482443f4b":{"panelId":"primary-graph","sourceId":"decoder-2b02e2f0-911d-11ea-8339-0319212e835d$diff_input","color":"#f44e3b","lineMode":"linear"},"ba015a6f-9b21-4757-a109-f66fe67cc9fc":{"panelId":"primary-graph","sourceId":"decoder-2b02e2f0-911d-11ea-8339-0319212e835d$diff_output","color":"#a4dd00","lineMode":"linear"}},"plotPositions":{"f6198e62-9287-4eac-9cfc-b8d482443f4b":{"panelId":"primary-graph","hAxes":[],"vAxes":["9f4944ca-04af-4cf8-9dac-3e55ba84894a"]},"ba015a6f-9b21-4757-a109-f66fe67cc9fc":{"panelId":"primary-graph","hAxes":[],"vAxes":["74f1d19a-2ebe-4137-a4f6-ee05c6d2ae00"]}},"cursorProps":{},"inspector":{"enabled":true,"yPosition":31},"activeDataAxisId":"74f1d19a-2ebe-4137-a4f6-ee05c6d2ae00","prevColorChoiceIndex":-1},"terminal":{"characterSet":"iso-8859-1","filterControlChars":false,"hexMode":false,"echo":true,"lineEnd":"\r\n","terminalDirty":false},"ui":{"sidebars":{"left.sidebar":{"id":"left.sidebar","visible":true},"right.sidebar":{"id":"right.sidebar","visible":true}},"panels":{"connections.panel":{"id":"connections.panel","open":true},"connection.options.panel":{"id":"connection.options.panel","open":true}},"dialogs":[],"darkTheme":true,"devMode":false},"sourceSettings":{"byId":{"COM27":{"id":"COM27","formValues":{"baudRate":115200,"charLength":8,"stopBits":0,"parity":0,"invalid":-1}},"COM10":{"id":"COM10","formValues":{"baudRate":115200,"charLength":8,"stopBits":0,"parity":0,"invalid":-1}}}},"protocolShapes":{"byId":{"":{"fields":[{"id":"$diff_input","name":"diff_input","type":1,"offset":0},{"id":"$diff_output","name":"diff_output","type":1,"offset":2}],"id":"","name":"Decoder 1","frame":{"mode":{"label":"Auto","id":"auto"},"startOfFrame":0}}}},"protocols":{"byId":{"decoder-2b02e2f0-911d-11ea-8339-0319212e835d":{"fields":[{"id":"$diff_input","name":"diff_input","offset":0,"type":1},{"id":"$diff_output","name":"diff_output","offset":2,"type":1}],"frame":{"mode":"auto","startOfFrame":0},"id":"decoder-2b02e2f0-911d-11ea-8339-0319212e835d","name":"Decoder 1","outputs":["decoder-2b02e2f0-911d-11ea-8339-0319212e835d$diff_output","decoder-2b02e2f0-911d-11ea-8339-0319212e835d$diff_input"]}},"shapeSelection":{"decoder-2b02e2f0-911d-11ea-8339-0319212e835d":""},"statisticsById":{"decoder-2b02e2f0-911d-11ea-8339-0319212e835d":{"discardedByteCount":2,"decodedFrameCount":17374,"decodeRate":808,"hasProtocolMismatch":false}}},"links":{"byId":{"e54ae7e0-b146-11ea-9e0b-addb9980769c":{"sourceId":"COM10","sinkId":"decoder-2b02e2f0-911d-11ea-8339-0319212e835d"}}}}}
{"scheme":6,"settings":{"charts":{"byId":{"primary-graph":{"panel":{"cursors":[],"trackSizes":{"horizontal":[],"vertical":[]}},"axisProps":{"15":{"type":"data","scale":512,"offset":-128,"active":true},"primary-graph":{"type":"time","scale":0.10308655552921664,"offset":1596.4031765444709,"active":false}},"axisPositions":{"15":{"orientation":"vertical","track":0,"alignment":"before","order":0},"primary-graph":{"orientation":"horizontal","track":0,"alignment":"after","order":0}},"plotProps":{"16":{"sourceId":"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108:frame$diff_input","lineMode":"linear","color":"#d13913","hidden":false},"9bef46bd-6d49-46af-ac6e-e1bf3eb2c731":{"sourceId":"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108:frame$diff_output","lineMode":"linear","color":"#b9d26e","hidden":false}},"plotPositions":{"16":{"hAxes":[],"vAxes":["15"]},"9bef46bd-6d49-46af-ac6e-e1bf3eb2c731":{"hAxes":[],"vAxes":["15"]}},"activeDataAxisId":"15","cursorProps":{},"inspector":{"enabled":true},"powerAnalysis":{"enabled":false},"prevColorChoiceIndex":0},"xy-graph":{"panel":{"cursors":[],"trackSizes":{"horizontal":[],"vertical":[]}},"axisProps":{"17":{"type":"data","scale":256,"offset":0,"active":true},"18":{"type":"data","scale":256,"offset":0,"active":true}},"axisPositions":{"17":{"orientation":"vertical","track":0,"alignment":"before","order":0},"18":{"orientation":"horizontal","track":0,"alignment":"after","order":0}},"plotProps":{"19":{"sourceId":"","lineMode":"linear","color":"#009ce0"},"20":{"sourceId":"","lineMode":"linear","color":"#009ce0"}},"plotPositions":{"19":{"hAxes":[],"vAxes":["17"]},"20":{"hAxes":["18"],"vAxes":[]}},"cursorProps":{},"inspector":{"enabled":true},"powerAnalysis":{"enabled":false},"prevColorChoiceIndex":-1}}},"terminal":{"characterSet":"iso-8859-1","filterControlChars":false,"hexMode":false,"echo":true,"lineEnd":"\r\n","terminalDirty":false},"ui":{"panels":{"layout":{"type":"row","id":"#01b3ab14-526a-40a8-9782-80e2c18d31c1","children":[{"type":"row","id":"topColumn","children":[{"type":"tabset","id":"upper-tabset","children":[{"type":"tab","id":"graph","name":"Time Plot","component":"graph","config":{"id":"primary-graph","split":{"aWeight":0.75,"aMaximized":false}},"enableClose":true},{"type":"tab","id":"dashboard","name":"Dashboard","component":"dashboard","config":{"split":{"aWeight":0.75}},"enableClose":true}],"active":true},{"type":"tabset","id":"lower-tabset","children":[{"type":"tab","id":"terminal","name":"Terminal","component":"terminal","config":{"split":{"aWeight":0.75}},"enableClose":true},{"type":"tab","id":"xy","name":"XY Plot","component":"xy","config":{"id":"xy-graph","split":{"aWeight":0.75}},"enableClose":true}]}]}]},"borders":[{"type":"border","selected":1,"size":275,"location":"left","children":[{"type":"tab","id":"connections","name":"Connections","component":"connections","config":{"split":{"aMaximized":true}},"enableClose":false},{"type":"tab","id":"streamers","name":"Variable Streamers","component":"streamers","config":{"split":{"aWeight":0.47619047619047616,"aMaximized":false}},"enableClose":true},{"type":"tab","id":"templates","name":"Dashboard Widgets","component":"templates","config":{"split":{"aMaximized":true}},"enableClose":true}]}]},"dialogs":[],"darkTheme":true,"devMode":false},"sourceSettings":{"byId":{"COM9":{"id":"COM9","formValues":{"baudRate":115200,"charLength":8,"stopBits":0,"parity":0,"invalid":-1}}}},"protocolShapes":{"byId":{"624":{"frames":[{"fields":[{"id":"$diff_input","name":"diff_input","type":1,"offset":0},{"id":"$diff_output","name":"diff_output","type":1,"offset":2}],"mode":{"label":"Auto","id":"auto"},"startOfFrame":0,"name":"frame"}],"id":"624","name":"data_stream"}}},"protocols":{"byId":{"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108":{"id":"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108","name":"data_stream","type":"DataStreamProtocol","specific":{"auto-config-enabled":1},"settingsModel":[{"name":"auto-config-enabled","label":"Auto-config enabled","tip":null,"type":"checkbox","units":"","min":0,"max":1,"options":[]}],"statusFields":{},"statusModel":[],"statisticsModel":{"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108:frame":[{"name":"decoded-frame-count","label":"Frames received","tip":"The number of frames decoded","type":"number","units":"","min":null,"max":null,"options":[]},{"name":"decoded-rate","label":"Frame rate","tip":"The rate at which frames are being decoded","type":"number","units":"/s","min":null,"max":null,"options":[]},{"name":"valid-byte-count","label":"Accepted data","tip":"The number of valid bytes received by this frame","type":"number","units":"bytes","min":null,"max":null,"options":[]},{"name":"discarded-byte-count","label":"Discarded data","tip":"The number of bytes discarded during decoding for this frame","type":"number","units":"bytes","min":null,"max":null,"options":[]}],"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108:Auto-configure":[{"name":"decoded-frame-count","label":"Frames received","tip":"The number of frames decoded","type":"number","units":"","min":null,"max":null,"options":[]},{"name":"decoded-rate","label":"Frame rate","tip":"The rate at which frames are being decoded","type":"number","units":"/s","min":null,"max":null,"options":[]},{"name":"valid-byte-count","label":"Accepted data","tip":"The number of valid bytes received by this frame","type":"number","units":"bytes","min":null,"max":null,"options":[]},{"name":"discarded-byte-count","label":"Discarded data","tip":"The number of bytes discarded during decoding for this frame","type":"number","units":"bytes","min":null,"max":null,"options":[]}]},"outputs":["decoder-4c60a4f0-95eb-11ef-8507-9da600d12108:frame"],"connected":false,"streaming":true,"frames":[{"name":"frame","fields":[{"id":"$diff_input","name":"diff_input","offset":0,"type":1,"expressionString":null},{"id":"$diff_output","name":"diff_output","offset":2,"type":1,"expressionString":null}],"mode":{"label":"Auto","id":"auto"},"startOfFrame":0,"columns":[],"fieldLimit":-1},{"name":"Auto-configure","fields":[],"mode":{"label":"Ones' Complement","id":"ones-complement"},"startOfFrame":95,"columns":[],"fieldLimit":-1}]}},"shapeSelection":{"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108":"624"},"symbolsById":{}},"links":{"byId":{"5e6cda60-95eb-11ef-8507-9da600d12108":{"sourceId":"COM9","sinkId":"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108"}}},"pluginSettings":{"byId":{}},"dashboards":{"byId":{}},"autoConfig":{"byId":{"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108":{"id":"decoder-4c60a4f0-95eb-11ef-8507-9da600d12108","props":{"search-path":"C:\\Users\\x55792\\MPLABXProjects\\avr128db48-getting-started-with-opamp-mplab\\differential-amplifier.X","search-path-override":false,"recursive-search":1,"status":"INITIAL","maximize-dashboard":1},"type":"streamer","settingsModel":[{"name":"search-path","label":"Search path","tip":null,"type":"filepath","units":"","min":null,"max":null,"options":[]},{"name":"recursive-search","label":"Recursive search","tip":null,"type":"checkbox","units":"","min":0,"max":1,"options":[]},{"name":"maximize-dashboard","label":"Maximize dashboard","tip":null,"type":"checkbox","units":"","min":0,"max":1,"options":[]}]}}}}}
Loading

0 comments on commit 98479e5

Please sign in to comment.