It's a result of one of those "what if" moments i had during developing my own FV1 dev board. Sure, you could use the original Spin FV1 dev board with an adapter cable, but the target would have to be disconnected every time the new program is uploaded. Having two FV1s/two masters on the I2C bus, in my case often clocked differently (= different I2C frequency) is a no go. My new board already has an USB connection and at first i was thinking about implementing the eeprom burner into it. However, having something comfortable to use, so i can just hit the "build" button, the new firmware will be burned into the EEPROM, DSP resetted and ready to work, now that was very tempting!
I saw two hints telling that might be possible, without reverse engineering the whole usb stream between the SpinAsm and the original DevBoard or more important: without copying the original Spin dev board firmware (there is no need for that as it turns out):
- The Spinsemi dev board uses Cypress CY7C68013A microcontroller as an USB-I2C bridge. A pretty common technique used by manufacturers is to upload the firmware via USB into RAM right after the chip is enumerated and detected by the software.
- This told me i'm right on the track: there is a spindev.hex file in the main directory of the SpinASM IDE. I bet it is the one uploaded into the chip after boot up.
Next step was to make a piece of hardware that will introduce itself to the system as the SpinDev board to see if it'd work.I got one of these cheap (~6EUR) mini dev boards with the CY7C68013A MCU, they are clones of the EZ-USB FX2LP board (widely available on 'bay, i used one marked as "LCSOFT").
The onboard EEPROM (24LC128) had to be written with the VID/PID descriptors of the SpinDev board (sequence: C0 79 18 01 10 00 00 00 starting at address 0x00) and the jumper J1 installed to set the 24LC128's address at 0xA2 instead of 0xA0 to avoid overwriting it during the programming of the DSP EEPROM. I used the Pickit2 to write to the EEPROM. There is another way to do that without any additional hardware (it is an USB MCU in the end) by installing the Cypress USB Suite 3.4.7 software and using the CyConsole program. This method is slightly more convoluted, personally i found that hooking up Pickit2 onto the bus and doing the write was much easier and quicker.
And... it worked! The board was detected as SpinDev ONLINE within the SpinASM and i could program the target DSP EEPROM directly. That means there is actually no firmware stored inside the IC1 (24LC64ST - schematic), only the USB descriptors.
Hence, this hack does not require any copying of the original Spin Semi FV-1 dev board firmware.
Two things more had to be done to make it a comfortable tool:
- isolate the I2C bus from the target during the boot up.
FV1's EEPROM is at 0xA0 address, the Cypress chip looks first if there is anything at the 0xA0 on the I2C bus and if it finds an EEPROM, it reads the USB descriptors from it. Obviously the enumeration would fail, as it would read the first bytes of the DSP program. Of course it happens only if you leave the target DSP board connected to the programmer all the time. I do that quite often when i'm working on the project for a longer time. And frankly, the whole idea for this project is to have a one click solution to program/reprogram your own FV-1 based circuit. If there is nothing at 0xA0 the chip looks at 0xA2 and finds the onboard 24LC128 EPPROM with the VID/PID stored in it. In a very similar way as the SpinDev board, i designed an small add on pcb with a 4066 switch which is OFF at boot up and is turned ON after the programmer goes online (LED goes on). 4066 is powered from the target, don't forget to connect the VDD line. This way if there is nothing connected to the programmer, the MCUs pins are isolated from the outside world.
- enable automatic resetting the DSP after loading the new set of programs. This is done by pulling down the FV1's T0 line (internal/external programs) causing the chip to reload the actual program.
CAUTION! use pull up resistor (~10k is ok) on the T0 line instead of tying up it directly to the 3.3V
Connecting to the target board:
- Always connect the VDD and GND, as they power the 4066 switch isolating the programmer from the target.
- In order to use the auto reset function after uploading the firmware, do not tie the FV1's T0 pin directly to VDD. Use a 10k pullup and connect the T0 to the reset line
Programming the EEPROM:
The EZ-USB FX2LP board requires a small modification using an external I2C EEPROM programmer, like i.e. PicKit2: The onboard 24LC128 EEPROM needs to be erased and written with the following sequence of bytes starting from the address 0x00:
C0 79 18 01 10 00 00 00
If you don't have any other EEPROM programmer at hand, the same task could be done using the Cypress CyConsole program (part of the Cypress Suite USC 3.4.7). The jumper J1 should be installed, setting the EEPROM I2C address to 0xA2.
Design files are available in the github repository:
Click to open in new window
git clone https://github.com/hexeguitar/FV1_EEprog.git