JieLi AC6966B Development Board Peripheral Expansion: JL AC696N SPI Drives Flash, LCD, and RGB LEDs

 Introduction

For products like Bluetooth speakers and headphones, the chip's built-in resources are rarely enough—you need external Flash to store prompt tones, an LCD to display status, and a few RGB LEDs for ambiance. These are common requirements. The JL JieLi AC696N's SPI interface is perfect for the job—it's fast enough and can even simulate some special timing. However, the configuration differs when driving different peripherals with SPI, especially for LEDs like WS2812, which have strict timing requirements. A slight deviation and the lighting pattern goes wrong.

I've recently gotten all three—Flash, LCD, and RGB LEDs—working on the AC696N development board. Here are the key configuration points, so you can directly reuse them when building your own products.


I. Basic SPI Configuration

In board_ac696x_demo.c, under SPI_PLATFORM_DATA_BEGIN, configure the SPI parameters: port group, clock, mode, and role (master).


II. Application 1: External SPI Nor Flash

Functionality: Enables external recording storage, independent prompt tone library, and file system partitions (FAT + TONE + REC).

Steps: Refer to the "Flash Recording (External) and Partition Operation Instructions" document, configure the Flash driver, and call the relevant APIs for read/write/erase operations.


III. Application 2: Driving an LCD Screen

Method: Send command and data sequences via SPI to control the LCD display. The driver must be written according to the specific LCD model.

Note: You may need to use GPIOs to control reset, backlight, and other pins.


IV. Application 3: Driving RGB Magic LEDs (e.g., WS2812)

Characteristics: These LEDs use a single-wire return-to-zero code protocol with strict timing requirements.

Steps:

  1. Refer to the "Single-Wire Serial Control Magic LED" documentation.

  2. Use the SPI MOSI line to simulate the specific data waveform.

  3. Pay special attention to the "Code Notes" in the documentation, such as delays and buffer management.


Summary

Using SPI to interface with Flash is a common practice. The documentation is detailed, so following it usually works without issues.

LCD drivers depend heavily on the initialization sequence of the screen—different manufacturers vary greatly, but the SPI transmission logic is the same.

WS2812 is a bit trickier. I recommend starting on the AC696N development board by using SPI MOSI to simulate the waveform and get one or two LEDs working first. Once the timing is confirmed, you can increase the number of LEDs. Also, if multiple devices are connected to the same SPI bus, be sure to use separate chip select pins and set the clock frequency according to the slowest device. Otherwise, high-speed devices may work fine, but low-speed devices may not respond.

评论

此博客中的热门博文

Jieli Bluetooth Smart Speaker Development: Common Issues with AC696N SoCs

KT148A Voice Chip: A Powerful Tool to Enhance the User Experience of Smart Soymilk Makers

KT148A Voice Chip Issue: Difficult to Play with Code Sending - Normal Playback After Grounding Pin 4, What’s the Reason?