You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"shortDescription": "LED chaser increments binary on 6 LEDs every 100 ms. When all on, toggles 8 LEDs every sec. Uses Timer driver callbacks to switch from 100 to 1000 ms. Shows hex/binary of I/O pins via UART printf.",
Copy file name to clipboardExpand all lines: README.md
+36-28Lines changed: 36 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,53 +10,61 @@
10
10
11
11
# AVR128DB48 I2C_Host Example Component for CNano Explorer: I/O Expander 1 LEDs (Callbacks, Printf)
12
12
13
-
The following is the output for this example.
14
-
Notice the delta 99.6 ms in the B and the 1.11 s in the C columns, respectively of the time plot. The difference from 100 ms, is simply due to the positioning of the cursor.
), 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.
The example implements an LED chaser, incrementing the binary number on the lower six LEDs every 100 ms. Once the six active-low LEDs are all on, the pattern changes to toggle all eight LEDs every second.
20
+
21
+
The callbacks implementation uses the Timer driver. To handle the change from 100 to 1000 ms, the timer period is changed and a new timer callback is used. The hex and binary values of the I/O expander pins are displayed as a printf message over the Universal Asynchronous Receiver and Transmitter (UART).
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.
**Note:** the delta 99.6 ms in the B and the 1.11 s in the C columns, respectively of the time plot. The difference from 100 ms, is simply due to the positioning of the cursor.
17
28
18
-
The MCC Melody configuration is as shown in the following image.
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.
<!-- This is where the introduction to the example goes, including mentioning the peripherals used -->
25
37
26
-
## Related Documentation
27
38
28
-
<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links!
29
-
In addition a link to the device family landing page and relevant peripheral pages as well:
30
-
- [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/)
31
-
- [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) -->
39
+
## MCC Melody Example Components
40
+
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.
32
41
33
-
## Software Used
34
42
35
-
<!-- All software used in this example must be listed here. Use unbreakable links!
36
-
- MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
37
-
- MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
38
-
- MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
- Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) -->
43
+
## Related Documentation
41
44
42
-
-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)
43
-
-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)
45
+
-[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")
46
+
-[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")
44
47
45
-
## Hardware Used
48
+
-[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")
46
49
47
-
<!-- All hardware used in this example must be listed here. Use unbreakable links!
- Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162)
50
-
- POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) -->
50
+
-[AVR128DB48 Data Sheet](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB28-32-48-64-DataSheet-DS40002247A.pdf"AVR128DB48 Data Sheet")
51
51
52
-
## Setup
52
+
## Software Used
53
+
-[MPLAB® X IDE](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide) v6.25 or newer
54
+
-[MPLAB® XC8](https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc8) v3.00 or newer
53
55
54
-
<!-- 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 -->
56
+
-[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")
57
+
-[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")
58
+
- MCC Melody I2C_Host Example Component for the Curiosity Nano Explorer 1.0.0 or newer
59
+
- MCC Core v5.8.2 or newer
60
+
- Single Page Application (SPA) Host v1.0.0 or newer
61
+
- MCC Melody Core v2.9.1 or newer
55
62
56
-
## Operation
63
+
Open the MCC Content Manager  to verify the MCC Core and MCC Melody Core versions.
57
64
58
-
<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
Copy file name to clipboardExpand all lines: avr128db48-i2c-io-expander1-leds-callbacks-printf.X/avr128db48-i2c-io-expander1-leds-callbacks-printf.mc3.bak0
Copy file name to clipboardExpand all lines: avr128db48-i2c-io-expander1-leds-callbacks-printf.X/avr128db48-i2c-io-expander1-leds-callbacks-printf.mc3.bak1
0 commit comments