如何在D7-D0引脚上产生10-20μs的方波信号,望大侠赐教!!!
因为是USB数据传输,在数量级上是ms级的,所以达不到要求!
几十个脉冲是可以的,但代码比较麻烦,很难解释,以下是API: CH341Set_D5_D0 mBuffer[0] = mCH341A_CMD_UIO_STREAM; mBuffer[1] = (UCHAR)( mCH341A_CMD_UIO_STM_OUT | iSetDataOut & 0x3F ); // 输出数据D5-D0,位5-位0为数据 mBuffer[2] = (UCHAR)( mCH341A_CMD_UIO_STM_DIR | iSetDirOut & 0x3F ); // 设定I/O方向D5-D0,位5-位0为方向数据 mBuffer[3..n-1] = (UCHAR)( mCH341A_CMD_UIO_STM_OUT | iSetDataOut & 0x3F ); // 多次重复产生波形 mBuffer[n] = mCH341A_CMD_UIO_STM_END; // 命令包提前结束 mLength = n+1; if ( CH341WriteData( iIndex, mBuffer, &mLength ) ) { // 写出数据块
多谢小二,但我需要的是64K个脉冲