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

SPDR not receiving data

Hi,

IÂ'm trying to use SPI in AT89S8252. Problem is that I canÂ't write to SPDR. SPDR doesnÂ't receive data but still software sets SPIF flag. Also I can write the 00h value of the SPDR to ie. R2.

code:

MOSI    EQU             P1.5
MISO    EQU             P1.6
SCK     EQU             P1.7
SS      EQU             P1.4

MOV P1,#0

MOV 0D5h,#00111000b  /* Sets DORD, MSTR, CPOL bits */
MOV 0D5h,#01111000b  /* Sets SPE bit */

MOV R1,#255

MOV 086h,R1       /* send an example data to SPDR*/

        NOP
        NOP             /*SPIF bit sets*/
        NOP
        NOP
        NOP
        NOP
        NOP

Is this a software bug or me, as a beginner, being incompetent!?

Please help me out!

Regards
Aki

0