This is the first version of the device , and it is not without drawbacks. Including sometimes the device freezes for no apparent reason . To be honest I was lazy to catch this bug . Not often freezes and Restarting .
Often , when debugging devices , it is necessary to validate the data exchange between modules. In the simplest cases , in order to find a bug , is quite simple to determine whether or not there is an exchange . On the multimeter , and it’ll do .
But more often than is necessary to understand at what stage of the exchange failed. Whether the transfer fell through , even at the stage of preparation of the data , or maybe prevented the exchange of another device hanging on the line. The situation becomes especially complicated when data exchange is implemented for the most part in software. Here multimeter will not help.
And so , in order to simplify / speed up the process of debugging , I decided to make i2c sniffer . Initially, the problem was this: listen I2C line and send the log to your computer. When this was done , it became clear that there is still Tiny2313 free full flush. Therefore, additional functionality was coined .
That’s what eventually happened :
His appearance is not the most glamorous , nor is it was not necessary.
– Communication with PC via UART. Now connected to the COM port that is not very convenient (you have to separate hem power) . In the second version will make the USB connection on the basis of FT232.
– In i2c sniffer works confidently in the exchange rate ( the frequency of SCL) up to 50 kHz . In this mode, it records all activity on the line in the log that is in the background is thrown out on the PC . Together with each entry written to the log time .
The first thing I ‘ll tell you about what ‘s inside i2c sniffer , for this is the functionality for which the device was intended . Sniffer I’ll describe a little more than the rest of the functions . It is implemented on the basis of USI, and is another example of this pribludy (otherwise USI will not name) .
Then I will discuss the master mode . i2c master is also implemented on the USI. 1 -wire software completely , and nothing particularly interesting in itself is not .
But first , the total excursion :
For power converter is responsible for 78L05. Or , as I said , you can pull up to 5V device debugging . In general , it is certainly inconvenient. The next version will be USB. On power diodes are so difficult to burn the device .
In touch with us max232. My layout may seem too small (so16 and 0805 Conder almost vlotnuyu to it) , but in another way it does not fit there .
20MHz quartz . One would take less, such as 16. High speed is needed for fast operation state machine i2c sniffer . The case of quartz I grounded, so to the ” safe side “.
ATTiny2313 reigns . First, it’s one of the few owners of USI. Second, it can be dispersed up to 20MHz . Connector for software that I gave , so you have to fluster posting.
On the lines SDA and SCL ( it PB5 and PB7, respectively ) is the pull-up resistors on the 4.7k . They are connected to pin PB6, which , on command from a computer connected to the power supply , providing an internal lift .
There is still room for four LEDs, which , as a result of any use .