JL JieLi AC696N Series Development GPIO Control Encyclopedia: Modes, APIs, and Special Pins

Introduction

GPIO configuration seems simple, but there are plenty of cases where things go wrong. If the drive strength isn't set correctly, an LED might be too dim or not light at all. Without proper pull-up/pull-down configuration, button detection can be erratic. The most troublesome is the USB pin—it might default to a regular GPIO, and if you forget to switch its function, your PC won't recognize the device.

The JL JieLi AC696N's GPIOs are quite versatile, with three drive strength levels (normal, strong, super strong) and various APIs. However, these functions are scattered throughout the documentation, and you often have to search for a while when using them. I've gone through the common GPIO configurations on the AC696N development board and organized them into a table, so you can quickly look them up when writing drivers.

文章内容

I. GPIO Operating Modes

  • Input Mode: Can be configured as floating, pull-up, pull-down, or analog (for ADC). In input mode, output is disabled. The I/O status can be read via the input data register. Pull-up and pull-down input are straightforward—the default level is determined by the pull-up or pull-down. Floating input level is uncertain and depends entirely on the external input. Analog input is used for ADC sampling.
  • Output Mode: Output high/low level. Drive strength has three levels: normal, strong, and super strong.

  • Direction: Input, output. No open-drain.
  • Pull-up/down: All I/Os have pull-up/down resistors. Fixed resistance values, but differ between chips and pins (check datasheet). Pull-up/down only available in input mode.
  • Level: Output high (voltage close to VDDIO), output low (equivalent to ground, current sinking).
  • Drive strength: Normal, strong, super strong. Only very few I/Os support super strong.
  • State: Digital or analog. Analog state is used for AD detection in input mode.
  • Reading: In digital input mode, you can read the I/O voltage level. The voltage applied to an I/O must not exceed VDDIO; otherwise, reverse current may affect other I/Os.

文章内容

II. Core API Function List

文章内容
文章内容

III. Special Pin: USB DP/DM

USB pins may default to regular GPIO. To switch them to USB function, call:

usb_iomode(0);  // parameter 0: switch to USB function

IV. Important Note

The output level of a GPIO is determined by the VDDIO supply voltage. If you need a specific I/O to output 3.0V, you must set the VDDIO supply to 3.0V.

文章内容

Summary Memorize these few GPIO APIs, and you'll be covered for most tasks. A few common pitfalls:

  • USB pins: don't forget to call usb_iomode(0) to switch to USB function, otherwise the PC won't recognize the device.
  • ADC input pins: remember to use gpio_set_die() to disable digital function, otherwise readings will be inaccurate.
  • Drive strength: choose according to your needs. For driving an LED, strong drive is unnecessary; normal drive works fine and saves power.

I recommend trying each API on the AC696N development board, measuring the levels with a multimeter to confirm correct configuration before moving to your product board. This will avoid having to trace hardware issues back to software configuration later.

评论

此博客中的热门博文

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

Connection and Practical Application of Arduino and KT6368A Bluetooth Chip: Improve Development Efficiency with Development Kits