|
8 | 8 | </picture> |
9 | 9 | </a> |
10 | 10 |
|
11 | | -# PIC18F57Q43 I2C_Host Example Component for CNano Explorer: I/O Expander 2 LEDs and BUTTONs (Polled, Printf) |
| 11 | +# PIC18F57Q43 I2C_Host Example Component for CNano Explorer: IO Expander 2 - LEDs and Buttons Example (Polled, Printf) |
12 | 12 |
|
13 | | -When running this example using the MPLAB Data Visualizer, the following is what the output will look like. |
| 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 Polled implementation with the Printf visualization. |
14 | 16 |
|
15 | | - |
| 17 | + |
16 | 18 |
|
17 | | -This is the required MCC Melody Configuration to achieve this result. |
| 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). |
18 | 20 |
|
19 | | - |
| 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. |
20 | 22 |
|
21 | | -<!-- This is where the introduction to the example goes, including mentioning the peripherals used --> |
| 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: |
22 | 25 |
|
23 | | -## Related Documentation |
| 26 | + |
24 | 27 |
|
25 | | -<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links! |
26 | | - In addition a link to the device family landing page and relevant peripheral pages as well: |
27 | | - - [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/) |
28 | | - - [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) --> |
| 28 | +**Note:** Behaviour is not as reliable as in the Callbacks version. |
29 | 29 |
|
30 | | -## Software Used |
| 30 | +**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. |
31 | 31 |
|
32 | | -<!-- All software used in this example must be listed here. Use unbreakable links! |
33 | | - - MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide) |
34 | | - - MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers) |
35 | | - - MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator) |
36 | | - - 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) |
37 | | - - Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) --> |
| 32 | +## Setup |
| 33 | +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. |
| 34 | + |
38 | 35 |
|
39 | | -- 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) |
40 | | -- 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) |
| 36 | + |
41 | 37 |
|
42 | | -## Hardware Used |
| 38 | +## MCC Melody Example Components |
| 39 | +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. |
43 | 40 |
|
44 | | -<!-- All hardware used in this example must be listed here. Use unbreakable links! |
45 | | - - PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029) |
46 | | - - Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162) |
47 | | - - POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) --> |
48 | 41 |
|
49 | | -## Setup |
| 42 | +## Related Documentation |
50 | 43 |
|
51 | | -<!-- 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 --> |
| 44 | +- [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") |
| 45 | +- [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") |
52 | 46 |
|
53 | | -## Operation |
| 47 | +- [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") |
| 48 | + |
| 49 | +- [PIC18F57Q43 Data Sheet](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/DataSheets/PIC18F27-47-57Q43-Data-Sheet-40002147F.pdf "PIC18F57Q43 Data Sheet") |
| 50 | + |
| 51 | +## Software Used |
| 52 | +- [MPLAB® X IDE](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide) v6.25 or newer |
| 53 | +- [MPLAB® XC8](https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc8) v3.00 or newer |
| 54 | + |
| 55 | +- [MPLAB® Code Configurator](https://www.microchip.com/en-us/tools-resources/configure/mplab-code-configurator) (MCC) Plug-in v5.6.2 or newer (*Tools>Plugins>Installed*, search: "MCC") |
| 56 | +- [MPLAB® Data Visualizer](https://www.microchip.com/en-us/tools-resources/debug/mplab-data-visualizer) Plug-in v1.4.1926 or newer (*Tools>Plugins>Installed*, search: "Data Visualizer") |
| 57 | +- MCC Melody I2C_Host Example Component for the Curiosity Nano Explorer v1.0.0 or newer |
| 58 | +- MCC Core v5.8.2 or newer |
| 59 | +- Single Page Application (SPA) Host v1.0.0 or newer |
| 60 | +- MCC Melody Core v2.9.1 or newer |
54 | 61 |
|
55 | | -<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used --> |
| 62 | +Open the MCC Content Manager  to verify the MCC Core and MCC Melody Core versions. |
56 | 63 |
|
57 | | -## Summary |
| 64 | + |
58 | 65 |
|
59 | | -<!-- Summarize what the example has shown --> |
| 66 | +## Hardware Used |
| 67 | +- PIC18F57Q43 Curiosity Nano [(DM164150)](https://www.microchip.com/en-us/development-tool/DM164150) |
| 68 | +- Curiosity Nano Explorer [(EV58G97A)](https://www.microchip.com/en-us/development-tool/EV58G97A) |
0 commit comments