This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can AT89C2051 be used as a slave device for SPI

Hi, I have to design a circuit using AT89C51 with no hardware SPI and use it as SPI master. The SPI slave device I am using is AT89C2051 which is controlling the RTC chip DS1307 using I2C protocol. When ever a particular event occurs the AT89C2051 records the timing registers. These RTC registers need to read by the master controller that is AT89C51 from the slave AT89C2051 using SPI protocol.

So by basic doubt is whether can I use AT89C2051 slave without a hardware SPI. Can I implement the whole of the SPI protocol between Master and the slave using software SPI.

Raghu

Parents
  • There are not too much problems with any timing errors for a SW-driven master. It is trivial to make sure it isn't too fast.

    I agree, but what about the bit-banged slave. a bit-banged slave must stop whatever it is doing (time critical or not) to receieve tha data. Yes, you may be able with an inverter or two to make it a bit less time consuming using interrupts, but there will still bee some potential timing problems with the "do it NOW" requirements a bit-banged slave, by definition, must have.

    Had it not been for the plethora of HW SPI derivatives there is, I might have gone into a more detailled discussion of the many problems with a bit-banged slave, but I consider it futile to 'fight' bit-bang for a slave when getting the chip from another corner of the drawer solves it in a breeze. There is no shortage of the other features you can find in HW SPI chips - and at < $1.

    Erik

Reply
  • There are not too much problems with any timing errors for a SW-driven master. It is trivial to make sure it isn't too fast.

    I agree, but what about the bit-banged slave. a bit-banged slave must stop whatever it is doing (time critical or not) to receieve tha data. Yes, you may be able with an inverter or two to make it a bit less time consuming using interrupts, but there will still bee some potential timing problems with the "do it NOW" requirements a bit-banged slave, by definition, must have.

    Had it not been for the plethora of HW SPI derivatives there is, I might have gone into a more detailled discussion of the many problems with a bit-banged slave, but I consider it futile to 'fight' bit-bang for a slave when getting the chip from another corner of the drawer solves it in a breeze. There is no shortage of the other features you can find in HW SPI chips - and at < $1.

    Erik

Children