完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
亲爱的朋友们,感谢你们提供与专家互动的机会!这里我要执行并行到串行数据转换。因此,我使用的是7HC165,8位并行输入/输出移位寄存器。我需要C代码来读取和存储故障状态为变量(如无符号字符)。我尝试过C代码,但它不工作。基本上我有一个8窗口通知器产品,我想读取八种不同的故障状态。这些故障可以是逻辑0,也可以是逻辑1。现在这八个状态将被收集到一个变量(数据类型:无符号char,值0B900MAM/0B11111111是可能的)硬件逻辑如图(a)所示:D0到D7是八个故障状态,可以是逻辑0或逻辑1。请建议正确的C代码读取和存储故障状态为变量,谢谢!问候,Santosh BhatSr。恩格,班加罗尔
以上来自于百度翻译 以下为原文 Hi dear friends, Thanks for providing the opportunity to interact with you experts! Here I want to perform parallel to serial data conversion. Therefore I am using 74HC165, 8-bit parallel-in/serial-out shift register. I need C code to read & store the fault status into Variable( say unsigned char). I tried below C code but its not working. Basically I have an 8 Window Annunciator product where I want to read the Eight different Fault status. These faults can be either Logic 0 or Logic 1. Now these Eight status shall be collected into a Variable(datatype: unsigned char, as value 0b00000000/ 0b11111111 is possible) Hardware logic is illustrated as shown in fig(A): D0 to D7 are eight fault status which can be either Logic 0 or Logic 1. C Code to read & store the status is attached as follows: So kindly suggest the correct C code to read & store the fault status into Variable. Thanks! Regards, Santosh Bhat Sr. Engg, Bangalore Attachment(s) C code attach1.txt (2.22 KB) - downloaded 68 times |
|
相关推荐
1个回答
|
|
|
您的代码缺少所有PIN的定义(PLAN使能、SerialYLCK、CHIPAULL、FALKTHPAAT)和设置PIN方向的代码。十个问题中有九个问题在你不张贴的位子上。只是从GuScWork中,我敢肯定你处理错误的PATP PIN不正确。
以上来自于百度翻译 以下为原文 Your code is missing the definition for all your pins (PL_ENABLE, SERIAL_CLK, CHIP_ENABLE, FAULT_PAT) and the code to set the pin directions. It really is better to post ALL your code. Nine times out of ten the problem is in the bit you don't post. Just from gusswork, I'm pretty sure you are handling the FAULT_PAT pin incorrectly. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5795 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1126浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 06:46 , Processed in 0.677262 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1877