查看: 611|回复: 0

MCX N947+HC35001屏显示

[复制链接]
  • TA的每日心情
    开心
    3 天前
  • 签到天数: 750 天

    连续签到: 2 天

    [LV.10]以坛为家III

    14

    主题

    2733

    帖子

    0

    金牌会员

    Rank: 6Rank: 6

    积分
    4741
    最后登录
    2025-9-28
    发表于 2025-5-25 14:27:38 | 显示全部楼层 |阅读模式
    使用MCX N947 开发板驱动 HC35001 显示屏​​ 显示,下面是详细的硬件连接、驱动配置和性能优化方案:

    了解一下屏的相关知识

    HC35001 屏幕规格​​
    ​​分辨率​​:320x480 (常见于3.5寸屏)
    ​​接口类型​​:RGB 并行接口(16/18位,需确认)或 8080 并行接口
    ​​供电电压​​:3.3V(逻辑电平) + 5V(背光)
    ​​控制芯片​​:可能为 ILI9488 或类似(需确认初始化序列)

    MCX N947 接口选择​
    1748154483904.jpg


    显示结果 :
    图1
    1748151033948.png
    图2
    1748151068739.png

    下面开始软件操作:
    打样示例导入示例
    lmport sDK example(s)..
    1748153811246.jpg
    找到frdmmcxn947,前提是要安装frdmmcxn947的SDK才会有。
    1748154152301.jpg

    找到相关的Ivgl_demo.
    1748154205172.jpg

    打开后,并调试,再运行。
    1748154275265.jpg

    参考代码:
    1. void DEMO_LCD_I2C_Init(void)
    2. {
    3.     BOARD_LPI2C_Init(BOARD_TOUCH_I2C, BOARD_TOUCH_I2C_CLOCK_FREQ);
    4. }

    5. status_t DEMO_LCD_I2C_Send(
    6.     uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, const uint8_t *txBuff, uint8_t txBuffSize)
    7. {
    8.     return BOARD_LPI2C_Send(BOARD_TOUCH_I2C, deviceAddress, subAddress, subaddressSize, (uint8_t *)txBuff, txBuffSize);
    9. }

    10. status_t DEMO_LCD_I2C_Receive(
    11.     uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *rxBuff, uint8_t rxBuffSize)
    12. {
    13.     return BOARD_LPI2C_Receive(BOARD_TOUCH_I2C, deviceAddress, subAddress, subaddressSize, rxBuff, rxBuffSize);
    14. }
    复制代码
    1. // 配置 FlexIO 为 8080 写时序
    2. void FLEXIO_8080_Init(void) {
    3.     CLOCK_EnableClock(kCLOCK_Flexio0);
    4.     FLEXIO_Reset(FLEXIO0);
    5.    
    6.     // 数据线配置为输出
    7.     for (uint8_t i = 0; i < 16; i++) {
    8.         FLEXIO_SetPinMux(FLEXIO0, i, kFLEXIO_PinEnableOutput);
    9.     }
    10.    
    11.     // WR 信号配置
    12.     const flexio_timer_config_t timerConfig = {
    13.         .triggerSelect = kFLEXIO_TimerTriggerOnPinActive,
    14.         .timerMode = kFLEXIO_TimerModeDual8BitBaudBit,
    15.         .timerOutput = kFLEXIO_TimerOutputToggleOnTimerDisable,
    16.         .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClock,
    17.         .timerCompare = 1  // WR 脉冲宽度 = 2*(compare+1)/FlexIO_clock
    18.     };
    19.     FLEXIO_SetTimerConfig(FLEXIO0, 0, &timerConfig);
    20.     FLEXIO_StartTimer(FLEXIO0, 1U << 0);
    21. }
    复制代码
    1. void HC35001_Init(void) {
    2.     // 硬件复位
    3.     GPIO_WritePinOutput(RESET_PIN, 0);
    4.     delay_ms(50);
    5.     GPIO_WritePinOutput(RESET_PIN, 1);
    6.     delay_ms(120);
    7.    
    8.     // 初始化命令序列 (以 ILI9488 为例)
    9.     SendCmd(0x11);       // Sleep out
    10.     delay_ms(20);
    11.     SendCmd(0x3A);       // Pixel format
    12.     SendData(0x55);      // 16-bit/pixel
    13.     SendCmd(0x36);       // Memory Access Control
    14.     SendData(0x48);      // BGR order, Horizontal flip
    15.     SendCmd(0x21);       // Display Inversion On
    16.     SendCmd(0x29);       // Display On
    17. }
    复制代码




    哎...今天够累的,签到来了~
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-10-1 09:30 , Processed in 0.080821 second(s), 20 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表