Bi-phase Encoder and Decoder - Use Cases for CIPs Using the AVR128DA48 Microcontroller with MCC Melody
The repository contains two MPLAB® X projects:
-
Bi-phase Encoder: This project is an implementation of a Bi-phase Encoder using Core Independent Peripherals (CIPs) by following the interaction between Universal Synchronous and Asynchronous Receiver and Transmitter (USART), Event System (EVSYS), Serial Peripheral Interface (SPI), and Configurable Custom Logic (CCL) peripherals.
-
Bi-phase Decoder: This project is an implementation of a Bi-phase Decoder using CIPs by following the interaction between Timer/Counter Type A (TCA), Timer/Counter Type B (TCB), Event System, CCL, and SPI peripherals.
The setup is presented in the diagram below:
More details and code examples on the AVR128DA48 can be found at the following links:
-
Two AVR128DA48 Curiosity Nano Development board (DM164151) are used as test platforms:
-
Four jumper wires
To program the Curiosity Nano board with this MPLAB X project, follow the steps provided in the How to Program the Curiosity Nano Board chapter.
In the demo, the Microchip!
message was inserted by the user in the terminal. Pin PB3 of the encoder platform - BMC out (the output pin for the Bi-phase encoded signal) - is connected to the PB0 pin of the decoder board and it is visualized using MPLAB Data Visualizer plugin.
This chapter demonstrates how to use the MPLAB X IDE to program an AVR® device with an Example_Project.X. This is applicable to other projects.
-
Connect the board to the PC.
-
Open the Example_Project.X project in MPLAB X IDE.
-
Set the Example_Project.X project as main project.
Right click the project in the Projects tab and click Set as Main Project. -
Clean and build the Example_Project.X project.
Right click the Example_Project.X project and select Clean and Build. -
Select AVRxxxxx Curiosity Nano in the Connected Hardware Tool section of the project settings:
Right click the project and click Properties.
Click the arrow under the Connected Hardware Tool.
Select AVRxxxxx Curiosity Nano (click the SN), click Apply and then click OK: -
Program the project to the board.
Right click the project and click Make and Program Device.