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.
-----------------------------------------------------------------------
个人认为:肯定是分时接收或发送了,不可能单片机同时I2C和SPI通信。
-----------------------------------------------------------------------
"个人绝对还是会有冲突"
不太理解这句话!!
I2C使用硬件,SPI模拟,这样不行吗?
-----------------------------------------------------------------------
都是微妙级的,简单的延时不就好了么。加一个if语句就好。
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.
一周热门 更多>