I have been working with the LMH6518 trying to design a AFE and currently i am facing difficulty while trying to make spi of the LMH6518 work.
I am using an xmega32d4 @ 3.3V.
I have worked with spi in the past but this case isn't that straightforward.
The xmega has MOSI & MISO while the DVGA has SDIO. I have arranged that through a 1K resistor as follows: (already asked here about that)
PC5 is the MOSI pin and PC6 is the MISO (receiving data from LMH6518)
The DS says that mode-1 should be used and gives a few drawings that explain that.
The xmega32 has mode-0 up to mode-3 which do not seem to work.
I tried off course mode-1 but the sample-data vs clk edge did not suit.
So i am thinking that mode-1 of the DS is not mode-1 of the xmega DS.
I moved on taking 2 screenshots with my scope while using modes 0 & 1 in order to detect pulses on the SDIO pin.
I was never able to detect pulses in any of the 4 spi modes of the xmega32.
Here are the screen shots:
I should be getting something on the SDIO but i do not.
I have checked soldering joints and power +3.3V on the LMH6518 and they are ok.
Its' quiescent current is also as suggested by the DS.
Regarding the code i am using i do the following:
1) Set CS low
2) Send 0b10000000 to set LMH6518 spi into read mode
3) Send a dummy byte 0 to get a byte corresponding to the previous 0b10000000 command
4) Send a dummy byte 0 to get another byte corresponding to the high byte of 16bits
5) Send a dummy byte 0 to get another byte corresponding to the low byte of 16bits
6) Set CS high
Is that correct?
What about programming the bits of the 16bits of the LMH6518?
Should i do the following:
1) Set CS low
2) Send a byte 0 to set LMH6518 spi into write mode
3) Send a byte to program the high byte of the 16bits
4) Send a byte to program the low byte of the 16bits
5) Set CS high
Can you pls help?