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": "This example will demonstrate how to interface with the individually addressable WS2812 LEDs on the Curiosity Explorer Development board using Core Independent Peripherals and MCC.",
Copy file name to clipboardExpand all lines: README.md
+34-79Lines changed: 34 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@
8
8
</picture>
9
9
</a>
10
10
11
-
# PIC18F54Q24 curiosity nano explorer WS2812 RGB LED
11
+
# Interfacing WS2812 RGB LEDs on the Curiosity Explorer board using the PIC18F56Q24
12
12
13
-
This example demonstrates the setup of the WS2812B on the Curiosity Nano Explorer Board using the PIC18F56Q24 MCU. The WS2812B is a RGB LED that integrates a control circuit and RGB chip in a package. It allows for easy control of multiple LEDs with a single data line, making it ideal for creating colorful lighting effects and displays.
13
+
This example demonstrates how to interface the WS2812B RGB LEDs on the Curiosity Nano Explorer Board using the PIC18F56Q24 Curiosity Nano. The WS2812B is an RGB LED that integrates both a control circuit and an RGB chip into a single package. It allows for easy control of multiple LEDs with a single data line, making it ideal for creating colorful lighting effects and displays.
14
14
15
-
In this project, we will configure the PIC18F56Q24 MCU to communicate with the WS2812B LEDs and create various lighting patterns. The setup includes initializing the necessary peripherals, configuring the data output pin, and writing the code to send the correct timing signals to control the LEDs.
15
+
In this project, the PIC18F56Q24 is configured to communicate with the WS2812B LEDs and generate various lighting patterns. The setup includes initializing the necessary peripherals, configuring the data output pin, and writing code to send the precise timing signals required to control the LEDs.
-[PIC18F56Q24 Curiosity Nano User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/PIC18F56Q24-CNANO-UserGuide-DS50003618.pdf)
21
21
-[Curiosity Nano Explorer User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/CNANO-Explorer-UserGuide-DS50003716.pdf)
22
22
@@ -30,106 +30,61 @@ In this project, we will configure the PIC18F56Q24 MCU to communicate with the W
Follow the steps below to set up and run the example:
44
+
### Follow the steps below to set up and run the example:
62
45
63
-
1. Connect the PIC18F56Q24 MCU to the Curiosity Nano Explorer board.
46
+
1. Connect the PIC18F56Q24 MCU to the Curiosity Nano Explorer Board.
64
47
2. Connect the PIC18F56Q24 MCU to your computer using a USB cable.
65
-
3.Make sure the pin WS2812B-RGB is connected to the data line of the WS2812B in the Curiosity Nano Explorer board.
66
-
4. Create a new project in MPLAB® X IDE and open MCC. If first time using MCC, follow this[Getting Started with MCU Projects Using MPLAB® Code Configurator (MCC) Melody - Developer Help](https://developerhelp.microchip.com/xwiki/bin/view/software-tools/frameworks/mcc-melody/getting-started/)
67
-
5. Configure the output pin for the WS2812B LEDs, as shown in [Figure 7](#figure-7).
48
+
3.Ensure that the WS2812B-RGB pin is connected to the data line of the WS2812B on the Curiosity Nano Explorer Board.
49
+
4.Create a new project in MPLAB® X IDE and open MCC. If this is your first time using MCC, refer to[Getting Started with MCU Projects Using MPLAB® Code Configurator (MCC) Melody - Developer Help](https://developerhelp.microchip.com/xwiki/bin/view/software-tools/frameworks/mcc-melody/getting-started/)
50
+
5. Configure the output pin for the WS2812B LEDs, as shown in Figure 7.
68
51
6. Write the code to generate the correct timing signals for the WS2812B LEDs.
69
52
7. Compile and program the code into the PIC18F56Q24 MCU.
70
-
8. Observe the lighting patterns and effects created by the LEDs.
71
-
72
-
### Pin Setup
73
-
The [User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/CNANO-Explorer-UserGuide-DS50003716.pdf) for the Curiosity Explorer Nano board provides the pin mappings.
53
+
8. Observe the lighting patterns and effects produced by the LEDs.
<emid = "figure-4">Figure 4: Explorer WS2812B Pin Mappings</em>
79
-
</p>
80
-
</p>
55
+
## Pin Configuration
56
+
The [userguide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/CNANO-Explorer-UserGuide-DS50003716.pdf) for the Curiosity Explorer Nano board provides detailed information about the pin mapping between the Curiosity Explorer board and the PIC18F56Q24 Curiosity Nano board being used in this example.
81
57
82
-
As shown in [Figure 4](#figure-4) above, pin IO 27 of the Curiosity Explorer Nano board is connected to the data line of the WS2812B LEDs.
58
+
As shown in [Figure 4](#figure-4)of the user guide above, pin IO27 on the Curiosity Nano Explorer Board is connected to the data line of the WS2812B LEDs.
<br>
90
61
91
-
Pin mapping for PIC18F56Q24 can be find in [PIC18F56Q24 User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/PIC18F56Q24-CNANO-UserGuide-DS50003618.pdf#page=6)
62
+
The pin mapping for the PIC18F56Q24 Curiosity Nano Board can be found in the [PIC18F56Q24 User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/PIC18F56Q24-CNANO-UserGuide-DS50003618.pdf#page=6). Based on [Figure 5](#figure-5) and [Figure 6](#figure-6), pin IO27 on the Curiosity Nano Explorer Board is connected to the data line of the WS2812B LEDs. Ensure that the jumper is in place to connect the **WS2812B-RGB** pins on the Curiosity Nano Explorer Board. In this example project, the data line is connected to pin RE0 of the PIC18F56Q24 MCU. This pin must be configured as an output in MCC.
92
63
93
-
Based on [Figure 5](#figure-5) and [Figure 6](#figure-6), the pin IO 27 of the Curiosity Explorer Nano board is connected to the data line of the WS2812B LEDs. Ensure that the jumper is connected to link the pins **WS2812B-RGB** on the Curiosity Explorer Nano Board.
<emid="figure-6">Figure 6: Curiosity Nano Explorer Pinouts</em>
101
-
</p>
102
-
</p>
68
+
The pinout for the Curiosity Nano Socket located on the Curiosity Nano Explorer Board that is shown below can also be found in the [userguide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/CNANO-Explorer-UserGuide-DS50003716.pdf).
103
69
104
-
Pinout for CNANO Socket can be find in the [Curiosity Nano Explorer User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/CNANO-Explorer-UserGuide-DS50003716.pdf#page=9)
In MCC, select RE0 as output pin as shown in the [Figure 7](#figure-7) below. RE0 is renamed to be RGB in the Pin configuration window as shown in [Figure 8](#figure-8) below.
<emid="figure-7">Figure 7: Pin Grid View for LED Output</em>
112
-
</p>
113
-
</p>
74
+
In MCC, select RE0 as the output pin, as shown in [Figure 7](#figure-7) below. In the Pin Configuration window, RE0 is renamed to RGB, as illustrated below. All other MCC configurations remain at their default settings, as only one output pin needs to be added in this example. The next step after configuring the pin settings in MCC is to write the firmware to send the timing signals required to drive the WS2812B LEDs.
114
75
115
-
<palign="center">
116
-
<imgsrc="images/Pin Name.png"alt="Pin Name">
117
-
<br>
118
-
<emid="figure-8">Figure 8: Pin Name for LED Output</em>
119
-
</p>
120
-
</p>
76
+
<br>
121
77
122
-
MCC setup remain default, only adding 1 output pin for this example, the next step is to write the code to send the timing signals required by the WS2812B LEDs.
78
+
<br>
123
79
124
80
### Code setup
125
-
For complete application code and comprehensive description of the implementation, please refer to [main.c](\RGB_WS2812B.X\main.c) for the complete code.
81
+
For the complete application code and a comprehensive description of the implementation, please refer to [main.c](\RGB_WS2812B.X\main.c).
126
82
127
83
## Operation
128
-
After programmed the device, the lighting patterns and effects created by the WS2812B LEDs should be obsereved. If not, ensure that:
84
+
After programming the device, the lighting patterns and effects created by the WS2812B LEDs should be observed. If the LEDs do not function as expected, ensure that:
129
85
130
-
The output pin is correctly configured and connected to the data line of the WS2812B LEDs.
131
-
The code is correctly generating the timing signals required by the WS2812B LEDs.
86
+
-The output pin is correctly configured and connected to the data line of the WS2812B LEDs.
87
+
-The code is correctly generating the timing signals required by the WS2812B LEDs.
132
88
133
89
## Summary
134
-
This document provides a guide for setting up and running an example project that demonstrates the control of WS2812B RGB LEDs using the PIC18F56Q24 MCU on the Curiosity Nano Explorer Board. It includes steps for hardware setup, software configuration, and code implementation. The document also provides links to related documentation, lists the required software and hardware, and describes the features and prerequisites for the project. Detailed instructions are given for configuring the output pin and writing the code to control the LEDs. Finally, it offers guidelines for verifying the correct operation of the project and troubleshooting any issues.
135
-
90
+
This document provides a guide for setting up and running an example project that demonstrates how to control WS2812B RGB LEDs using the PIC18F56Q24 MCU on the Curiosity Nano Explorer Board. It covers hardware setup, software configuration, and code implementation. The document includes links to related documentation, lists the required software and hardware, and outlines the features and prerequisites for the project. Step-by-step instructions are provided for configuring the output pin and writing the code to control the LEDs. Additionally, the document offers guidelines for verifying correct operation and troubleshooting any issues that may arise.
0 commit comments