Cypress技术论坛
直播中

吴立节

7年用户 200经验值
私信 关注
[问答]

当在读状态i设置DRUADDR动作时,使用寄存器作为源,在写状态中使用的DRADADR动作中的源也自动改变

你好,
我尝试在主模式中使用FX3来发送/接收数据到简单的外部总线。总线具有8位数据(双向)、7位地址(仅从FX侧写入)和WR/RD线用于简单切换(也仅从FX写入)。FX将有1个用于数据写入的大端点、1个用于数据读取的大端点和1个用于命令的控制端点。
因此,我已经创建了2个起始状态,一个用于读取,另一个用于写入(我计划根据接收的命令在它们之间切换)。对于写入,我通过在格式和lt;ADDR & gt;& lt;数据& gt中的大容量端点从PC接收2字节,然后使用DRUADDR(源:来自线程套接字)将其放到外部总线上,DRI数据然后切换WR。对于读取,在收到命令并通过控制端点读取的字节数之后,我计划手动编程DATAULCOUNT,然后使用DRUADDR(源:来自寄存器)将所需地址放入总线,然后切换RD,然后通过INA数据将接收到的数据放在大容量端点。
问题是,当在读状态i设置DRUADDR动作时,使用寄存器作为源,在写状态中使用的DRADADR动作中的源也自动改变,但我需要使用THEADSoCK作为源。我怎样才能解决这个问题?也许我错了,应该采用不同的方法吗?先谢谢你。

以上来自于百度翻译


     以下为原文
   Hi,
    I am trying to use FX3 in master mode to send/receive data to simple external bus. Bus has 8bit data (bidirectional), 7bit address (write-only from FX side) and WR/RD lines for simple toggle (also write-only from FX). FX will have 1 bulk endpoint for data writes, 1 bulk endpoint for data reads and 1 control endpoint for commands.
    So I have created 2 START states, one for reading and another for writing (I plan to switch between them depending on command received). For writing I receive 2 bytes from PC via bulk endpoint in format then put it to external bus using DR_ADDR (source: from thread socket), DR_DATA then toggle WR. For reading, after I receive command with address and number of bytes to read via control endpoint, I plan to manually program DATA_COUNT, then put desired address to bus using DR_ADDR (source: from register) then toggle RD then put received data to bulk endpoint via IN_DATA.
    The problem is that when in read state I set DR_ADDR action to use register as a source, source in DR_ADDR action used in write state automatically changed too, but I need to use ThreadSocket as a source there. How can i solve this? Maybe I am on wrong way and different approach should be used? Thank you in advance.

回帖(1)

h1654155275.5814

2019-7-4 13:27:06
你好,
对。在状态机中,所有的状态都只需要一个地址源(DRADADDR动作)。
我们只有两种方法来避免这个问题:
1。我们需要使用相同的地址源(Regitser或Socket)
2。如果不能使用公共源,则需要将两台状态机开发为两个单独的GPIF II项目(一个用于读取,另一个用于写入),并且当您在读写之间切换时,需要重新加载GPIF II配置。
谢谢,
Sai Krishna。

以上来自于百度翻译


     以下为原文
   Hi,
        
 
        
          
    Yes. You need to have only one source for address (DR_ADDR action) across all the states in a state machine.    
 
    We have only two ways to avoid this problem:    
 
    1. We need to use same address source (Regitser for both or socket)    
 
    2. If you can not use a common source then you need to develop your two state machines as two separate GPIF II projects (one for Read and other for Write) and you need to re-load the GPIF II configuration when you are switching between Read and Write.    
 
        
          
    Thanks,    
 
    Sai Krishna.    
举报

更多回帖

发帖
×
20
完善资料,
赚取积分