Skip to content

Commit b784bcf

Browse files
committed
MPAE-19433 project working, readme and main-meta updated
1 parent 45788f0 commit b784bcf

21 files changed

+226
-855
lines changed

.main-meta/main.json

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"content": {
55
"metaDataVersion": "1.3.0",
66
"name": "com.microchip.mcu8.mplabx.project.avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors",
7-
"version": " ",
8-
"displayName": "",
7+
"version": "1.0.0",
8+
"displayName": "avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors",
99
"projectName": "avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors",
1010
"shortDescription": "I2C write tried for all client addresses. ACK/NACK printed via UART. On completion, valid I2C addresses with ACK shown in printf message.",
1111
"ide": {
@@ -19,12 +19,12 @@
1919
}
2020
],
2121
"dfp": {
22-
"name": "",
23-
"semverRange": ""
22+
"name": "AVR-Dx_DFP",
23+
"semverRange": "^2.7.321"
2424
},
2525
"configurator": {
26-
"name": "",
27-
"semverRange": ""
26+
"name": "MCC",
27+
"semverRange": "^5.6.2"
2828
},
2929
"device": {
3030
"metaDataVersion": "1.0.0",
@@ -37,8 +37,23 @@
3737
}
3838
},
3939
"author": "Glen Nilsen",
40-
"peripherals": [],
41-
"keywords": [],
40+
"peripherals": [
41+
"I2C",
42+
"GPIO",
43+
"UART"
44+
],
45+
"keywords": [
46+
"Data Visualizer",
47+
"MPLAB Data Visualizer",
48+
"I2C",
49+
"UART",
50+
"Getting Started",
51+
"Melody",
52+
"MCC Melody",
53+
"Curiosity Nano Explorer",
54+
"Example Components",
55+
"MCC Melody Example Components"
56+
],
4257
"additionalData": {
4358
"longDescription": {
4459
"metaDataVersion": "1.0.0",

README.md

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,61 @@
99
</a>
1010

1111
# AVR128DB48 I2C_Host Example Component for CNano Explorer: Find all I2C Clients on Bus (Callbacks, Printf-errors)
12-
The following is the output, when Printf is selected as the Visualization Output.
1312

14-
![alt text](images/Find_all_i2c_clients_callbacks_printf_avrDB.png)
13+
The [I<sup>2</sup>C Host Find all Clients Example](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=I2C.HOST.EX.RUNNING.I2C.HOST.FIND.CLIENTS&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 Callbacks implementation, with the Printf with error handling visualization.
1516

16-
Full confgiguration.
17-
![alt text](images/Find_all_i2c_clients_callbacks_printfErrors_avrDB_configuration.png)
17+
![alt text](images/Find_all_i2c_clients_callbacks_printf_avrDB_intro.png)
1818

19-
The same configuration, when Printf with error handling is selected, generates the following output:
19+
20+
In this example, an I<sup>2</sup>C write is attempted for all possible I<sup>2</sup>C client addresses to identify clients that respond with an ACK. This builds up a list of valid I2C_Client addresses on the bus, displaying this as a printf message over the Universal Asynchronous Receiver and Transmitter (UART). The example uses a polled implementation.
21+
22+
As each address is attempted in the Prinft with Error Checking visualization output, an Acknowledge (ACK) or No-Acknowledge (NACK) message is printed over the UART.
23+
24+
When using the [MPLAB® Data Visualizer](https://www.microchip.com/en-us/tools-resources/debug/mplab-data-visualizer "MPLAB® Data Visualizer"), after configuring the Terminal to a baudrate of 115200 and clicking to 'display as text in the terminal' the example will look as shown below.
25+
26+
The below image of the MPLAB Data Visualizer shows the application running on the Curiosity Nano Explorer board, where ten client devices have been found:
2027

2128
![alt text](images/Find_all_i2c_clients_callbacks_printfErrors_avrDB.png)
2229

23-
<!-- This is where the introduction to the example goes, including mentioning the peripherals used -->
30+
## Setup
2431

25-
## Related Documentation
32+
The following outlines the complete MCC Melody configuration, including all the selected tasks that have been implemented in this example, as seen in the MPLAB Code Configurator (MCC) Melody Builder.
2633

27-
<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links!
28-
In addition a link to the device family landing page and relevant peripheral pages as well:
29-
- [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/)
30-
- [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) -->
34+
![alt text](images\Find_all_i2c_clients_callbacks_printfErrors_avrDB_configuration.png)
3135

32-
## Software Used
3336

34-
<!-- All software used in this example must be listed here. Use unbreakable links!
35-
- MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
36-
- MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
37-
- MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
38-
- 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)
39-
- Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) -->
4037

41-
- 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)
42-
- 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)
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.
4340

44-
## Hardware Used
4541

46-
<!-- All hardware used in this example must be listed here. Use unbreakable links!
47-
- PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029)
48-
- Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162)
49-
- POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) -->
42+
## Related Documentation
5043

51-
## Setup
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")
5246

53-
<!-- 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 -->
47+
- [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")
5448

55-
## Operation
49+
- [AVR128DB48 Data Sheet](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB28-32-48-64-DataSheet-DS40002247A.pdf "AVR128DB48 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
5654

57-
<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
55+
- [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")
56+
- [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")
57+
- MCC Melody I2C_Host Example Component for the Curiosity Nano Explorer 1.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
5861

59-
## Summary
62+
Open the MCC Content Manager ![CM_icon](images/Icon-MPLAB-CM24.png) to verify the MCC Core and MCC Melody Core versions.
63+
64+
![alt text](images/MCC_Core_ContentLibrary_Versions_SPA.png)
65+
66+
## Hardware Used
67+
- AVR128DB48 Curiosity Nano [(EV35L43A)](https://www.microchip.com/en-us/development-tool/EV35L43A)
68+
- Curiosity Nano Explorer [(EV58G97A)](https://www.microchip.com/en-us/development-tool/EV58G97A)
6069

61-
<!-- Summarize what the example has shown -->

avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.X/avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.mc3

Lines changed: 16 additions & 16 deletions
Large diffs are not rendered by default.

avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.X/avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.mc3.bak0

Lines changed: 0 additions & 93 deletions
This file was deleted.

avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.X/avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.mc3.bak1

Lines changed: 0 additions & 93 deletions
This file was deleted.

avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.X/avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.mc3.bak2

Lines changed: 0 additions & 284 deletions
This file was deleted.

avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.X/avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.mc3.bak3

Lines changed: 0 additions & 284 deletions
This file was deleted.

avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.X/main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* @ingroup i2c_host example
2727
*
28-
* @version I2C_HOST EXAMPLE Example Version 1.0.0
28+
* @version I2C_HOST EXAMPLE Example Version 1.0.1
2929
*
3030
* @brief Generated file for
3131
* Example: 1. Find all I2C clients on bus
@@ -92,7 +92,8 @@ uint8_t I2C_ProbeAll(const i2c_host_interface_t* i2cHost, uint8_t *deviceAddress
9292
void I2C_FindAndReportDevices(void)
9393
{
9494
uint8_t devicesFound = 0;
95-
uint8_t deviceAddresses[128];
95+
uint8_t deviceAddresses[64]; // Note: Adjust the size of this array if memory constraints arise.
96+
// This array only needs to store the addresses of successfully detected devices.
9697

9798
devicesFound = I2C_ProbeAll(i2cHost, deviceAddresses);
9899

@@ -112,7 +113,8 @@ int main(void)
112113

113114
SYSTEM_Initialize();
114115

115-
(int) printf("Example: 1. Find all I2C clients on bus, Implementation: Interrupts with callbacks, Visualization: Printf with error handling\r\n\r\n");
116+
(int) printf("Example: 1. Find all I2C clients on bus, Implementation: Interrupts with callbacks, Visualization: Printf with error handling\r\n");
117+
(int) printf("MCU Device family: AVR \r\n\r\n");
116118
(int) printf("Looking for all devices on i2cHost\r\n");
117119
I2C_FindAndReportDevices();
118120

avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.X/mcc-manifest-autosave.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
manifest_file_version: 1.0.0
44
project: avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors
5-
creation_date: 2025-04-10T12:56:46.868+02:00[Europe/Berlin]
5+
creation_date: 2025-10-20T14:22:33.400+02:00[Europe/Berlin]
66
operating_system: Windows 11
77
mcc_mode: IDE
88
mcc_mode_version: v6.25
99
device_name: AVR128DB48
1010
compiler: XC8 3.00
11-
mcc_version: 5.5.2
12-
mcc_core_version: 5.7.1
13-
content_manager_version: 5.0.1
11+
mcc_version: 5.6.2
12+
mcc_core_version: 5.8.2
13+
content_manager_version: 6.0.3-rc.a
1414
is_mcc_offline: false
15-
is_using_prerelease_versions: true
16-
mcc_content_registries: https://registry.npmjs.org/,https://artifacts.microchip.com/artifactory/api/npm/npm/
17-
device_library: {library_class: com.microchip.mcc.melody.Library, name: Melody, version: 2.8.1}
18-
packs: {name: AVR-Dx_DFP, version: 2.7.321}
15+
is_using_prerelease_versions: false
16+
mcc_content_registries: https://registry.npmjs.org/
17+
device_library: {library_class: com.microchip.mcc.melody.Library, name: Melody, version: 2.10.0}
18+
packs: {name: N/A, version: N/A}
1919
modules:
20-
- {name: '@mchp-mcc/avr-8bit', type: MELODY, version: 4.13.0}
20+
- {name: '@mchp-mcc/avr-8bit', type: MELODY, version: 4.14.2}
2121
- {name: '@mchp-mcc/avr8-configuration-bits-v1', type: MELODY, version: 4.3.0}
22-
- {name: '@mchp-mcc/avr8-pin-manager', type: MELODY, version: 4.6.1}
22+
- {name: '@mchp-mcc/avr8-pin-manager', type: MELODY, version: 4.6.2}
2323
- {name: '@mchp-mcc/delay-blocking-driver', type: MELODY, version: 3.2.0}
24-
- {name: '@mchp-mcc/example-i2c-host', type: MELODY, version: 1.0.0}
25-
- {name: '@mchp-mcc/i2c-host-driver', type: MELODY, version: 1.1.0-dev.1}
24+
- {name: '@mchp-mcc/example-i2c-host', type: MELODY, version: 1.0.1}
25+
- {name: '@mchp-mcc/i2c-host-driver', type: MELODY, version: 1.0.5}
2626
- {name: '@mchp-mcc/main-manager', type: MELODY, version: 3.1.2}
27-
- {name: '@mchp-mcc/pin-content-processor', type: MELODY, version: 3.9.1-feat.6}
28-
- {name: '@mchp-mcc/scf-avr8-clkctrl-v3', type: MELODY, version: 2.1.0-dev.1}
29-
- {name: '@mchp-mcc/scf-avr8-interrupt-v1', type: MELODY, version: 5.0.13-dev.1}
27+
- {name: '@mchp-mcc/pin-content-processor', type: MELODY, version: 3.11.0}
28+
- {name: '@mchp-mcc/scf-avr8-clkctrl-v3', type: MELODY, version: 2.0.10}
29+
- {name: '@mchp-mcc/scf-avr8-interrupt-v1', type: MELODY, version: 5.0.12}
3030
- {name: '@mchp-mcc/scf-avr8-twi-v1', type: MELODY, version: 8.2.0}
31-
- {name: '@mchp-mcc/scf-avr8-usart-v1', type: MELODY, version: 10.2.1}
31+
- {name: '@mchp-mcc/scf-avr8-usart-v1', type: MELODY, version: 10.3.1}
3232
- {name: '@mchp-mcc/uart-driver', type: MELODY, version: 1.10.2}

avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors.X/mcc-manifest-generated-success.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
manifest_file_version: 1.0.0
44
project: avr128db48-find-all-i2c-clients-on-bus-callback-printf-errors
5-
creation_date: 2025-04-10T12:56:46.838+02:00[Europe/Berlin]
5+
creation_date: 2025-10-20T14:22:33.349+02:00[Europe/Berlin]
66
operating_system: Windows 11
77
mcc_mode: IDE
88
mcc_mode_version: v6.25
99
device_name: AVR128DB48
1010
compiler: XC8 3.00
11-
mcc_version: 5.5.2
12-
mcc_core_version: 5.7.1
13-
content_manager_version: 5.0.1
11+
mcc_version: 5.6.2
12+
mcc_core_version: 5.8.2
13+
content_manager_version: 6.0.3-rc.a
1414
is_mcc_offline: false
15-
is_using_prerelease_versions: true
16-
mcc_content_registries: https://registry.npmjs.org/,https://artifacts.microchip.com/artifactory/api/npm/npm/
17-
device_library: {library_class: com.microchip.mcc.melody.Library, name: Melody, version: 2.8.1}
18-
packs: {name: AVR-Dx_DFP, version: 2.7.321}
15+
is_using_prerelease_versions: false
16+
mcc_content_registries: https://registry.npmjs.org/
17+
device_library: {library_class: com.microchip.mcc.melody.Library, name: Melody, version: 2.10.0}
18+
packs: {name: N/A, version: N/A}
1919
modules:
20-
- {name: '@mchp-mcc/avr-8bit', type: MELODY, version: 4.13.0}
20+
- {name: '@mchp-mcc/avr-8bit', type: MELODY, version: 4.14.2}
2121
- {name: '@mchp-mcc/avr8-configuration-bits-v1', type: MELODY, version: 4.3.0}
22-
- {name: '@mchp-mcc/avr8-pin-manager', type: MELODY, version: 4.6.1}
22+
- {name: '@mchp-mcc/avr8-pin-manager', type: MELODY, version: 4.6.2}
2323
- {name: '@mchp-mcc/delay-blocking-driver', type: MELODY, version: 3.2.0}
24-
- {name: '@mchp-mcc/example-i2c-host', type: MELODY, version: 1.0.0}
25-
- {name: '@mchp-mcc/i2c-host-driver', type: MELODY, version: 1.1.0-dev.1}
24+
- {name: '@mchp-mcc/example-i2c-host', type: MELODY, version: 1.0.1}
25+
- {name: '@mchp-mcc/i2c-host-driver', type: MELODY, version: 1.0.5}
2626
- {name: '@mchp-mcc/main-manager', type: MELODY, version: 3.1.2}
27-
- {name: '@mchp-mcc/pin-content-processor', type: MELODY, version: 3.9.1-feat.6}
28-
- {name: '@mchp-mcc/scf-avr8-clkctrl-v3', type: MELODY, version: 2.1.0-dev.1}
29-
- {name: '@mchp-mcc/scf-avr8-interrupt-v1', type: MELODY, version: 5.0.13-dev.1}
27+
- {name: '@mchp-mcc/pin-content-processor', type: MELODY, version: 3.11.0}
28+
- {name: '@mchp-mcc/scf-avr8-clkctrl-v3', type: MELODY, version: 2.0.10}
29+
- {name: '@mchp-mcc/scf-avr8-interrupt-v1', type: MELODY, version: 5.0.12}
3030
- {name: '@mchp-mcc/scf-avr8-twi-v1', type: MELODY, version: 8.2.0}
31-
- {name: '@mchp-mcc/scf-avr8-usart-v1', type: MELODY, version: 10.2.1}
31+
- {name: '@mchp-mcc/scf-avr8-usart-v1', type: MELODY, version: 10.3.1}
3232
- {name: '@mchp-mcc/uart-driver', type: MELODY, version: 1.10.2}

0 commit comments

Comments
 (0)