Hi:
I use Cy8C4124 as an I2C slave device. if master don't read anything after 30 secounds. CY8C4124 will go to stop mode.most times are fine but some times, i find all of output pin of CY8C4124 is high level output. it is not 3.3V, but is 1.7V.
I don't know why. please help me. thank you very much.
my code you can see below:
int main()
{
CySysPmUnfreezeIo();
CyGlobalIntEnable; /* Enable global interrupts. */
I2CM_Start();
EZI2C_EzI2CSetBuffer1(BUFFER_SIZE, READ_ONLY_OFFSET, ezI2cBuffer);
EZI2C_Start();
ReadfromBattary();
Test_Write(1);
CyDelay(10);
Test_Write(0);
CyDelay(1000);
Test_Write(1);
Timer_1_Start();
TimerISR_StartEx(timer_isr); // Do use this one!
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
while(1)
{}
}
void TimerISR( void )
{
sleepcount++;
if(timecount>=500000)
{
timecount=0;
Test_Write(1);
ReadfromBattary();
}
else
{
timecount++;
read_flag=0;
Test1_Write(0);
Test_Write(0);
}
if(sleepcount>=5000000)
{
sleepcount=0;
I2CM_Stop();
EZI2C_Stop();
Timer_1_Stop();
CySysPmSetWakeupPolarity(CY_PM_STOP_WAKEUP_ACTIVE_HIGH);
CySysPmStop();
}
}