Help with SPI SAM4e16e Xplained Pro

Discussion around product based on ARM Cortex M4 core.

Moderators: nferre, ncollot

Posts: 2
Joined: Tue Aug 05, 2014 12:36 am

Help with SPI SAM4e16e Xplained Pro

Wed Aug 13, 2014 11:36 pm

Hi All,

So i am having some difficulties implementing a SPI network. I have dug around on the forum and found that I was not enabling the PIO's but now that I have done that I am still unable to see a clock signal or data on an Oscope. I am including my code for critique:

        pio_configure_pin(SPI_MOSI_GPIO, SPI_MOSI_FLAGS);
pio_configure_pin(SPI_MISO_GPIO, SPI_MISO_FLAGS);
pio_configure_pin(SPI_SPCK_GPIO, SPI_SPCK_FLAGS);
pio_configure_pin(SPI_NPCS1_PB14_GPIO, SPI_NPCS1_PB14_FLAGS);

spi_master_setup_device(SPI, &spi_dac, SPI_MODE_0, 1000000, 1);

        while (1) {

spi_select_device(SPI, &spi_dac);
spi_write_packet(SPI, spi_write, 2);


Thanks for any help.
Posts: 238
Joined: Thu Dec 06, 2012 6:40 am

Re: Help with SPI SAM4e16e Xplained Pro

Thu Aug 14, 2014 5:56 am

If you are using Atmel Studio and have added the spi module with the wizard. Open the spi.h file and scroll to the bottom. There is a quick start guide that shows all the steps.

Return to “SAM4 Cortex-M4 MCU”

Who is online

Users browsing this forum: No registered users and 2 guests