完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在PSoC4中有可能得到这个吗?我打算使用它与特殊的24V司机与PLC通信。SDA和SLC将驱动与PLC 24VDC数字输出和水平转移到PSoC。为了从PSoC送回数据,我需要SDA输出不是相同的引脚来驱动它到PLC上的数字输入。
以上来自于百度翻译 以下为原文 Is there any possibility to get this in PSoC4? I am planning to use it with special 24V drivers to communicate with PLC. SDA and SLC will be driven with PLC 24VDC Digital Outputs and level shifted to PSoC. To send back data from PSoC I need SDA output wich is not the same pin to drive it to Digital input on PLC. |
|
相关推荐
3个回答
|
|
I2C引脚是开放式集电极上拉电阻。这适用于SDA和SCL(时钟拉伸)。因此,YOUT接口需要从24V电平转换到PSoC电平和OC输出。
鲍勃 以上来自于百度翻译 以下为原文 I2C pins are open collector with pull up resistors. This applies to SDA and SCL (clock stretching). So yout interface needs to level-shift from 24V to PSoC level and an OC output. Bob |
|
|
|
好吧,也许我的问题没有很好的定义。我²C默认是2线接口,爱娥只有2个州(Z和Q与逻辑0)。在PLC的世界没有可能具有相同的引脚作为输入和输出的时间是相同的。这样的情况下,当数据被转移到UC -我用PLC数字量输出,万一当奴隶是将数据传递回(或确认)我需要物理不同的引脚上UC给数据PLC输入引脚,不同于数据输出引脚。我的目标是让类似的SPI(SCK,MOSI,MISO)但没有奴隶选择引脚。在这种情况下,我只需要3根电线。SPI SS需检测启动和停止的框架,但我²C这是编码已经在SCL和SDA序列。也许有一些方法如何升级驱动程序自动检测帧的开始和结束帧从SCK和MOSI信号。在这种情况下,我有2个特点,同时没有SS引脚必要,数据可以在传递方向同时。从PLC的速度会很慢(奴隶做模块的工作周期通常小于5ms快不)。使一个脉冲输出我需要10ms。16bit变量将160ms +启动和停止的东西。这意味着200ms 16bit -这意味着5倍的每一秒我都可以转16bit。PLC世界这或多或少是好的如果没有专用通信处理器板。目标是使用PSoC,可以驱动4pwm使极简单的通信的奴隶,读4analog输入,读取8数字输入和所有这一切都可以控制和使用的只是普通的2digital输出PLC和数字输入读取。如果有超过1个奴隶的时钟输出,可用于所有的奴隶一样,这意味着如果我有8个奴隶,我需要9个数字输出和8个数字输入。这个配置是几乎所有的PLC -但可能这个配置是不是更接近标准PLCs(8×4pwm渠道例如或8×4模拟输入)。 以上来自于百度翻译 以下为原文 OK, maybe my question was not well defined. I²C by default is 2 wire interface, where IO have only 2 states (Z and Q with logical 0). In PLC world there is no possibilities to have the same pin as input and the same time as output. So in case when data is transfered to uC - I use PLC digital output, in case when slave is transfering data back (Or making ACK) I need physical different pin on uC to give data to PLC Input pin wich is different from data out pin. My goal is to make something similar to SPI (SCK, MOSI, MISO) but without Slave select pin. In this case I need only 3 wires. For SPI SS is necessary only to detect start and stop for the frame, but I²C this is encoded allready in SCL and SDA sequences. Maybe there is some way how to upgrade SPI driver to autodetect frame boginning and frame end from SCK and MOSI signals. In this case I have 2 features at the same time - no SS pin necessary, Data can be transfered in bouth directions at the same time. Speed from PLC to SLAVE will be pretty slow (DO modules are working not faster than 5ms cycle normally). To make one pulse on output I need to spend 10ms. 16bit variable will take 160ms + Start and Stop stuff. It means 200ms 16bit - that means 5x in every second I can transfer 16bit both ways. In PLC world thats more or less is OK if there is no special communication processors on board. Goal is to make extremely simple communication SLAVE using PSoC 4 wich can drive 4PWM, read 4Analog Inputs, Read 8 Digital inputs and all this can be controlled and read using just ordinary 2digital outputs on PLC and 1 digital input. If there is more than 1 slave - CLK output can be used for all slaves the same - that means if I have 8 slaves I need 9 Digital outputs and 8 Digital inputs. This configuration is almost all PLCs - but possibilities with this configuration is not even close to standart PLCs (8 x 4PWM channels for example or 8 x 4 Analog inputs). |
|
|
|
尼克wo 发表于 2019-1-7 15:09 你所描述的听起来像汽车行业的CAN总线。也许,试着使用/实现类似的东西?它允许多个设备在同一个两条线路上,具有足够快的速度来处理您描述的速率,只需要2/3根导线,并且实现仲裁,如果在同一总线上有多个设备,则需要处理这些仲裁。 如果你只是想用一种全局时钟线发送数据到你的设备上的方法,和一个特定于每个设备的数据输入/输出,那么你就可以用软件中的一个中断例程更好地碰运气。由于您只需要每16位200毫秒,那么您可以很容易地设置您的应用程序切换针当你切换时钟。 (设置时钟高,设置数据引脚,等待X MS,设置时钟低,等待X MS,重复每个字节的数据字节发送/接收) 以上来自于百度翻译 以下为原文 What you are describing sounds an awful lot like a CAN bus from the automotive industry. Perhaps, try using/implementing something similar to that? It allows for multiple devices on the same two wires, has a fast enough speed to handle the rates you describe, only requires 2/3 wires, and implements arbitration which you would need to deal with if you have multiple devices on the same bus. If you are just wanting some method of transmitting data to your devices with: a global clock wire, and a data input/output specific to each device, then you might just have better luck bit-banging it with an interrupt routine in software. Since you only need 200 ms per 16 bits, then you could pretty easily setup your application to toggle the pins as you toggle the clock. (Set clock high, set data pins, wait x ms, set clock low, wait x ms, repeat for each bit of x bytes of data to transmit/receive) |
|
|
|
只有小组成员才能发言,加入小组>>
716个成员聚集在这个小组
加入小组1901 浏览 1 评论
1652 浏览 1 评论
3405 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1568 浏览 6 评论
1380 浏览 1 评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
186浏览 2评论
183浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
321浏览 2评论
349浏览 1评论
62浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-24 13:57 , Processed in 0.666331 second(s), Total 77, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号