Quantcast
Channel: EngineerZone : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 51060

ADE7913: problem with SPI

$
0
0

Hello everybody,

i need help for the SPI of the ADE7913.

 

I'm trying to write an SPI driver for driving the ADE7913 on my Kinetis K20 (made by Freescale). Using the timing of the ADE7913-EVAL-Z demo board and the timing obtained by the datasheet as references, I generated 2 burst of Serial Clock with 7 pulse each one (8 rising edge) and spaced from one other by one period of the burst. During the time between the 2 burst the Serial Clock is set to 1 and the Chip Select stays to 0. In the first burst the MOSI sends the READ command of an 8 bits register and in the second the ADE7913 should respond with the value of the register. Unfortunatelly the ADE7913 does not responds: at the end of the first burst the MISO changes from an high impedance state to 0 state, but during the second SCK burst the MISO stays to 0 and no data is transferred  (I try with different registers). It seems the ADE7913 understand correctly the READ command because it correctly change the inactive state of the MISO at the right time.


Notes:

*) the Serial Clock (SCK) is set to 2.5 MHz (more or less);

*) the inactive state of the CS and of the SCK is 1;

*) the CS switches from 1 to 0   800 ns before the first falling edge of the SCK (and the fisrst change of the MOSI) and switches from 0 to 1 (at the end of frame) 800 ns after the last SCK rising edge;

*) the timing specified on the datsheet are observed;

*) the SPI changes the value of the data on the falling edge and samples the data on the rising edge;

*) the READ command format is: ADDRES[7:3] + R/W[2] + Reserved[1:0].

    For example if I wanted toread the STATUS0 8 bit resgister (0x9 address), the command will be:       01001 1 00

 

Have you ever had problem like that with the SPI?

Do you know some Application Note could help me? or some *.c code that could help me?

 

Thanks

Alberto

 



Viewing all articles
Browse latest Browse all 51060

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>