SAMR21 Xplained Pro Board SPI Connection

Moderator: nferre

ricardogomes
Posts: 13
Joined: Thu Jan 22, 2015 7:36 pm

SAMR21 Xplained Pro Board SPI Connection

Wed Jun 03, 2015 7:40 pm

I'm trying to connect my SAM R21 Evaluation Board to my ADXL375 Evaluation Kit. I'm having some trouble because the device sometimes answers me, sometimes don't and sometimes answers me wrong. I've monitorized the signals with an oscilloscope and I think that the problem is in the SS pin. The SCLK and the MOSI are correct (I tried different values in the MOSI and it's always OK). But, the SS pin is always 0 and it is supposed to be always 1 and 0 when I'm trying to send a message between the devices.
I've downloaded the application code of ASF "SPI Master Callback" and changed the SPI_TRANSFER_MODE to 3 (CPOL=1 and CPHA=1). I've erased the callback function and substituted the transceive_buffer_job for transceive_wait function (I've tried spi_write and spi_read to).
I've tried to change select_slave_low_detect_enable and master_slave_select_enable to every combination possible (both true, both false and one true and the other false).
In my while(true) loop, I have:
 
if (!port_pin_get_input_level(BUTTON_0_PIN)) {
            
            spi_select_slave(&spi_master_instance, &slave, true);
            
            spi_transceive_wait(&spi_master_instance,tx_id,&rx_id);
  
            spi_select_slave(&spi_master_instance, &slave, false);
            
        }
 
 
Can anybody give me a help? Thanks

(I have a topic with a similar title in the avrfreaks but the question is completly different so don't cancel this subject please).
ricardogomes
Posts: 13
Joined: Thu Jan 22, 2015 7:36 pm

Re: SAMR21 Xplained Pro Board SPI Connection

Thu Jun 04, 2015 1:05 pm

awneil wrote:
ricardogomes wrote:Can anybody give me a help?
Yes - my suggestions are here: http://www.avrfreaks.net/comment/156735 ... nt-1567356
I have a topic with a similar title in the avrfreaks but the question is completly different
No, it is not - you have posted exactly the same question there :!:
http://www.avrfreaks.net/comment/156729 ... nt-1567291

And my reply is already there: http://www.avrfreaks.net/comment/156735 ... nt-1567356
Quote: That topic was about: "How can I send data to a specific address?" and I marked the topic as solutioned when you've explained me that. This topic is about "How can I manage SS to comunicate with the ADXL?". I asked this in the other topic in 21/May but no one answered me. But discussing this will get us nowhere. I will try to see the signal in the oscilloscope during the afternoon.

Please, forget the other topic in avrfreaks. I will just use this topic if I have any trouble.

Thanks and sorry for the misunderstanding. I think that my poor English is giving us communication problems lol

Return to “SAM9-based”

Who is online

Users browsing this forum: No registered users and 3 guests