求助: 原子4.3寸电容屏读取信息出错,写入正常

2019-07-21 04:53发布



上图是示波器的截图,下半部分是上半部分加亮区域的放大。
这个是读取ID时的三次操作,黄线是RS信号,高表数据,低表指令;红线是RD信号,低有效;蓝线是D7数据线。
蓝 {MOD}的尖峰是写入指令用来读取ID,三个鼓包是返回值,正常因为 00,80,00,即D7上应该是 0,1,0。
不解的是,应该输出1的地方电压的确是3.3V,但应该输出0的地方电压却还有2.35V,
而且在IO设置中改变上下拉情况不变,若改为开漏输出由于走线较长信号变为电容充电形状。

使用环境:
自己做的STM32F407ZE,FSMC挂载,上面还有一块SRAM测试正常
FSMC配置推挽输出,无上下拉电阻,读写使用不同时序,在发送指令到读操作中延迟约400ns(while递减10)
最后贴一下程序,IO就贴了一段,其他设置相同:

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_8 |
GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_NOPULL;

GPIO_Init(GPIOD, &GPIO_InitStructure);


readTiming.FSMC_AddressSetupTime = 0x04;
readTiming.FSMC_AddressHoldTime = 0x00;
readTiming.FSMC_DataSetupTime = 0x20;
readTiming.FSMC_BusTurnAroundDuration = 0x00;
readTiming.FSMC_CLKDivision = 0x00;
readTiming.FSMC_DataLatency = 0x00;
readTiming.FSMC_AccessMode = FSMC_AccessMode_A;

writeTiming.FSMC_AddressSetupTime = 0x02; 
writeTiming.FSMC_AddressHoldTime = 0x00;
writeTiming.FSMC_DataSetupTime = 0x03;
writeTiming.FSMC_BusTurnAroundDuration = 0x00;
writeTiming.FSMC_CLKDivision = 0x00;
writeTiming.FSMC_DataLatency = 0x00;
writeTiming.FSMC_AccessMode = FSMC_AccessMode_A;

FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM3;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;
FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Enable;
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readTiming;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &writeTiming;

FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。