SPI和I2C同时通讯使能

2020-02-09 09:23发布

请教大家个问题  就是我在做试验的过程中16f883外接2个片子 一个传感器 一个是DA转换的 传感器与883的通信是I2C的 DA是SPI的  而这2种通讯都是同样的寄存器控制  现在我要同时使能这2种方式 那我寄存器该如何设置呢 谢谢指教
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
12条回答
millwood0
2020-02-10 14:58
"那我寄存器该如何设置呢 谢谢指教"

it depends on how you structure the transmission. not sure of your specific chip but some chips have shared pins (16f886 for example shares sdi and sda pins). In those cases, you cannot transmit data at the same time - aka interrupt driven approach doesn't work.

assuming that your pic acts as a master, and you transmit spi and i2c one at a time, you will then have to experiment a little: write up your spi routines and your i2c routines, make sure that they work independently and then join them together.

一周热门 更多>