MCC Melody in VS Code®: I2C Proximity Ex. 2 - Callbacks + Data Streamer | Videos
MCC Melody in VS Code®: I2C Proximity Ex. 2 - Callbacks + Data Streamer
Getting Started with MCC Melody in VS Code® (for PIC16/PIC18/AVR Development) Playlist:
https://youtube.com/playlist?list=PLtQdQmNK_0DTt4jZ7BQiFBV51zTt3MGqO&si=evOSLi5ww8ycAe0R
Link to Part 1: https://youtu.be/rER0qkbnFpw
Link to Part 3: https://youtu.be/5Bhnv1ktSC8
The previous videos have built up pseudo configurations for MCC Melody configurations associated with a proximity sensor example, namely: Polled Printf, Callbacks Data Streamer, Callbacks DV Run Time.
In this video we build up and test the second config on hardware, using the Curiosity Nano Explorer. We enable I2C interrupt-driven host, add TMR for 100 ms callbacks, configure Data Streamer with proximity (uint16) frame count (uint8), generate code, flash, and verify live plots via MPLAB Data Visualizer (import .ds file).
Timestamps:
00:01 - First (Polled Printf) config done → Now: Data Streamer
00:27 - Ctrl Shift P → MPLAB MCC: Launch → Select Data Streamer config
00:52 - Reuse I2C host (RB2 SDA, RB1 SCL) → Enable interrupts (unlike polled)
01:47 - Pin Grid View → Confirm I2C pins on Explorer bus
02:12 - Add TMR → Interrupt-driven, 100ms period
02:37 - LED on RF3 → No delay driver needed
03:15 - Add Data Streamer Library → Auto-adds UART
03:27 - Define variables: proximity (uint16), frame_count (uint8)
03:58 - UART: RF0 TX (locked by Data Streamer), 115200, interrupt-driven
05:02 - Debug IO: RB4 (switch)
05:28 - Generate code → Copy Data Streamer example snippet
06:11 - TODO: Confirm Timer0 → Replace I2C_Host_Tasks() with interrupt flow
06:31 - Clean & build Data Streamer config → Success
06:51 - Debug → Auto-detect Curiosity Nano
07:15 - Data Visualizer: Import .ds file from MCC/generated/data_streamer/
07:51 - Load variables → Select COM source → 115200 baud
08:11 - Start streaming → See 0x03/0xFC frame markers
08:32 - Add COM terminal Debug IO → Live toggle visible
09:01 - Plot proximity values in real time
09:20 - Note: Manual init/update of variables in frame loop
09:40 - Next: DV Runtime config (simpler streaming!)
To view this video, please click manage cookies below and accept functional cookies.
{"SalesForceSecurePath":"https://microchip.my.salesforce-scrt.com","EmbeddedServiceName":"Messaging_For_Microchip","SalesForcePath":"https://microchip.my.site.com/ESWMessagingForMicrochi1755319480924","AgentAvailableHeader":"No problem. Chat with our engineering experts or schedule a call that's convenient for you.","ScheduleCallUrl":"https://microchip.my.site.com/schedulemeetingportal/s/","SalesforceOrgId":"00Do0000000KAkK","JsUrl":"https://microchip.my.site.com/ESWMessagingForMicrochi1755319480924/assets/js/bootstrap.min.js"}