Ideas of Cheap USB2.0 High/Full speed CY7C68013A with SDCC

Show off any of your RTL-SDR or cheap SDR related projects.
Post Reply
Posts: 3
Joined: Thu Sep 22, 2016 7:20 am

Ideas of Cheap USB2.0 High/Full speed CY7C68013A with SDCC

Post by Wkhdkl » Mon Jan 09, 2017 8:31 am

Today I got a cheap 7$ mini EZ-USB FX2LP High-Speed USB 2.0 dev board with a Cypress CY7C68013A-56 controler.

click to enlarge:
Of course you can use the free USB driver CyUSB.sys with FreeBASIC. (I posted the USB stuff for Linux,Windows in the past)

If you will create your own USB device firmware you can download the docs and tools from Cypress
and you will get a toolchain and IDE from Keil as light/demo version for free.
(its limited you can compile only few KB on code)

I found the open source SDCC - The Small Device C Compiler on

Here are my first useless but working test. (blinking LED)
Code: Select all
#include "fx2regs.h"
#include "fx2types.h"
#include "delay.h"

void main(void) {
OED=0xff; // port D as output
for(;;) {
IOD=0x00; // all 8 pins low
IOD=0xff; // all 8 pins high
Of course I use code blocks for this tiny dev board also.

You must compile the USB device descriptors *.asm and your own firmware *.c
asm: sdas8051 -logs dscr.asm

c: sdcc -lfx2.lib -L../../lib -I../../include -mmcs51 --code-size 0x2000 --xram-loc 0x3000 -Wl"-b DSCR_AREA = 0x2000" -Wl"-b INT2JT = 0x2200" led.c dscr.rel

optinal: convert the intel hex file to a binary for upload.
sdobjcopy -I ihex -O binary led.ihx led.bix

Some details of the CY7C68013A:
8051 CPU with 48 MHz, 24 I/O lines (Port A,B,D), Timers, GPIF (hardware I/O waveform designer), 16 KB SRAM + ATMEL AT24C128 serial Flash and much more.

I'ts a USB bus powered 3.3 V device but the I/O pins are 5V tolerant.

For example you can sample Ports B,D = 16 I/O lines in a loop
and transfer chunks of the samples via USB cable to your FreeBASIC Windows/Linux/ARM application.

The result are the base of a 16 channel 24 MHz USB logic analyzer for 7$. ;-)

Or you control what ever you want with 24 I/O lines over USB.
The good old LPT port does the same but with fewer lines and much lower speed and it dies more and more.

Post Reply