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

dear all, i m interfacing 7366 with c8051f120.

according to datasheet of 7366 its clock is 5Mhz (100nSec and 100nSec of SCK high and low pulse)

pls tell me which lines of among 4 pins i.e mosi,miso,nss,sck are pushpull and open drain.

because i made mosi as pushpull and rest as opendrain

i have given pullup to miso,nss,sck

i have written the code according to sample program.

and the sequence of the code is running according to timing diagram of 7366

i am writing 0x03 in MDR1 register and reading it

but i still receive 0xff or 0x00

i even have problem in sck display i.e clock doesnt get displayed properly

pls tell me where i m wrong.

spi settings are:
spi0cfg = 0x40;
spi0cn = 0x0d;
spickr = 0x00; for 5Mhz (datasheet of 7366 under ac characteristics of 5V)

i m using spi in interrupt.

pls replay
thank you all

Parents Reply Children
  • c8051f120.
    pls tell me which lines of among 4 pins i.e mosi,miso,nss,sck are pushpull and open drain.

    config2 will set the pins correctly

    Erik

  • thanx erik for the replay,

    my problem is solved.

    it was the operating frequency which was creating a problem

    i have set the frquency < 1Mhz and now it is working fine. i.e reading and writing of registers is done properly

    now i m connecting rotary encode of A,A/,B,B/,Z,Z/ input to 7366 but my voltage signal drops to 2V.

    and i m now unable to read the configuration of internal register of 7366, without connecting encoder i used to write and read but now it is not happening

    even i am unable to read pulses of rotation even though i rotate the shaft

    pls help me

    thank you
    take care