AMEPD SSD1680 调试记录

本文详细介绍了有源矩阵电泳显示屏(AMEPD)的特性,如低刷新率、逐行刷新和可能的残影现象。屏幕控制器SSD1680采用SPI通信,支持3线9dataSPI和4线SPI模式。调试注意事项包括SPI时序、电压配置和BUSY管脚的使用。此外,文章还提供了初始化代码示例和显示数据的发送方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

AMEPD Active Martix Electrophoretic Display,有源矩阵电泳显示屏。

就是电纸书那种屏,调试效果使用感受和我的Kindle差不多。

屏幕参数

  1. 屏幕 IC为SSD1680

  1. 122*250,单bit控制,1为白,0为黑

  1. 逐行刷新,一个字节8bit,控制横向8个像素

  1. 内置温度传感器(IIC接口,本次未使用)

  1. 内置OTP(10Byte,本次未使用)

  1. 屏幕控制器为 On-Chip封装

  1. SPI 速率设置4M 足以

显示效果特征

  1. 刷新率低,更新一次数据以秒计

  1. 单独更新某块数据,可能有残影。

  1. 更新整个屏幕数据,会有很大的闪烁波动

  1. 掉电、硬件复位、软件复位,不影响显示,但需要重新下发配置,直到下次写入新的显示数据。

调试注意事项

  1. 整个屏逻辑通信电压2为3.3v。

  1. spi 为mode 0,clk 空闲低,在第一个上升沿采样

  1. BSI管脚:通过拉高、拉低配置为3线9data SPI(H)或4线SPI通信模式(L)

  1. CS 片选管脚:低有效,拉低时可以读写

  1. DC管脚:数据/命令指示脚。(L,下命令;H,写数据)

  1. BUSY管脚:屏幕IC在 刷新数据期间或复位期间,输出高:此时对外界的读写操作无响应。在屏幕的读写逻辑中尤其要注意这一点。(空闲低,忙碌高)

  1. RST 管脚:低电平复位,工作期间保持高

  1. VGL、VGH管脚:屏幕翻转液晶粒子所需的偏置电压,软件可配置,16-20v。通过自身的 GDR和 RESE 以及外围电路,组成升压电路

SPI通信时序

4-Wire SPI

3-Wire 9Bit SPI

代码demo

寄存器配置

static void my_amepd_RegInit(void)
{
    AMEPD_SSD1680_WriteCmd(0x12);  // SW Reset
    my_sleep(20);
    my_amepd_ReadBusy();          // wait busy
    my_test_cli_echo("my_amepd_RegInit 0x12 \r\n");

    AMEPD_SSD1680_WriteCmd(0x01);
    AMEPD_SSD1680_WriteData(0xF9);
    AMEPD_SSD1680_WriteData(0x00);
    AMEPD_SSD1680_WriteData(0x00);

    AMEPD_SSD1680_WriteCmd(0x11);  // data enter mode
    AMEPD_SSD1680_WriteData(0x01);

    AMEPD_SSD1680_WriteCmd(0x44);  // set RAM x address
    AMEPD_SSD1680_WriteData(0x00); // set x start, range: 0-15
    AMEPD_SSD1680_WriteData(0x0F); // set x end

    AMEPD_SSD1680_WriteCmd(0x45);  // set RAM y address
    AMEPD_SSD1680_WriteData(0xF9); // RAM y address start, range: 0-249
    AMEPD_SSD1680_WriteData(0x00);
    AMEPD_SSD1680_WriteData(0x00); // RAM y address end
    AMEPD_SSD1680_WriteData(0x00);

    AMEPD_SSD1680_WriteCmd(0x3C);  // Border
    AMEPD_SSD1680_WriteData(0x05);

    AMEPD_SSD1680_WriteCmd(0x21);  // Display update control
    AMEPD_SSD1680_WriteData(0x00);
    AMEPD_SSD1680_WriteData(0x80); // S8-S167 for 1675 type panel

    // use internal temperature sernsor
    AMEPD_SSD1680_WriteCmd(0x18);
    AMEPD_SSD1680_WriteData(0x80);

    my_amepd_ReadBusy();          // wait busy
    my_test_cli_echo("my_amepd_RegInit 0x18 \r\n");
}

设置显示坐标

static void my_amepd_SetPosition(int x_start, int x_end, int y_start, int y_end)
{
    my_test_cli_echo("%d \r\n", x_start);
    my_test_cli_echo("%d \r\n", x_end);
    my_test_cli_echo("%d \r\n", y_start);
    my_test_cli_echo("%d \r\n", y_end);

    my_amepd_RegInit();
    my_test_cli_echo("my_amepd_SetPosition X \r\n");

    AMEPD_SSD1680_WriteCmd(0x44);
    AMEPD_SSD1680_WriteData(x_start);
    AMEPD_SSD1680_WriteData(x_end);

    AMEPD_SSD1680_WriteCmd(0x45);
    AMEPD_SSD1680_WriteData(y_start);
    AMEPD_SSD1680_WriteData(0x00);
    AMEPD_SSD1680_WriteData(y_end);
    AMEPD_SSD1680_WriteData(0x00);

    AMEPD_SSD1680_WriteCmd(0x4E);
    AMEPD_SSD1680_WriteData(x_start);

    AMEPD_SSD1680_WriteCmd(0x4F);
    AMEPD_SSD1680_WriteData(y_start);
    AMEPD_SSD1680_WriteData(0x00);
    AMEPD_SSD1680_WriteCmd(0x24);
}

发送显示数据

    for(col=0; col<max_col; col++) // send 122x250bits ram 2D13
    {
        for(row=0; row<max_row; row++)
        {
            AMEPD_SSD1680_WriteData(Image_demo[pcnt]);
            pcnt++;
        }
    }

更新显示数据

    // 在发送显示数据之后调用
    AMEPD_SSD1680_WriteCmd(0x22);
    AMEPD_SSD1680_WriteData(0xF7);
    AMEPD_SSD1680_WriteCmd(0x20);

X/Y 轴镜像显示

设置RAMX、Y轴的起始和结束地址可以,让显示效果X镜像、Y镜像,或者X、Y一起镜像。

正常刷新

    AMEPD_SSD1680_WriteCmd(0x44);
    AMEPD_SSD1680_WriteData(0);  // x start
    AMEPD_SSD1680_WriteData(15); // x end

    AMEPD_SSD1680_WriteCmd(0x45);
    AMEPD_SSD1680_WriteData(0);  // y start
    AMEPD_SSD1680_WriteData(0x00);
    AMEPD_SSD1680_WriteData(249); // y end
    AMEPD_SSD1680_WriteData(0x00);

X轴镜像显示

    AMEPD_SSD1680_WriteCmd(0x44);
    AMEPD_SSD1680_WriteData(16);  // x start
    AMEPD_SSD1680_WriteData(10); // x end

    AMEPD_SSD1680_WriteCmd(0x45);
    AMEPD_SSD1680_WriteData(0);  // y start
    AMEPD_SSD1680_WriteData(0x00);
    AMEPD_SSD1680_WriteData(249); // y end
    AMEPD_SSD1680_WriteData(0x00);

Y轴镜像显示

    AMEPD_SSD1680_WriteCmd(0x44);
    AMEPD_SSD1680_WriteData(0);  // x start
    AMEPD_SSD1680_WriteData(15); // x end

    AMEPD_SSD1680_WriteCmd(0x45);
    AMEPD_SSD1680_WriteData(249);  // y start
    AMEPD_SSD1680_WriteData(0x00);
    AMEPD_SSD1680_WriteData(0); // y end
    AMEPD_SSD1680_WriteData(0x00);

XY轴镜像同理

逝者如斯夫 不舍昼夜

### SSD1680 E-Ink Display Rotation Implementation For implementing the rotation of an SSD1680 e-ink display, one must consider both hardware and software aspects to ensure proper orientation changes are supported. The primary method involves modifying the frame buffer or using specific commands provided by the display driver. In terms of programming, libraries such as Waveshare's official Python library can be utilized for controlling the SSD1680 e-paper module[^3]. This library offers functions that allow setting up different orientations through configuration parameters before updating the screen content. To achieve a rotated image output on this type of device: A common approach is adjusting the pixel mapping within your application code prior to sending data to the controller chip via SPI interface. By manipulating how each byte represents columns/rows during transmission, clockwise/counterclockwise rotations at multiples of 90 degrees become feasible without requiring additional external components beyond what’s already integrated into most breakout boards featuring these displays. Here is an example demonstrating how to rotate images displayed on an SSD1680 panel using Python with Pillow (PIL fork): ```python from PIL import Image import ssd1680 # Assuming you have imported necessary modules from the appropriate package def draw_rotated_image(image_path, angle): img = Image.open(image_path).rotate(angle, expand=True) epd = ssd1680.EPD() epd.init() Himage = Image.new('1', (epd.height, epd.width), 255) # Create blank white canvas bbox = img.getbbox() cropped_img = img.crop(bbox) new_width = min(epd.width, epd.height) resized_img = cropped_img.resize((new_width, int(new_width * cropped_img.size[1] / float(cropped_img.size[0])))) offset_x = (epd.width - resized_img.size[0]) // 2 offset_y = (epd.height - resized_img.size[1]) // 2 Himage.paste(resized_img, (offset_x, offset_y)) epd.display_frame(Himage) ``` This script rotates an input image file according to specified angles while maintaining its aspect ratio after cropping out transparent areas; it then centers the result onto the available space of the e-paper display surface.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值