完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我尝试从ADXL345外部中断到PSoC4 BLE板。
我已经把所有的东西都配置好了,但是我没有受到加速度计的干扰。 但是,每当我把中断引脚连接到PSoC板上的电线,它就不断地给我中断。 我已经分配红色LED当板睡觉和蓝色当它醒来。当我拉开连接线时,它迅速闪烁。 我不确定这是否是加速度计配置或PSoC中断配置中的问题。 (我已经检查了加速度计在ARDUNO IDE中的作用,所有中断都很好地工作在那里,不活动,活动,轻敲,自由落体等。但我不知道如何将IDE的代码复制为C或头文件。 PFA项目(工作区有太多的其他项目,它的规模太大了) 当做, 维拉杰 Edir:——拼写和更新 Cyrjj.Access 01.Zip 636.1 K 以上来自于百度翻译 以下为原文 I'm trying to take an external interrupt from ADXL345 to PSoC4 BLE board. I've configured everything and but I'm getting no Interrupts from the Accelerometer. However, whenever I remove the wire connecting the Interrupt pin to the PSoC board, It gives me the interrupt continuously. I've assigned Red LED when board sleeps and Blue when it wakes up. When I pull the connecting wire out, It flickers rapidly. I'm not sure whether it's a problem in the accelerometer configuration or the PSoC interrupt configuration. (I've checked the functioning of Accelerometer in the Arduino IDE, all interrupts work fine there {Inactivity, Activity, Tap, FreeFall etc}. But I don't know how to copy that IDE's code as a C or Header File) PFA Project (Workspace has too many other projects, It's size is too big) Regards, Viraj EDIR :- Spellings and an Update
|
|
相关推荐
3个回答
|
|
您需要通过读取寄存器0x30清除ADXL345中的中断。
您已经编写了一个Read Byter()和Read Ebthe()函数,展开为一个Read Word()。在这些例程中保留错误处理。调用I2CyError()函数并在其中设置断点。然后你的整个程序看起来会更干净。 使用项目-gt;更新组件。一次,项目中有旧的组件版本。 你的PSoC板在3.3V下运行吗? 鲍勃 以上来自于百度翻译 以下为原文 You need to clear the interrupt in the ADXL345 by reading register 0x30. You already wrote a readbyte() and writebyte() function, expand to a readword(). Leave the error handling within those routines. Call an I2C_Error() function and set a breakpoint there. Then your complete program will look a lot cleaner. Use Project -> Update Components.. once, there are old component versions in your project. Are you running your PSoC board at 3.3V? Bob |
|
|
|
我现在使用了这个代码,我从加速度计读完后马上调用它。
monitorint_source虚空(void){ /*在这里意味着data_ready 0x80,而0x10意味着活动中断* / uint8 accregvalue;accelerometer_regread(int_source,&;accregvalue);如果(((accregvalue &;0x80)= = 0x80)&;&;((accregvalue &;0x10)!= 0x10))red_write(0);else if((accregvalue &;0x10)= = 0x10)green_write(0);其他red_write {(1);green_write(1);} uart_uartputchar(accregvalue);} 然而我得到相同的结果,data_ready闪烁红色迅速,每隔一段时间,但格林(活动中断)永远闪烁。 你能在readword()功能精心布置的,我不了解我应该做什么有。我的I2C通信工作完美,所以我不知道我为什么要把一个i2c_error()功能在里面,也i2c_error应该做什么我还不清楚。 我已经更新了我的成分,和改变的代码点(PFA)。而根据int_source领导的价值,我使它与中断子程序的变化。 我已经连接的PSoC板无电压等级信息的电脑。我已经连接了3.3V引脚到ADXL345的VCC。 当做, 维拉杰 TalalsSopy01.0. Cyrjj.CaseVo01.Zip 657.4 K 以上来自于百度翻译 以下为原文 I've used this code now, and I'm calling it right after I read from the accelerometer void MonitorINT_SOURCE(void) { /* Here 0x80 means DATA_READY, while 0x10 means ACTIVITY INTERRUPT */ uint8 accRegValue; Accelerometer_RegRead(INT_SOURCE, &accRegValue); if (((accRegValue&0x80) == 0x80) && ((accRegValue&0x10) != 0x10)) RED_Write(0); else if ((accRegValue&0x10) == 0x10) GREEN_Write(0); else { RED_Write(1); GREEN_Write(1); } UART_UartPutChar(accRegValue); } However I'm getting the same result, DATA_READY flashes red rapidly and at regular intervals, but Green(activity interrupt) never flashes. Could you ellaborate on readword() function, I'm not understanding what I'm supposed to do there. Also my I2C communication is working perfectly so I don't know why I should put an I2C_Error() function in there, and also what the I2C_Error shoudl do isn't clear to me. I've Updated my components now, and changed the code a bit (PFA). Instead of LED depending on INT_SOURCE's value, I'm making it change with the Interrupt subroutine. I've connected the PSoC board to the PC with no information on voltage level. I have connected the 3.3V pin to the ADXL345's Vcc. Regards, Viraj |
|
|
|
一些柏树套件(我不知道你有哪一个)可以从5V操作切换到3.3V。你需要在3.3V下运行。
用逻辑分析仪检查PSoC的中断输入 作为一个例子,我执行的错误检查功能为您从“CopStand”变量的所有查询中解压。在实践中,你可以把一个“闪烁的红色标志”或类似的东西来表明它不工作或问题的cysoftwarereset() API。 鲍勃 TalalsSopy01.0. Cyrjj.Access 01Y0.Zip 1.1兆字节 以上来自于百度翻译 以下为原文 Some of the Cypress kits (I am not aware which one you have got) can be switched from 5V operation to 3.3V. You need to run at 3.3V Check with a logic analyzer the interrupt input to the PSoC The error checking function as I implemented as an example unburdens you from all the queries of the "commStatus" variable. In practice you can put a "Blink red sign" or something similar to show that it is not working or even issue a CySoftwareReset() API. Bob |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2106 浏览 1 评论
1853 浏览 1 评论
3671 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1786 浏览 6 评论
1536 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
572浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
424浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
438浏览 2评论
386浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
916浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 23:58 , Processed in 1.050247 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号