完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我把三个开关连接到CY8C9560A和LED上的三个GPIOS到其他GPIOS的12个。 所以,当开关被按下时,我用不同的模式切换LED。 现在,我启用了CY8C9560A上的中断机制,如果在GPIO状态发生任何中断,则中断发生,这与开关连接。 我将中断线连接到主板(Atmel Controller),因此,在中断时,我正在读取中断状态寄存器,并通过I2CX写入切换相应的LED。 我的问题是 1。在柏树板编程之后,我能在没有主设备的帮助下完成所有这些操作吗? 2。我们可以将所有设置存储在EEPROM中,并通过上电复位,这些操作可以由CyPress控制单元本身来处理。 如果是,我需要做什么样的设置?如何加载这些设置? 感谢和问候 马德霍 以上来自于百度翻译 以下为原文 Hi , I connected three switches to the three GPIOs on the CY8C9560a and LEDs to the 12 of other GPIOs. So, when ever the switches are pressed ,i'm Toggling the LEDs in different patterns. Right now, I'm enabling the Interrupt mechanism on the CY8C9560A to generate an interrupt if any changes occur in the GPIO states , which are connected to switches. I connected the interrupt line to Master Board(Atmel Controller), so , on interrupt i'm reading the interrupt status register and toggling the corresponding LEDs through i2c_write. My Question is 1. Can i do all these operations without the help of Master device after programming the cypress board? 2. Can we store all the settings in EEPROM and by Power ON Reset can these operations be handled by the cypress control unit itself.? If yes , what type of settings i have to do ? How to load such settings ? Thanks & Regards R Madhu.samp |
|
相关推荐
4个回答
|
|
你好,Madhu,
由于CY8C9560A是一种外围设备,所以它不被设计为存储程序逻辑,因此将不能在开关状态的改变上打开LED。 如果你可以尝试编程,我建议你使用我们最新的PSoC4设备。 谢谢和问候, 萨姆普斯 以上来自于百度翻译 以下为原文 Hello Madhu, Since the CY8C9560A is a peripheral device, it is not designed to store program logic, and hence would not be able to turn on LEDs with respect to the change in switch states. If you can try your hand in programming, I suggest you use our latest PSoC4 device. Thanks and regards, Sampath |
|
|
|
clslda 发表于 2019-1-7 10:31 明白了,Thanks Sampath。 所以,我总是要用师傅来控制柏树。 此外,我试图配置PWM的GPIO之一,我连接一个有源低LED到第一针端口1与上拉电阻。 下面的步骤我激活PWM, 但是我在LED上得到恒定的电压,它总是发光,我没有看到光强度的任何变化。 I2CXWRITE One字节(0x18.0x01); I2CXRead EnOne字节(0x1a,0x02); I2CXWRITE One字节(0x1C,0x00); I2CX写入字节(0x28,0x03); I2CXWRITE One字节(0x29,0x04); I2CX写入字节(0x2a,0x20); I2CX写入字节(0x2b,0x10); 我希望光强度会持续变化。 那么,对吗?如果不是,你能解释一下PWM的一般工作吗? 并在上述情况下正确配置? 谢谢和问候, 马杜胡 以上来自于百度翻译 以下为原文 Got it, Thanks Sampath. So, always i have to use the master to the control the the cypress periperal. Also i am trying to configure the PWM on one of the GPIO , I connected one active low LED to the 1st PIN of Port 1 with a pull-up resistor. The below steps i followed to activate the PWM, But i am getting constant voltage on the LED and it glows always, i didn't see any change in the Light intensity. i2c_write_one_byte(0x18,0x01); i2c_write_one_byte(0x1a,0x02); i2c_write_one_byte(0x1c,0x00); i2c_write_one_byte(0x28,0x03); i2c_write_one_byte(0x29,0x04); i2c_write_one_byte(0x2a,0x20); i2c_write_one_byte(0x2b,0x10); I expected that light intensity will vary continuously. So, is that correct ? If not , can you please explain me the general working of the PWM. and to configure correctly , in the above case ? Thanks and Regards, R Madhu. |
|
|
|
hgjhgd 发表于 2019-1-7 10:40 你好,Madhu, 在你的序列中有一些修正,如下 I2C*WrreEnOne字节(0x18.0x01);/ /选择端口α1 I2CXRead EnOy字节(0x1a,0x02);/ /选择PWMα2 I2CXRead EnOy字节(0x1C,0x02);//允许在P1Y2上输出 I2CX写一个字节(0x28,0x02);//选择PWMα2,PWM PWM 2只能在P1Y2上输出。 I2CX写字节(0x29,0x04);//时钟可编程分频器 I2CX写入字节(0x2a,0x20);/PWM周期 I2CX写入字节(0x2b,0x10);//PWM脉冲宽度 I2CX写字节(0x2C,0x80);/ /可编程分频器值 这应该输出大约36Hz的P1Y2,具有恒定占空比为50%。 为了改变LED的强度,你应该通过指定一个新的值来改变脉冲宽度。 I2CX写入字节(0x2b,0x18);//PWM脉冲宽度 等等。 谢谢, 萨姆普斯 以上来自于百度翻译 以下为原文 Hello Madhu, There are some corrections to be made in your sequence, as follows i2c_write_one_byte(0x18,0x01); // Select Port #1 i2c_write_one_byte(0x1a,0x02); // Select PWM #2 i2c_write_one_byte(0x1c,0x02); // Enable Output on P1_2 i2c_write_one_byte(0x28,0x02); // Select PWM #2, as PWM #2 only can be output on P1_2 i2c_write_one_byte(0x29,0x04); // Clock from programmable divider i2c_write_one_byte(0x2a,0x20); // PWM Period i2c_write_one_byte(0x2b,0x10); // PWM pulse Width i2c_write_one_byte(0x2c,0x80); // Programmable divider value This should output around 36Hz on P1_2, with a constant duty cycle of 50%. In order to vary the intensity of the LED, you should change the pulse width by specifying a new value i2c_write_one_byte(0x2b,0x18); // PWM pulse Width and so on. Thanks, Sampath |
|
|
|
谢谢SAMPATH的大量信息,现在我明白了。 上面的代码和2个变化,它是为我工作。 根据数据表写入1到0x1C,将使该引脚作为输入,所以对于输出,我使它为零。 I2CXRead EnOy字节(0x1C,0x00);//允许输出 端口1中的第一个引脚也连接到PWMY4源,所以我必须在0x28寄存器中写入0x04。 选择I2CXWrreOne字节(0x28,0x04);//pWMy4。 正如你提到的,通过在0x2b寄存器中写入不同的值,我可以看到强度的变化。 再次谢谢你。 马德胡 以上来自于百度翻译 以下为原文 Thanks sampath for lot of information, Now i understood clearly. The above code and with 2 changes, it is working for me. As per data sheet Writing 1 into 0x1C , will make that pin as input, so for output i made it zero. i2c_write_one_byte(0x1c,0x00); // Enable Output Also the 1st pin in the port 1 is connected to PWM_4 Source , so i have to write 0x04 in the 0x28 register i2c_write_one_byte(0x28,0x04); // PWM_4 is selected. And as you mentioned, i can see the variations in the intensity by writing different values in the 0x2b Register. Thank you once again sampath. R Madhu |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2105 浏览 1 评论
1851 浏览 1 评论
3669 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1786 浏览 6 评论
1536 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
568浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
423浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
437浏览 2评论
383浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
915浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 10:52 , Processed in 1.141200 second(s), Total 82, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号