完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
我设计了一个在1 spi总线上有8个LIS3mdl传感器插槽的电路。 当我只将一个ls3mdl传感器(其他7个是空的)连接到电路板时它的问题很好。但是当我连接另一个(有时是2个,有时是3个或4个或更多)时,大多数传感器都停止工作。 (它读取寄存器值,但错误的参数返回)在这种模式下,我正在逐个读取传感器。(使SS(芯片选择)0中的一个与传感器通信并使其成为1然后对下一个传感器执行相同操作)。当我将传感器的数量减少到1时,它立即正常工作,当更多的传感器出错时。 我自己认为出现这个问题是因为当其他传感器的SS引脚很高时,这意味着它们处于i2c模式,并且它们在总线上通过I2C进行通信并且它会发生冲突(我看到错误的数据出现在调试模式和示波器中) 我曾经问过这个问题是因为spi总线上的电流很小所以我只启用了微控制器(STM32f407vgt6)miso mosi sck和ss引脚的内部上拉。 我的SPI总线就像图像 图片。 谁能帮我? #lis3mdl #spi #spi-bus 以上来自于谷歌翻译 以下为原文 Hi, I have designed a circuit which has 8 LIS3mdl sensor slot on 1 spi bus. The problem when I connect only one ls3mdl sensor (other 7 are empty) to the board it works well. but most of the when I connect another one ( sometimes 2 and sometimes 3 or 4 and more) all sensor stop working. ( it reads the register values but the wrong parameter get back) in this mode, I am reading sensors one by one.(make one of SS(chip select) 0 talk to sensor and make it 1 and then do the same with next sensor). Immediately when I reduce the number of sensors to 1 it works correctly and when and more sensor it goes wrong. I myself think that the problem appears because when SS pin for other sensors is high and it means they are in i2c mode and they talk in I2C on the bus and it makes conflicting(i saw wrong data coming in debug mode and in oscilloscope) I once though the problem is because of low current on spi bus so I enabled only internal pull-up of Microcontroller(stm32f407vgt6) miso mosi sck and ss pins. my SPI bus is something like the image image. Can anyone help me? #lis3mdl #spi #spi-bus |
|
相关推荐
3个回答
|
|
你在Vdd和Vdd_IO上有足够的阻塞能力吗?
你能检查Vdd和Vdd_IO上没有明显的电压降吗? 传感器之间的距离是多少? SPI跟踪多长时间? SPI引脚上的微控制器容量负载可能存在问题。您可以尝试降低SPI时钟速度。 以上来自于谷歌翻译 以下为原文 Do you have enough blocking capacity on Vdd and Vdd_IO? Can you check there is no significant voltage drop on Vdd and Vdd_IO? What is distance between sensors? How long are the SPI tracks? There could be a problem with big capacity load of you microcontroller on SPI pins. You can try reduce the SPI clock speed. |
|
|
|
Batek.Miroslav
感谢您抽出宝贵时间回答我。 我应该提一下,从传感器到控制器板,我有90到100根电缆。 我将预分频器256设置为波特率。现在它的速度为140Kbit / s。我已经将Vdd和vdd_io连接到具有2个10uf双极电容器的相同3.3v源。有了上述选项,我最好能在一个spi总线上同时连接6个传感器,当我再连接一个传感器时,一些传感器断开或开始连接和断开连接,有些保持连接。这是另一个奇怪的问题!我可以断开适配器以产生一些电压降(例如从3.3v到2.8v),在这种情况下更多的传感器工作 同时(例如7)。这是正常的吗? 现在做什么? 注意:原始帖子包含大量线程对话,只能迁移到第9级 以上来自于谷歌翻译 以下为原文 Batek.Miroslav Thank you for taking the time to answer me. I should mention that I have 90cm to 100 cables to from sensor to Controller board. I set Prescaler 256 to the baud rate. now it is at 140Kbit/s. I have connected Vdd and vdd_io to the same source of 3.3v with 2 10uf bipolar capacitors. with options of the above it best I can have 6 sensors simultaneously on one spi bus, and when I connect one more some of sensors disconnect or start connecting and disconnecting constantly and some stay connected.there is another weird issue! I can disconnect adaptor to have some voltage drop(from 3.3v to 2.8v for example) in this situation more sensors work simultaneously(for example 7). Is it normal? what to do now? Note: the original post contained a large number of threaded conversations and was only able to be migrated to the 9th level |
|
|
|
对于SPI总线来说,100厘米是非常艰难的条件。 SPI不是为这种长距离而设计的。我不清楚控制器板和所有传感器之间是否只有一根电缆,或者每个传感器是通过单独的100厘米长电缆连接的,这会更糟糕。我担心这个解决方案不适合这么长的距离。我建议你按范围检查信号,试图找出根本原因(大容量,串扰,失真,反射......)。可能你不能调整你的系统,也许在信号线上需要一个缓冲区。
对于隔直电容,每个传感器都应该有自己的隔直电容,因为数据表中描述的封装电容尽可能靠近封装。请注意,磁力计可以产生相当大的电流峰值,它们必须被隔直电容覆盖。 以上来自于谷歌翻译 以下为原文 The 100 cm it is pretty tough condition for the SPI bus. The SPI is not designed for this long distance. It is not clear to me if there is only one cable between controller board and all sensors or each sensor is connected by separate 100 cm long cable, which would be much worse. I'm afraid that this solution is not suitable for such a long distance. I recommend you to check the signals by scope to try to find a root cause (big capacity, crosstalk, distortion, reflection, ...). Than maybe you wont be able to tune you system, maybe a buffers will be needed on the signal lines. For the blocking capacitors, each sensor should have own blocking capacitor as it is described in the datasheet as close a possible to the package. Please be aware magnetometer can generate quite big current peaks and they must be covered by the blocking capacitors. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2644 浏览 1 评论
3209 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1784 浏览 1 评论
3613 浏览 6 评论
5990 浏览 21 评论
940浏览 4评论
1317浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
585浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1304浏览 3评论
1362浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 12:20 , Processed in 1.273831 second(s), Total 82, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号