Пт май 17, 2019 15:44:53
void SmgDisplay(void) // Write display register
{
unsigned char i;
I2CStart();
I2CWrByte(0x40); //40H address is automatically incremented by 1 mode, 44H fixed address mode
I2Cask();
I2CStop();
I2CStart();
I2CWrByte(0xc0); // Set the first address
I2Cask();
for(i=0;i<6;i++) // Addresses from Canada, do not always write address
{
I2CWrByte(0xff); // Send data
I2Cask();
}
I2CStop();
I2CStart();
I2CWrByte(0x8f); // Open display, maximum brightness
I2Cask();
I2CStop();
}
void I2Cask (void) // 1637 Answer
{
clk = 0;
Delay_us (5); // After the falling edge of the eighth clock delay 5us,
ACK signals the beginning of judgment
while (dio);
clk = 1;
Delay_us (2);
clk = 0;
}
procedure disp_write();
begin
SREG_I_bit:=0; //запретить прерывания
Soft_I2C_Init();
Soft_I2C_Start();
Soft_I2C_Write(%01000000);
Soft_I2C_Stop();
Soft_I2C_Start();
Soft_I2C_Write(%11000000);
Soft_I2C_Write(249);
Soft_I2C_Write(164);
Soft_I2C_Write(176);
Soft_I2C_Write(153);
Soft_I2C_Write(146);
Soft_I2C_Write(130);
Soft_I2C_Stop();
Soft_I2C_Start();
Soft_I2C_Write(%10001111);
Soft_I2C_Stop();
Soft_I2C_Write(%10001111); //разрешить прерывания
end;
Пт май 17, 2019 16:47:13
Пт май 17, 2019 21:15:25
Microprocessor data realize the communication with TM1637 by means of two–wire bus interface (Note: The
communication method is not equal to 12C bus protocol totally because there is no slave address).
void I2Cask (void) // 1637 Answer
{
clk = 0;
Delay_us (5); // After the falling edge of the eighth clock delay 5us,
ACK signals the beginning of judgment
while (dio);
clk = 1;
Delay_us (2);
clk = 0;
}
while (dio);
Пт май 17, 2019 23:04:35
Сб май 18, 2019 00:22:20
Пн май 20, 2019 22:25:38
Пт май 24, 2019 05:59:37
Вс июл 21, 2019 20:27:11