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

problem in spi driver

i am working with energy metering chipade7758 and cygnal 8051f120.communication between cygnal and 8051f120 take place through SPI bus. the driver is working fine only if we initialize the SPI just before writing a byte . that means i have to reload the SPI configuration registers .
SPIEN = 0;
SPI0CFG = 0x60;
SPI0CN = 0x0C;
SPI0CKR = 0x17;
SPIEN = 1;
why this happens? I want to save the time of reloading . suggestion are most welcome …

Parents
  • Thanks a ton for your reply

    If we do not initialize it before writing a byte then I'm getting 0x0000 or 0xFFFF if i read back from the written registers.

    I have tried to write to a specific memory location But after reading back the same register i don't get the same value.

    But IT IS WORKING FINE if i do the initialization before writing. But this initialization routine is slowing down my program.

    Kindly revert with suitable suggestion.

Reply
  • Thanks a ton for your reply

    If we do not initialize it before writing a byte then I'm getting 0x0000 or 0xFFFF if i read back from the written registers.

    I have tried to write to a specific memory location But after reading back the same register i don't get the same value.

    But IT IS WORKING FINE if i do the initialization before writing. But this initialization routine is slowing down my program.

    Kindly revert with suitable suggestion.

Children