SERCOM @ SAM R21

AT91EB40A, EB55, EB42 Evaluation Boards , AT91RM9200-DK, RM3400-DK will be the focus of the discussions: hardware guidance, embedded software, use,...

Moderator: nferre

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

SERCOM @ SAM R21

Fri Oct 30, 2015 6:46 pm

Good afternoon all!
I have a doubt. I've finished my application to my SAM R21 Xplained Pro Board and now I have to make a PCB. I've already drawn the schematics but I want to confirm something. In my Xplained Pro Board I have the following code:

Code: Select all

void configure_spi_master(void)
{
	struct spi_config config_spi_master;
	struct spi_slave_inst_config slave_dev_config;
	spi_slave_inst_get_config_defaults(&slave_dev_config);
	slave_dev_config.ss_pin = SLAVE_SELECT_PIN;
	spi_attach_slave(&spi_slave_ADXL375, &slave_dev_config);
	spi_get_config_defaults(&config_spi_master);
	config_spi_master.generator_source = GCLK_GENERATOR_8;
	config_spi_master.mux_setting = EXT1_SPI_SERCOM_MUX_SETTING;
	config_spi_master.pinmux_pad0 = EXT1_SPI_SERCOM_PINMUX_PAD0;
	config_spi_master.pinmux_pad1 = PINMUX_UNUSED;
	config_spi_master.pinmux_pad2 = EXT1_SPI_SERCOM_PINMUX_PAD2;
	config_spi_master.pinmux_pad3 = EXT1_SPI_SERCOM_PINMUX_PAD3;
	config_spi_master.transfer_mode = SPI_TRANSFER_MODE_3;
	config_spi_master.mode_specific.master.baudrate = 44800;
	spi_init(&spi_master_instance, EXT1_SPI_MODULE, &config_spi_master);
}
But, in my schematics, I can't use the pad0, pad2 and pad3 defined in this function. I will have to use pins PA22, PA23, PA24 and PA25

So... my question is:
If I change the config_spi_master.pinmux_pad'x' = "" to the pins I want to use this will work fine? Or do I have to change tje EXT1_SPI_MODULE to?

Another question.. To upload my code to the microcontroller, I drawed a JTAG connected to pins 40, 45 and 46. Will this work?

Thanks in advance

Return to “Evaluation and Development Boards”

Who is online

Users browsing this forum: No registered users and 1 guest