|
1 | | -<!-- MPAE-19451 Please do not change this logo with link --> |
| 1 | +<!-- MPAE-19445 Please do not change this logo with link --> |
2 | 2 |
|
3 | 3 | <a target="_blank" href="https://www.microchip.com/" id="top-of-page"> |
4 | 4 | <picture> |
|
8 | 8 | </picture> |
9 | 9 | </a> |
10 | 10 |
|
11 | | -# AVR128DB48 I2C_Host Example Component for CNano Explorer: I2C Proximity Sensor (Callbacks, Data Streamer) |
| 11 | +# AVR128DB48 I<sup>2</sup>C_Host Example Component for CNano Explorer: I<sup>2</sup>C Proximity Sensor (Callbacks, Data Streamer) |
12 | 12 |
|
13 | | -When running the application, using the MPLAB Data Visualizer, you should see something similar to the following: |
14 | | - |
| 13 | +The [I<sup>2</sup>C Proximity Sensor example](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.EX.RUNNING.I2C.HOST.PROXIMITY.SENSOR&version=latest&redirect=true "I2C Proximity Sensor example" |
| 14 | +), of the [MCC Melody I<sup>2</sup>C Example Component (for the Curiosity Nano Explorer)](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.EXAMPLE.COMPONENT&version=latest&redirect=true "MCC Melody I<sup>2</sup>C Example Component for the Curiosity Nano Explorer" |
| 15 | +), is used here in the Polled implementation, with the Data Streamer visualization. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +This example demonstrates how to read the value of the VCNL4200 proximity sensor on the Curiosity Nano Explorer, with the DV Run Time Visualization Output selected. Every 100 ms, an LED and a Debug I/O pin are toggled. Depending on the DVRT streaming tick setting (default is 100 ms), the appropriately formatted values of the variables added to the DVRT Streaming Table are sent to the [MPLAB® Data Visualizer](https://www.microchip.com/en-us/tools-resources/debug/mplab-data-visualizer "MPLAB® Data Visualizer"). |
| 20 | + |
| 21 | +The below image of the MPLAB Data Visualizer shows the application running, where proximityValue and framecount have been added to the DVRT Streaming Table and Time Plot: |
| 22 | + |
| 23 | + |
| 24 | +The following is a block diagram view of the application, as seen in the [MCC Melody Builder](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MCC.MELODY.BUILDER&version=latest&redirect=true "MCC Melody Builder"). |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +## MCC Melody Example Components |
| 29 | +Example Components are a tight integration of learning material directly into MCC. This allows users to conveniently place the configuration instructions side-by-side to the components they are configuring. For more information, refer to the [MCC Melody Example Components](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MCC.MELODY.EXAMPLES&version=latest&redirect=true) introduction. |
15 | 30 |
|
16 | | -The following is the required MCC Melody configuration. |
17 | | - |
18 | | -<!-- This is where the introduction to the example goes, including mentioning the peripherals used --> |
19 | 31 |
|
20 | 32 | ## Related Documentation |
21 | 33 |
|
22 | | -<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links! |
23 | | - In addition a link to the device family landing page and relevant peripheral pages as well: |
24 | | - - [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/) |
25 | | - - [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) --> |
| 34 | +- [MCC Melody I<sup>2</sup>C Example Component (for the Curiosity Nano Explorer)](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.EXAMPLE.COMPONENT&version=latest&redirect=true "MCC Melody I<sup>2</sup>C Example Component for the Curiosity Nano Explorer") |
| 35 | +- [MCC Melody Design Patterns for Control Flow](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.EXAMPLE.COMPONENT&version=latest&redirect=true "MCC Melody I<sup>2</sup>C Example Component for the Curiosity Nano Explorer") |
| 36 | + |
| 37 | +- [Curiosity Nano Explorer User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/PIC18F57Q43-Curiosity-Nano-HW-UserGuide-DS40002186B.pdf "Curiosity Nano Explorer Users Guide") |
| 38 | + |
| 39 | +- [PIC18F57Q43 Data Sheet](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/DataSheets/PIC18F27-47-57Q43-Data-Sheet-40002147F.pdf "PIC18F57Q43 Data Sheet") |
26 | 40 |
|
27 | 41 | ## Software Used |
| 42 | +- MPLAB® X IDE 6.25.0 or newer [(MPLAB® X IDE 6.25.0)](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide) |
| 43 | +- MPLAB® XC8 3.00.0 or newer [(MPLAB® XC8 3.00.0)](https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc8) |
| 44 | + |
| 45 | +- MPLAB® Code Configurator (MCC) Plug-in Version 5.5.2 or newer (*Tools>Plugins>Installed*, search: "MCC") |
| 46 | +- MPLAB Data Visualizer Plug-in Version 1.4.1926 or newer (*Tools>Plugins>Installed*, search: "Data Visualizer") |
| 47 | +- MCC Melody I2C_Host Example Component for the Curiosity Nano Explorer 1.0.0 or newer |
| 48 | +- MCC Core 5.7.1 or newer |
| 49 | +- MCC Melody Core 2.8.1 or newer |
28 | 50 |
|
29 | | -<!-- All software used in this example must be listed here. Use unbreakable links! |
30 | | - - MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide) |
31 | | - - MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers) |
32 | | - - MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator) |
33 | | - - MPLAB® Code Configurator (MCC) Device Libraries PIC10 / PIC12 / PIC16 / PIC18 MCUs [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator) |
34 | | - - Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) --> |
| 51 | +Open the MCC Content Manager to verify the MCC Core and MCC Melody Core versions. |
35 | 52 |
|
36 | | -- MPLAB® X IDE 6.25.0 or newer [(MPLAB® X IDE 6.25)](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide) |
37 | | -- MPLAB® XC8 3.0.0 or newer compiler [(MPLAB® XC8 3.0)](https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc8) |
| 53 | + |
38 | 54 |
|
39 | 55 | ## Hardware Used |
| 56 | +- PIC18F57Q43 Curiosity Nano [(DM164150)](https://www.microchip.com/en-us/development-tool/DM164150) |
| 57 | +- Curiosity Nano Explorer [(EV58G97A)](https://www.microchip.com/en-us/development-tool/EV58G97A) |
40 | 58 |
|
41 | | -<!-- All hardware used in this example must be listed here. Use unbreakable links! |
42 | | - - PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029) |
43 | | - - Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162) |
44 | | - - POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) --> |
45 | 59 |
|
46 | 60 | ## Setup |
47 | 61 |
|
48 | | -<!-- Explain how to connect hardware and set up software. Depending on complexity, step-by-step instructions and/or tables and/or images can be used --> |
| 62 | +The following outlines the complete MCC Melody configuration, including all the selected tasks that have been implemented in this example. |
| 63 | + |
| 64 | + |
49 | 65 |
|
50 | | -## Operation |
| 66 | +[Data Visualizer Setup](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.DATA.VISUALIZER.SETUP&version=latest&redirect=true) |
51 | 67 |
|
52 | | -<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used --> |
| 68 | +To run the example, follow the steps in the Data Visualizer Setup section: |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +- [Data Visualizer Debug GPIO Setup](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.EX.DV.DEBUG.IO&version=latest&redirect=true) |
| 73 | +- [Data Visualizer Setup for DV Run Time](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.EX.DVRUNTIME.CONFIG&version=latest&redirect=true) |
53 | 74 |
|
54 | 75 | ## Summary |
| 76 | +For more example components, follow these steps: |
| 77 | + |
| 78 | +1) Open the stand-alone Content Manager  in MPLAB X IDE. |
| 79 | +2) Filter on Melody content. |
| 80 | +3) Filter on MCU device (optional, leave blank to find all). |
| 81 | +4) Expand Examples category under Content Libraries. |
55 | 82 |
|
56 | | -<!-- Summarize what the example has shown --> |
| 83 | + |
0 commit comments