Demonstrating 8-bit I2C Controller Read, Step 8: Configure ATmega4809 Resources with MCC
Launch MPLAB® Code Configurator (MCC)
Open MCC by clicking the MCC logo in the MPLAB X IDE toolbar.
Select MCC Classic from MCC Content Manager Wizard.
Click Finish since no additional components are needed.
Configure System Module
Now you can start configuring the settings for the ATmega4809.
Click System Module in the upper left window.
Verify settings match the figure:
Configure I2C
Now we will add the Core Independent Peripherals (CIPs) needed for the project and configure them for the ATmega4809.
In the Device Resources window, open the Foundation Services folder and add I2C by clicking the + icon for I2CSIMPLE.
Configure USART
Add USART3 by opening the USART folder in Device Resources window and clicking the + icon for USART3.
Select USART3 in the Project Resources window.
Verify USART3 settings in its configuration window:
Configure GPIO
Select Pin Manager: Grid View in the bottom right window. Click each of the following pins to create a green lock as either an input or output:
- TWIO: SCL to RA3
- TWIO: SDA to RA2
- USART3: RXD to RB1
- USART3: TXD to RB0
Generate MCC Code
Press the Generate button.
Verify the MCC code generation is successful.
Update main.c
Click on the Projects tab, locate the previous PIC18F47Q10 project and double-click on main.c in the to open it.
Open the ATmega4809 project’s main.c by double-clicking its main.c file. Select all of the contents of the main.c file with CTRL + A and paste using CTRL + V.