How did you manage to solve the year problem?
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 void Write_Time(){ I2C1_Start(); // Issue start signal while (I2C1_Is_Idle() == 0); I2C1_Wr(0xA2); // Address PCF8583, see PCF8583 datasheet while (I2C1_Is_Idle() == 0); I2C1_Wr(0); // Start from address 0 (configuration memory location) while (I2C1_Is_Idle() == 0); I2C1_Wr(0x80); // Wr 0x80 to configuration memory location (pause counter...) while (I2C1_Is_Idle() == 0); I2C1_Wr(0); // Wr 0 to cents memory location while (I2C1_Is_Idle() == 0); I2C1_Wr(0x11); // Wr 0 to seconds memory location while (I2C1_Is_Idle() == 0); I2C1_Wr(0x30); // Wr 0x30 to minutes memory location while (I2C1_Is_Idle() == 0); I2C1_Wr(0x17); // Wr 0x12 to hours memory location while (I2C1_Is_Idle() == 0); I2C1_Wr(0xE6); // Wr 0x18 to year/date memory location while (I2C1_Is_Idle() == 0); I2C1_Wr(0x2A); // Wr 0x04 to weekday/month memory location while (I2C1_Is_Idle() == 0); I2C1_Stop(); // Issue stop signal I2C1_Start(); // Issue start signal I2C1_Wr(0xA2); // Address PCF8530 while (I2C1_Is_Idle() == 0) ; I2C1_Wr(0); // Start from address 0 while (I2C1_Is_Idle() == 0) ; I2C1_Wr(0); // Wr 0 to configuration memory location (enable counting) while (I2C1_Is_Idle() == 0) ; I2C1_Stop(); // Issue stop signal }
year = (day & 0xE5) >> 6;
Code C - [expand] 1 Transform_Time()
Code C - [expand] 1 Write_Time()
Do you have any suggestion for internal pull up for p18f452 to solve the other problem
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?