No Clock Signal at SPI of Xplain!

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Guys,

I am now having a problem with SPI interface of the Xplain demo board.

As you all know, SPI is quite a simple interface. I am using the one at PORTC and have configured its interrupt level as 0, MOSI as output, MISO as input, Clock as output, SS as output and used it as master. In fact I have used the same settings with other boards, and they worked well. :oops:

There is already byte output at MOSI in a correct frequency and the SS runs also correctly, however, there is no clock output! i.e. As the data comes out, the clock signal(SCK) does NOT come out synchronously. It remains high. :roll: As a result, the slave module can not be driven.

As I have tested, this SS pin is physically OK.

It seems sooo strange to me. Could someone please give some tip to figure it out? Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi. I'm no expert, but I'm playing with SPI at the moment. What have you set the SPCR register to?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Namistrai, there are some slight difference between the Atmega and AtXmega series. I guess you are playing with an Atmega, aren't you?

In Xmega the SPCR is called CTRL - SPI Control Register. I set it as follows:
Prescale = clk/128,
Master mode,
SPI enable of course,
and left the others as default.

Actually the MOSI outputs at a correct pace, i.e. the clock should be running right. But why there is no clock waveform?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ooooooooooops, SPI@Xplain does not work anyway. I've tried with another board and it works.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So your board is faulty?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GordonFreeman wrote:
So your board is faulty?

Well, I've tried with 2 xplains and got the same funny result.
:|

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi,
could you tell me the procedure to test the spi you have talked about? because i am doing the same thing.which equipment you used?oscilloscope?logic analyzer? i cannot get anything at the mosi, sck output!! or what ever, except for the vdd pin?could you help me please. it is crazy i cannot see anything at the output

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To both members having SPI issues, when you have a coding issue, or think you do...post code. :?

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1