I think i don’t need to convince anybody, how great device the logic analyzer is. This one leaves far behind every old-fashion LPT versions, as well as AVR with external RAM based ones. Depending on chosen PC application (the real analyzer part, actually), it can collect for an example, up to 24 millions of samples per second from 8 channels at the same time, and the buffer capacity is just our PC free RAM space…
Performance is impressive, completely sufficient for the hobbyist or even for professionals. It offers instant switching between over a dozen devices with one single button. Samples are sent in a real time by the Hi-Speed USB – it is recommended to use a short, high-quality USB cable. Since this is device cloning someones hard work (but how many of these are available on local or China market), so i won’t mention the names of these devices… but such information can be easily found on the web :) All these construction uses almost the same solution, and differs by additional elements such as buffers or protections. The main chip, CY7C68013A, can present itself to the system with any identifier, which is taken from external eeprom memory. So if we want to use this board with multiple PC applications (one is better than another), we need to change the content of this eeprom. Some of clones which are sell on the market, have two eeprom chips and a jumper, which allows the user to change identifier. This kind of solution is not very convenient, and it allows to set only two identifiers, or we can always solder additional eeproms and jumpers sets. Version presented here allows rapid switching between over a dozen identifiers with a single button hit, and also for each one, it automatically sets a direction of buffers, so it can work as analyzer or as generator.
How it works:
Identifiers switching is made using a tiny uC AVR, Attiny25. Attiny13 can be also used, it’s much more cheaper. Attiny25 was picked at the begining, because the first assumption was that, it would just EMULATE the I2C eeprom chip with help of built in USI module (universal serial interface) which can be also configured to work in I2C mode – it would be fast enough to work in his role. It internal eeprom was supposed to be divided for 16 or 8 byte fragments, used to saving identifiers. It task would be to rely on switching these memory fragments, and taking care for saving and reading while emulating mentioned I2C eeprom. That is – we press the button, Cypress chip is resetting, while in the same time our Attiny increases offset pointing at next memory fragment. Cypress i starting and read this memory as a standard eeprom chip, new device appears in system.
However this idea was abandoned because it wasn’t specially hard or impossible to make, but the new idea was born, much simpler. And it works like this:
1. Press of the button, Cypress chip reset and signal for the Attiny.
2. Attiny holds down this reset state with its own pin, until whole operation is finished.
3. Attiny communicates with our physical I2C eeprom on board (common I2C bus), and same like before offset is being increased, it reads new (next) identifier from internal eeprom memory, but this time it writes down these data in to physical eeprom.
4. Attiny switches his I2C lines in to input mode and releases Cypress reset.
5. Cypress starts and reads identifier from physical eeprom, as usual.
The benefits from that kind of solution are, much simpler realization, and a fact, that application sent in to main chip has a free access to the eeprom memory. In case of emulating, this would be very limited both from program side and capacity (small internal Attiny eeprom).
Two fast bi-directional 74LVC245A buffers are placed on the pcb, which can accept high state voltage from 2V to 5.5V, and low state from 0V to 0.8V, which allows analysis in basically every each logic circuits working with TTL voltages. Additionally, every each buffer output and input has an ESD protection (electrostatic discharge). Buffer has ability to switch the direction of all data lines, depending if our device is supposed to work as generator or analyzer. This task is also for Attiny, his two pins are controlling the direction of both buffers.
Eeprom size selector jumper is also on board, which must be connected accordingly with the CY7C68013 chip datasheet eeprom size table. This table says that for 16B to 256B memories (byte addressed), address pin A0 has to be set low, and for 4KB to 16KB (word addressed) up. If our memory will respond at address 160, main chip will now that it must to work with byte addressing. If memory won’t respond, then main chip will ask at address 162 – after respond it will know that it must to use word addressing. Small advice here, not every cloned devices will work with bigger memories, before soldering check what size of memory is used in original device.
Double-sided pcb with 41mm x 61mm dimensions, aligned for small Z-24A casing type. Board seen on pictures is in first revision, so it differs from board from the attachment (rev 1.1) and you can help yourself with those pictures because changes are not so big – mounting holes have been moved for better compatibility with Z-24A casing, I2C line selector (eeprom/attiny) jumper was removed, and the main chip reset pin was changed to not collide with ISP lines. Board seen on pictures has only one buffer, reason is silly – i made a mistake in parts ordering :) Applications that i use however do not makes a use from the second channel. In matter of fact, second channel has been added in reserve.
Every each device identifier consist of VID and PIN numbers, presenting our device in the system. Change of these identifiers will cause device to present in the system as something else, f.e. as other analyzer or generator. Entry for CY7C68013 looks as follows:
C0 B4 04 13 86 00 00 00
C0 – says that after this VID i PID are placed
B4 04 – VID number
13 86 – PID number
00 00 00 – chip settings, not significant, set them to zeros.
Above identifier for “EZ-USB FX2LP”, our Cypress chip (also when eeprom will be empty) – thanks to this, it will be seen in EZ-USB console.
Please remember, switch the bytes when typing in identifiers words – LITTLE ENDIAN form. Real identifiers in above example are “04B4 8613” and in this way they will be seen in the system.
Identifiers list have been placed in the Attiny eeprom memory, not because it can’t fit in flash memory (program takes only 462 bytes or so), but because this kind of memory can be easily read and edited in usual binary editor. Not everyone wants to recompile the code, not everyone have that kind of compiler. Picture below shows how the identifiers are placed in the memory:
As seen, memory was divided for 8 byte fragments, so when writing down the identifiers, 0xC0 byte should be always placed after every 8 bytes (at 00, 08, 10, 18 addresses (hex)). First, code checks if the first byte is 0x0C – if not, then it acknowledges that it arrived to the end of the list and jumps at 00 address. Above example shows eeprom file construction. It contains 7 identifiers of different devices, each one starts from 0x0C byte, each takes 8 bytes in total.
Buffers directions are determined with two less significant bits in of last identifier byte. Bit 0 for buffer 1 (channels 0-7), bit 1 for buffer 2 (channels 8-15). Set low for input, set high for output. If same device / application can work as both analyzer and generator (and original design do not have any buffer), please use two identical identifiers, with different directions set. For example, after one press of the button we get X device working as an input, after second press we get also X device but working as a output. 128B memory of the Attiny25 can fit 15 identifiers – last 8 bytes are used by the code to hold settings (which device was last used, so you don’t have to go trough all of them when re-connected). Attiny13 will fit 7 identifiers, but be aware that code from attachment need changes before it can be used in other chip.
Assembly, getting started:
Refer to the schematic. Cypress chip can be soldered using some regular flat soldering iron with help of large amount of fluxe. First apply a thin layer of solder on the pads, place the chip, and press all the legs with iron, like shown HERE. Careful soldering will result with less problems with launching. I do not recommend to leave fluxe under the chip, and board itself should be precisely washed, especially in crystal area. CY7C68013 is a bit capricious, it will not identify itself in the system if we make some little mistake. HERE is the AN15456 datasheet in which possible problems are described – it helped me a lot at the first try.
To get started, you just only have to install device driver for chosen device. I recommend to install the EZ-USB console first. It will work with the fabric identifier or without / empty eeprom. Driver is not signed, so you have to bypass this problem on some new systems. You can experience strange problem on vista/7 when device won’t show up in system until we wont manually point out the driver.
And this is how identifiers are changed (changing randomly on the movie, a bug in the early version of the program)
DOWNLOAD – Eagle 5.10 files: PCB, SCH, alternative PDF revision 1.1 HEX code, BAS source code version 1.03.