UART to I2C Converter via Attiny2313A
This Project gives direct connexion from UART to I2C Bus with up to 34Bytes. I communicate via HTerm and my Converter with I2C Bus. So i can write or read data from/to I2C via Terminalprogramm. This is similar to FT201x. First byte ist the Adressbyte inclusiv Read/Write bit. You can switch I2C Speed: 0xF4 0x00 is 100Khz and 0xF4 0x01 is 400Khz. If you send only 0xF5 you get the actually speed.
This Project gives direct connexion from UART to I2C Bus with up to 34Bytes. I communicate via HTerm and my Converter with I2C Bus. So i can write or read data from/to I2C via Terminalprogramm. This is similar to FT201x. First byte ist the Adressbyte inclusiv Read/Write bit. You can switch I2C Speed: 0xF4 0x00 is 100Khz and 0xF4 0x01 is 400Khz. If you send only 0xF5 you get the actually speed. Speed, Reports,Transfer Okay do you get via USART. So you can complete Test your I2C hardware. To test is an 24C16 EEprom Onbord.
You need it to:
-Test I2C Bus, Circuits, Sensors in Short Time
-Understand How To and Test Datasheets
-Lern about I2C Protokoll
Update V2: 115200 Baud and without breaks. Pin 12 PB0 get +5V 5ms after first byte send, you need it to get in command mode to chance adress of humidity sensors.
Update V3: Windows Software UART_I2C writed in C# is availiable. So you can easy Write/Read little files to 24C16, you can switch beetween 100KHz or 400KHz bus, you can readout the aktually I2C Speed, you can switch COM-Ports, Init the RV3029 Clock, Read out the Date/Time from RV3029 and write the aktually PC-Time to RV3029 (Using http://www.elektor-labs.com/project/highly-accurate-clock-and-calender-module-i-c-bob.14318.html ) . Windowssoftware & Picture uploaded.
If you use an ATTiny4313, then you can insert a switch between I2C to SPI an so you have an UART to SPI Converter. With ATtiny4313 the buffersize can be 64Byte.
Exampels / Output Bytes (Hex) in HTerm and --> Request in HTerm
A0 00 Set Adresspointer of 24C16 to zero --> OKAY
A0 03 0F Write Byte 0F to Adress 03 of the 24C16 --> OKAY
A1 04 Read four Bytes from 24C16 from aktual adress --> four Bytes
F4 00 Set I2C Speed to 100KHz -->Set100KHz
F4 01 Set I2C Speed to 400KHz -->Set400KHz
F5 How is the aktual speed? --> 100KHz or 400KHz
Discussie (0 opmerking(en))