WS2812 interface With LPC5514JBD64E

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

WS2812 interface With LPC5514JBD64E

39 次查看
Kishore02
Contributor I

Hi NXP Community,

I am working with an LPC5514JBD64E-based controller and I need to interface a WS2812/WS2812B LED ring with the MCU.

I am studying the LPC5514JBD64E datasheet and my controller schematic, but I am new to the LPC55xx family and need some guidance.

I would like to know:

1. Which GPIO pin of the LPC5514JBD64E should be used for the WS2812 data (DIN) signal?

2. Since the LPC5514JBD64E uses 3.3 V logic and the WS2812 will be powered from 5 V, what is the recommended hardware connection between the MCU and WS2812?

3. Is a 74AHCT125 recommended between the MCU GPIO and WS2812 DIN?

4. Which peripheral or method should be used to generate the precise timing required by the WS2812 protocol?

5. Is there an official NXP SDK example, driver, or sample code for controlling WS2812 or NeoPixel LEDs using the LPC5514JBD64E?

6. If there is no WS2812-specific example, could you provide or point me to a basic working example code that makes a WS2812 LED or LED ring blink or change color?

7. What is the recommended development environment and programming/debugging procedure for this MCU?

My immediate goal is to make the WS2812 LED ring blink and display different colors using the LPC5514JBD64E.

I would appreciate guidance on the correct GPIO, hardware connection, peripheral, and example code.

Thank you!

标签 (1)
0 项奖励
回复
1 回复

2 次查看
Harry_Zhang
NXP Employee
NXP Employee

HI @Kishore02 

1. 

The WS2812 protocol requires a precisely timed single-wire digital output signal. Therefore, the DIN signal should preferably be generated by a timer/PWM peripheral rather than by software bit-banging.

For LPC551x devices, one practical solution is to use an SCTimer output.

The exact pin depends on your hardware design and pin mux configuration. Any pin that can be configured as an SCTimer output can potentially be used.

For example, the LPC55S16 SDK provides the sctimer_pwm_with_dutycycle_change example, which uses:

SCT0_OUT2  (J12-12 on LPCXpresso55S16 board)

2. Since the LPC5514 operates at 3.3 V logic and the WS2812 is typically powered from 5 V, level shifting is recommended to improve signal integrity and ensure reliable operation.

3. Yes.

A 74AHCT125 is a commonly used and recommended solution for interfacing a 3.3 V MCU with a 5 V WS2812 device.

4. For LPC551x devices, the preferred approaches would be:

SCTimer (recommended)

Generate an 800 kHz waveform.
Dynamically update the PWM duty cycle for each transmitted bit.
Similar to the SDK example:

sctimer_pwm_with_dutycycle_change

5.At the moment, I am not aware of an official MCUXpresso SDK example specifically targeting WS2812 or NeoPixel LEDs for the LPC5514.

However, the SDK does provide several SCTimer PWM examples that can be used as a starting point.

In particular:

sctimer_pwm
sctimer_pwm_with_dutycycle_change

Although I have not found a dedicated WS2812 example for the LPC5514 SDK, I previously achieved reliable WS2812 control on the FRDM-MCXN947 board using an SCTimer + eDMA solution. 

6. I would recommend starting from:

lpcxpresso55s16_sctimer_pwm_with_dutycycle_change

7. 

The recommended development environment is:

MCUXpresso IDE
MCUXpresso SDK
LPC-Link2 or MCU-Link debugger
On-board CMSIS-DAP debugger (if available on the evaluation board)

Hope this will help you.

BR

Harry

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2403976%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EWS2812%E6%8E%A5%E5%8F%A3%E4%B8%8ELPC5514JBD64E%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2403976%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ENXP%E7%A4%BE%E5%8C%BA%E7%9A%84%E5%90%84%E4%BD%8D%E5%A5%BD%EF%BC%8C%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%E5%9F%BA%E4%BA%8E%20LPC5514JBD64E%20%E7%9A%84%E6%8E%A7%E5%88%B6%E5%99%A8%EF%BC%8C%E9%9C%80%E8%A6%81%E5%B0%86%20WS2812%2FWS2812B%20LED%20%E7%8E%AF%E4%B8%8E%20MCU%20%E8%BF%9E%E6%8E%A5%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E7%A0%94%E7%A9%B6%20LPC5514JBD64E%20%E6%95%B0%E6%8D%AE%E6%89%8B%E5%86%8C%E5%92%8C%E6%88%91%E7%9A%84%E6%8E%A7%E5%88%B6%E5%99%A8%E5%8E%9F%E7%90%86%E5%9B%BE%EF%BC%8C%E4%BD%86%E6%88%91%E5%AF%B9%20LPC55xx%20%E7%B3%BB%E5%88%97%E8%BF%98%E4%B8%8D%E7%86%9F%E6%82%89%EF%BC%8C%E9%9C%80%E8%A6%81%E4%B8%80%E4%BA%9B%E6%8C%87%E5%AF%BC%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93%EF%BC%9A%3C%2FP%3E%3CP%3E1.%20LPC5514JBD64E%20%E7%9A%84%E5%93%AA%E4%B8%AA%20GPIO%20%E5%BC%95%E8%84%9A%E5%BA%94%E8%AF%A5%E7%94%A8%E4%BA%8E%20WS2812%20%E6%95%B0%E6%8D%AE%EF%BC%88DIN%EF%BC%89%E4%BF%A1%E5%8F%B7%EF%BC%9F%3C%2FP%3E%3CP%3E2.%20%E7%94%B1%E4%BA%8E%20LPC5514JBD64E%20%E4%BD%BF%E7%94%A8%203.3V%20%E9%80%BB%E8%BE%91%EF%BC%8C%E8%80%8C%20WS2812%20%E7%94%B1%205V%20%E4%BE%9B%E7%94%B5%EF%BC%8C%E9%82%A3%E4%B9%88%20MCU%20%E5%92%8C%20WS2812%20%E4%B9%8B%E9%97%B4%E6%8E%A8%E8%8D%90%E7%9A%84%E7%A1%AC%E4%BB%B6%E8%BF%9E%E6%8E%A5%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F%3C%2FP%3E%3CP%3E3.%20%E6%98%AF%E5%90%A6%E5%BB%BA%E8%AE%AE%E5%9C%A8%20MCU%20GPIO%20%E5%92%8C%20WS2812%20DIN%20%E4%B9%8B%E9%97%B4%E4%BD%BF%E7%94%A8%2074AHCT125%EF%BC%9F%3C%2FP%3E%3CP%3E4.%20%E5%BA%94%E4%BD%BF%E7%94%A8%E5%93%AA%E7%A7%8D%E5%A4%96%E8%AE%BE%E6%88%96%E6%96%B9%E6%B3%95%E6%9D%A5%E7%94%9F%E6%88%90%20WS2812%20%E5%8D%8F%E8%AE%AE%E6%89%80%E9%9C%80%E7%9A%84%E7%B2%BE%E7%A1%AE%E6%97%B6%E5%BA%8F%EF%BC%9F%3C%2FP%3E%3CP%3E5.%20%E6%98%AF%E5%90%A6%E6%9C%89%E4%BD%BF%E7%94%A8%20LPC5514JBD64E%20%E6%8E%A7%E5%88%B6%20WS2812%20%E6%88%96%20NeoPixel%20LED%20%E7%9A%84%E5%AE%98%E6%96%B9%20NXP%20SDK%20%E7%A4%BA%E4%BE%8B%E3%80%81%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E6%88%96%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81%EF%BC%9F%3C%2FP%3E%3CP%3E6.%E5%A6%82%E6%9E%9C%E6%B2%A1%E6%9C%89%20WS2812%20%E7%9A%84%E5%85%B7%E4%BD%93%E7%A4%BA%E4%BE%8B%EF%BC%8C%E6%82%A8%E8%83%BD%E5%90%A6%E6%8F%90%E4%BE%9B%E6%88%96%E6%8C%87%E5%87%BA%E4%B8%80%E4%B8%AA%E5%9F%BA%E6%9C%AC%E7%9A%84%E3%80%81%E5%8F%AF%E8%BF%90%E8%A1%8C%E7%9A%84%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81%EF%BC%8C%E4%BD%BF%20WS2812%20LED%20%E6%88%96%20LED%20%E7%8E%AF%E9%97%AA%E7%83%81%E6%88%96%E6%94%B9%E5%8F%98%E9%A2%9C%E8%89%B2%EF%BC%9F%3C%2FP%3E%3CP%3E7.%20%E5%AF%B9%E4%BA%8E%E8%BF%99%E6%AC%BEMCU%EF%BC%8C%E6%8E%A8%E8%8D%90%E7%9A%84%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E5%92%8C%E7%BC%96%E7%A8%8B%2F%E8%B0%83%E8%AF%95%E6%B5%81%E7%A8%8B%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F%3C%2FP%3E%3CP%3E%E6%88%91%E7%9C%BC%E4%B8%8B%E7%9A%84%E7%9B%AE%E6%A0%87%E6%98%AF%E4%BD%BF%E7%94%A8%20LPC5514JBD64E%20%E4%BD%BF%20WS2812%20LED%20%E7%8E%AF%E9%97%AA%E7%83%81%E5%B9%B6%E6%98%BE%E7%A4%BA%E4%B8%8D%E5%90%8C%E7%9A%84%E9%A2%9C%E8%89%B2%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E5%B8%8C%E6%9C%9B%E8%83%BD%E5%A4%9F%E5%BE%97%E5%88%B0%E5%85%B3%E4%BA%8E%E6%AD%A3%E7%A1%AE%E7%9A%84GPIO%E3%80%81%E7%A1%AC%E4%BB%B6%E8%BF%9E%E6%8E%A5%E3%80%81%E5%A4%96%E8%AE%BE%E5%92%8C%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81%E6%96%B9%E9%9D%A2%E7%9A%84%E6%8C%87%E5%AF%BC%E3%80%82%3C%2FP%3E%3CP%3E%E8%B0%A2%E8%B0%A2%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2403976%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ELPC55xx%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E