|
10 | 10 |
|
11 | 11 | # AVR128DB48 I2C_Host Example Component for CNano Explorer: I/O Expander 2 LEDs and BUTTONs (Callbacks, Printf) |
12 | 12 |
|
13 | | -When running the application, using the MPLAB Data Visualizer, you should see something similar to the following: |
| 13 | +The [I<sup>2</sup>C Host IO Expander 2 - LEDs and Buttons Example](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.EX.RUNNING.I2C.HOST.IOEXPANDER2.LEDS.BUTTONS&version=latest&redirect=true "I2C Host IO Expander 1 - LEDs 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 Callbacks implementation with the Printf visualization. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +On the Curiosity Nano Explorer, the pins on the I<sup>2</sup>C I/O Expander 1 are connected to active-low LEDs, while the pins on the I<sup>2</sup>C I/O Expander 2 are connected to buttons (SW1, SW2 and SW3) as well as the joystick inputs (left, right, up, down, press). |
| 20 | + |
| 21 | +This example configures the I/O Expander 1 pins as outputs set LOW, so the active-low LEDs are initially all turned on. The I/O Expander 2 pins are configured as digital inputs. As a button press or joystick input is detected, the associated LED is turned off. The Curiosity Nano's SW is configured as a reset, turning on all the LEDs again. In Callback mode, pin change interrupts are used on both the SW input pin (IO_Reset), as well as the IO_IOExpander2_IRQ. |
| 22 | + |
| 23 | +## Operation |
| 24 | +When running the application using the [MPLAB® Data Visualizer](https://www.microchip.com/en-us/tools-resources/debug/mplab-data-visualizer "MPLAB® Data Visualizer"), you should see something similar to the following: |
| 25 | + |
14 | 26 |  |
| 27 | +**Note:** Debug I/O is not actively used. However, since the SW pin on the Curiosity Nano is a Debug I/O pin, so when pushing the IO_Reset, a toggle is picked up on the Debug I/O pin. |
15 | 28 |
|
16 | | -The following is the required MCC Melody configuration. |
| 29 | +## Setup |
| 30 | +The image below outlines the complete MPLAB Code Configurator (MCC) Melody configuration, including all the selected tasks implemented in this example, as seen in the MCC Melody Builder. |
17 | 31 |  |
18 | | -<!-- This is where the introduction to the example goes, including mentioning the peripherals used --> |
19 | 32 |
|
20 | | -## Related Documentation |
| 33 | + |
21 | 34 |
|
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) --> |
26 | 35 |
|
27 | | -## Software Used |
| 36 | +## MCC Melody Example Components |
| 37 | +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. |
28 | 38 |
|
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/) --> |
35 | 39 |
|
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) |
| 40 | +## Related Documentation |
38 | 41 |
|
39 | | -## Hardware Used |
| 42 | +- [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") |
| 43 | +- [MCC Melody Design Patterns for Control Flow](https://onlinedocs.microchip.com/g/GUID-7CE1AEE9-2487-4E7B-B26B-93A577BA154E "MCC Melody Design Patterns for Control Flow") |
40 | 44 |
|
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 | +- [Curiosity Nano Explorer User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/AVR128DB48-Curiosity-Nano-HW-UserGuide-DS40002186B.pdf "Curiosity Nano Explorer Users Guide") |
45 | 46 |
|
46 | | -## Setup |
| 47 | +- [AVR128DB48 Data Sheet](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB28-32-48-64-DataSheet-DS40002247A.pdf "AVR128DB48 Data Sheet") |
47 | 48 |
|
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 --> |
| 49 | +## Software Used |
| 50 | +- [MPLAB® X IDE](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide) v6.25 or newer |
| 51 | +- [MPLAB® XC8](https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc8) v3.00 or newer |
49 | 52 |
|
50 | | -## Operation |
| 53 | +- [MPLAB® Code Configurator](https://www.microchip.com/en-us/tools-resources/configure/mplab-code-configurator) (MCC) Plug-in Version v5.6.2 or newer (*Tools>Plugins>Installed*, search: "MCC") |
| 54 | +- [MPLAB® Data Visualizer](https://www.microchip.com/en-us/tools-resources/debug/mplab-data-visualizer) Plug-in Version v1.4.1926 or newer (*Tools>Plugins>Installed*, search: "Data Visualizer") |
| 55 | +- MCC Melody I2C_Host Example Component for the Curiosity Nano Explorer 1.0.0 or newer |
| 56 | +- MCC Core v5.8.2 or newer |
| 57 | +- Single Page Application (SPA) Host v1.0.0 or newer |
| 58 | +- MCC Melody Core v2.9.1 or newer |
51 | 59 |
|
52 | | -<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used --> |
| 60 | +Open the MCC Content Manager  to verify the MCC Core and MCC Melody Core versions. |
53 | 61 |
|
54 | | -## Summary |
| 62 | + |
| 63 | + |
| 64 | +## Hardware Used |
| 65 | +- AVR128DB48 Curiosity Nano [(EV35L43A)](https://www.microchip.com/en-us/development-tool/EV35L43A) |
| 66 | +- Curiosity Nano Explorer [(EV58G97A)](https://www.microchip.com/en-us/development-tool/EV58G97A) |
55 | 67 |
|
56 | | -<!-- Summarize what the example has shown --> |
|
0 commit comments