SPI devices on i2c bus
Posted 09 September 2005 - 05:49 AM
But my controller is having an i2c port.....So i need to connect an spi device to a i2c bus.....
can anybody help me out ........???
Posted 09 September 2005 - 06:24 AM
Welcome to the forum.
The SPI bus and I2C bus are totally different bus systems. If the micro does not support the SPI device, you can create a software routine to drive the SPI device. This will be a lot more processor intensive than a hardware interface would be. You need to "bit bash" the protocol. That means that you toggle the clock line by setting the bit ON and OFF and you either toggle the output data line or read the input data line at the correct clock polarity. You do not use any of the I2C hardware to do this. If you are using the I2C for other devices, you should use alternative port pins to talk to the SPI device.
Mark Empson | administrator
Skype Contact = markempson | phone +64 274 363 067
LMPForum | Power Factor | L M Photonics Ltd | Empson family | Advanced Motor Control Ltd | Pressure Transducers | Smart Relay | GSM Control | Mark Empson Website | Soft Starters
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users