======================================== notes_dhr.txt 2019 ======================================== EBAY suggested Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit These use a micro processor that boots from the USB, or an external 24LC128 EEPROM There is open source tools. Use the SDCC compiler: http://sdcc.sourceforge.net/ This WIKI is useful. http://www.geeetech.com/wiki/index.php/CY7C68013 - two links The is useful for building, but the examples don't work:- https://github.com/djmuhlestein/fx2lib This is really useful. Problems with __ in include files. https://www.triplespark.net/elec/periph/USB-FX2/software/ You need to install libusb-dev sudo apt-get install libusb-dev pi@raspberrypi:~ $ sudo apt-get install libusb-dev Reading package lists... Done Building dependency tree Reading state information... Done libusb-dev is already the newest version (2:0.1.12-30). The following package was automatically installed and is no longer required: libserialport0 Use 'sudo apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded. pi@raspberrypi:~ $ ======================================== Also http://www.geeetech.com/wiki/index.php/EP2C5T144C8 ======================================== Accessing the ======================================== /* find out about usb devices */ pi@raspberrypi:~/Desktop/fx2lib-master/examples/doug/fx2_programmer $ lsusb Bus 002 Device 002: ID 0bda:0316 Realtek Semiconductor Corp. Bus 002 Device 003: ID 26bd:9917 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 010: ID 138a:0097 Validity Sensors, Inc. Bus 001 Device 009: ID 5986:111c Acer, Inc Bus 001 Device 008: ID 8087:0a2b Intel Corp. Bus 001 Device 007: ID 0781:5573 SanDisk Corp. Bus 001 Device 006: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader Bus 001 Device 012: ID 0925:3881 Lakeview Research Saleae Logic Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub pi@raspberrypi:~ $ lsusb Bus 002 Device 002: ID 0bda:0316 Realtek Semiconductor Corp. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 006: ID 138a:0097 Validity Sensors, Inc. Bus 001 Device 005: ID 5986:111c Acer, Inc Bus 001 Device 004: ID 8087:0a2b Intel Corp. Bus 001 Device 003: ID 0781:5573 SanDisk Corp. Bus 001 Device 002: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader Bus 001 Device 009: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub pi@raspberrypi:~ $ pi@raspberrypi:~/Desktop/fx2lib-master/examples/doug/fx2_programmer $ ./fx2_programmer 001 012 dumpbuss Using device 012 on bus 001 vendor id 0x0925 product id 0x3881 pi@raspberrypi:~/Desktop/fx2lib-master/examples/doug/fx2_programmer $ ./fx2_programmer 001 012 dumpbusses Using device 012 on bus 001 vendor id 0x0925 product id 0x3881 pi@raspberrypi:~/Desktop/fx2lib-master/examples/doug/fx2_programmer $ use lsusb to get bus and device numbers ./fx2_programmer 001 012 dump 0 1000 use OEA=0xff to turn on the outputs. /* enable port A as outputs */ OEA = 0xFF; IOA = 0xaa; delay(200); IOA = 0x55; delay(800); python ihx2iic.py build/lights.ihx lights.iic https://www.triplespark.net/elec/periph/USB-FX2/eeprom/ pi@raspberrypi:~/Desktop/cypress/cycfx2prog-0.47 $ ./cycfx2prog prg:i2c.ihx pi@raspberrypi:~/Desktop/cypress/cycfx2prog-0.47 $ ./cycfx2prog run pi@raspberrypi:~/Desktop/cypress/cycfx2prog-0.47 $ ./cycfx2prog --help Usage: cycfx2prog [-d=BUS.DEV] [id=VV.PP[.N]] [commands...] Options: --help print this and then exit --version print version information and then exit --list list devices and busses and then exit -d=BBB.DDD set device to use e.g. 006.003; if not specified, first unconfigured Cypress FX2 is used. Use --list to get BBB and DDD (bus and device number, not ID). -id=VV.PP[.N] set vendor and product ID in hex; default 04b4.8613 for unconfigured FX2. N is the n-th device to use, default 0. Commands: Must be specified after all options. reset reset 8051 by putting reset low run start the 8051 by putting reset high prg:FILE program 8051; FILE is an Intel hex file (.ihx); will reset the 8051 before download; use "run" afterwards delay:NN make a delay for NN msec set:ADR,VAL set byte at address ADR to value VAL dram:ADR,LEN dump RAM content: LEN bytes starting at ADR dbulk:EP,L[,N] bulk read N (default: 1) buffers of size L from endpoint EP (1,2,4,6,8) and dump them; L<0 to allow short reads sbulk:EP,STR send string STR as bulk message to endpoint EP (1,2,4,6,8) fbulk:EP,FILE[,CS] send FILE as bulk message to endpoint EP (1,2,4,6,8) stdin if no file specified; chunk size CS with default 64 bench_bulk:EP,L[,CS] bench reading L bytes from endpoint EP (chunk size CS) NOTE: This uses libusb and is slow on the host side! altif:[IF] set alt interface for next bulk IO; none for FX2 default ctrl:TYPE,REQUEST[,VALUE[,INDEX]] send a zero-length control message Cypress FX2(LP) programmer tool v0.47 copyright (c) 2006--2009 by Wolfgang Wieser pi@raspberrypi:~/Desktop/cypress/cycfx2prog-0.47 $ ./cycfx2prog -d001.011 prg:i2c.ihx run Illegal option "-d001.011". pi@raspberrypi:~/Desktop/cypress/cycfx2prog-0.47 $ ./cycfx2prog -d=001.011 prg:i2c.ihx run Using ID 0925:3881 on 001.011. Putting 8051 into reset. Programming 8051 using "i2c.ihx". Putting 8051 out of reset. pi@raspberrypi:~/Desktop/cypress/cycfx2prog-0.47 $ lsusb Bus 002 Device 002: ID 0bda:0316 Realtek Semiconductor Corp. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 008: ID 138a:0097 Validity Sensors, Inc. Bus 001 Device 007: ID 5986:111c Acer, Inc Bus 001 Device 006: ID 8087:0a2b Intel Corp. Bus 001 Device 005: ID 0781:5573 SanDisk Corp. Bus 001 Device 004: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader Bus 001 Device 011: ID 0925:3881 Lakeview Research Saleae Logic Bus 001 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub pi@raspberrypi:~/Desktop/cypress/cycfx2prog-0.47 $ /* ***************** */ booting 1) if C0 VID PID boot from USB lead. 2) if C2 VID PID code. 3) else eprom content not code The CY7C68013 has a default bootloader built in ./cycfx2prog is very usefult, but does not have seconday boot commands for filling 24LC128 eeprom Use Raspbarry Pi and ri2ceprom_rpi_24LC128_0x51_.c to write to 24LC128 I used fx2lib i2c.c example, but it needs amendin to get timing right. I have uploaded i2c.c which can be used to write eeprom if you cannot connect Raspberry Pi. You need sudo apt-get install libuser-dev and SDCC ======================================== Getting /home/pi/Desktop/cypress/fx2pipe-0.8 to compile ======================================== Download from: https://www.triplespark.net/elec/periph/USB-FX2/ when you type make there are lots of errors. You need to add __ e.g. #define ALLOCATE_EXTERN #ifdef ALLOCATE_EXTERN #define EXTERN //#define _AT_(a) at a #else #define EXTERN extern //#define _AT_ ;/ ## / #endif #define _AT_(a) __at a #define xdata __xdata #define sfr __sfr #define at __at //#define NOP _asm nop _endasm #define NOP __asm nop __endasm #