⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 站长:我所上传的是FX2开发板的相关程序及驱动,绝对是有市场的,FX2开发板在市上卖到800-500元,有了这些程序,就可以自己设计了,不用发钱买了. The purpose of this cod
💻 TXT
字号:
This directory contains 8051 firmware for the Cypress Semiconductor EZ-USB FX2 
REVD (and above) chip (specifically 100-pin part, but can be tested under the 
DK(128-pin part)).

The purpose of this code is to demonstrate how to utilize EZUSB FX2 PORTC STROBE
FEATURE.



It configures FX2 as follows:
01).  peripheral interface set to ports mode
02).  EP1OUT 512 BULK OUT - PORTC STROBE WR# for writes
03).  EP1IN 512 BULK IN - PORTC STROBE RD# for reads
04).  CLKOUT inverted (ext.) - to assist with peripheral setup timing
05).  CPUSPD = CLKOUT = 48MHz
06).  PA0 pin asserts at the start of writes, logic analyzer trigger
07).  PA1 pin asserts at the start of reads, logic analyzer trigger
08).  turns ON debug LED3 in the event the host sends a zerolen OUT pkt.



Note: both endp1 buffers are physically limited to 64 bytes... what this means 
is that the user must never send/receive more than 64 byte pkt. within a 
single xfr over these specific endp's.

Warning:  Some USB2.0 PDK host drivers (older) may not handle sending a zero 
length OUT pkt gracefully.  In one case it has the effect of rebooting the 
development PC.

Warning:  This firmware was written for the 100-pin part.  It was tested on the
CY3681 (128-pin part).  Please note that ANY xdata access via MOVX will strobe
RD#/WR# (including manipulating the DK debug LED's).



Pins to view via Logic Analyzer:
CLKOUT
PA0 - la trigger for writes
WR# - asserts for two (2) CLKOUT cycles when writting to PORTC - STROBE FEATURE
PA1 - la trigger for reads
RD# - asserts for two (2) CLKOUT cycles when reading from to PORTC - STROBE FEATURE
PORTC[7:0]

Note: CLKOUT in this example has been externally inverted.  This scheme may
assist with peripheral applications that are synchronous to the rising edge 
of CLKOUT...



The "portcstb.hex" file loads into internal memory.
...issue "build -i" at the command prompt...



"portcstb" pseudo code
======================

 Host sends EP1OUT token 
 =======================
 if endp "not empty event", (BUSY=0)
  if pkt has data
   trigger la, PA0
   portc pins as outputs
   xfr data out portc
  else
   zerolenpkt detected, turn on LED3
   
  re-arm endp
   


 EP1IN buffer available 
 =======================
 if endp buffer available, (BUSY=0)
  trigger la, PA1
  portc pins as inputs
  xfr portc data to endp buffer
  commit the pkt


Note:  this example constantly fills the IN endp buffer with PORTC data as the
buffer becomes available...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -