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

SPI in 89C51

Hello, Can anyone give me the working [Bit Banged] code for SPI[Master/Slave] for the devices like AT89C51 or AT89C2051 because this devices doesn't have SPI port and I want to have such functions there.

Thanks.

  • A bit-banged SPI slave is no fun at all, unless you run the interface at a _very_ slow speed. The slave doesn't have anyway to tell the master if it is keeping up or not, so I really, really recommend that you select a processor that has SPI. It isn't like SPI makes the chips expensive.

  • A bit-banged SPI slave is definitely no fun at all whereas a bit-banged SPI master is fairly easy. do not confuse the two

    Erik

  • Yes, a SPI master can be implemented in less than an hour. Maybe even in 5 minutes, if comfortable with the processor.

    It't the simplicity of the SPI protocol that tends to hide the problems with timing when implementing the slave side.

  • Please can anyone send me the Program for SPI Master for 89C51[Bit banged] or any link where I can find that.
    I have once seen that but I lost that page.

  • Did you read - and understand - what was written above?

    What use would you have of a SPI master, if you don't have a SPI slave? You really should switch to a processor that have hardware SPI, in which case you would not need to implement the master side in software.

    And as I said, you can write the master side yourself in a very, very short time. And the time spent writing an SPI master is well-invested time just to make sure that you are very comfortable with the timings of the different signals. But in the end, you will suffer greatly if trying to run an SPI slave since you must have the baudrate so low that it will be impossible for the slave to miss a single signal change. A single interrupt on the slave side while processing the data will slow down the slave significantly, but the master will not know about that.