ov7670的noACK问题
用SCCB时序,此处的noACK为何意?void noAck(void)
{
IOWR_ALTERA_AVALON_PIO_DIRECTION(SDA_BASE, IN);
SIO_D_SET;
usleep(DELAY_TIME);
SIO_C_SET;
usleep(DELAY_TIME);
SIO_C_CLR;
usleep(DELAY_TIME);
SIO_D_CLR;
usleep(DELAY_TIME);
}
unsigned char rdOV7670Reg(unsigned char regID, unsigned char *regDat)
{
//通过写操作设置寄存器地址
startSCCB();
if(0==SCCBwriteByte(0x42))
{
stopSCCB();
return(0);
}
usleep(100);
if(0==SCCBwriteByte(regID))
{
stopSCCB();
return(0);
}
stopSCCB();
usleep(100);
//设置寄存器地址后,才是读
startSCCB();
if(0==SCCBwriteByte(0x42))
{
stopSCCB();
return(0);
}
usleep(100);
*regDat=SCCBreadByte();
noAck();
stopSCCB();
return(1);
} void noAck(void)
{
SIO_D=1;
delay_100us();
SIO_C=1;
delay_100us();
SIO_C=0;
delay_100us();
SIO_D=0;
delay_100us();
}
void nAck(void)
{
SIO_D=0;
delay_100us();
SIO_C=1;
delay_100us();
SIO_C=0;
delay_100us();
SIO_D=0;
delay_100us();
}
我只知道有一个DON'T CARE 和一个NA位 我错了。。。NA位就是notACK 主机发送的“ The 2-phase write transmission cycle contains read data of 8 bits and a 9th, NA bit. The master must drive the NA bit at logical 1.”
页:
[1]