Community
cancel
Showing results for 
Search instead for 
Did you mean: 
YUsui1
Novice
2,509 Views

Direction of the port in SPI slave.

Jump to solution

When edison operates in SPI slave, I want to know the input / output of port.

Is it okay below?

SPI_2_TXD (GP115) = output

SPI_2_RXD (GP114) = input

# The same direction as the SPI master operation.

SPI_2_CLK (GP109) = input

SPI_2_FS0 (GP110) = input

# The opposite direction as the SPI master operation.

1 Solution
Diego_V_Intel
Employee
106 Views

Hello Yosuke,

The SPI interface is composed by 4 lines:

  • MOSI: Master Output - Slave Input
  • MISO: Master Input - Slave Output
  • CLK: Clock
  • SS: Slave Select

In case of the Edison, we have the following lines:

  • SPI_2_TXD: Transmit data
  • SPI_2_RXD: Receive data
  • SPI_2_CLK: Clock
  • SPI_2_FS0: Slave Select (or Chip Select)

So if the Edison is the slave device, the directions should be the following:

  • SPI_2_TXD: Output
  • SPI_2_RXD: Input
  • SPI_2_CLK: Input (The master device controls this signal)
  • SPI_2_FS0: Input (The master device controls this signal)

However, I haven't configured the Edison as SPI slave and if I'm not mistaken, the SPI interface can be configured only as SPI master. There is a thread about using the Edison as SPI slave: . As you can see in the thread, the way to use Edison as SPI slave was to emulate a SPI port through software using GPIOs to emulate the SPI signals.

I hope you find this information useful.

Regards,

Diego.

View solution in original post

7 Replies
Diego_V_Intel
Employee
107 Views

Hello Yosuke,

The SPI interface is composed by 4 lines:

  • MOSI: Master Output - Slave Input
  • MISO: Master Input - Slave Output
  • CLK: Clock
  • SS: Slave Select

In case of the Edison, we have the following lines:

  • SPI_2_TXD: Transmit data
  • SPI_2_RXD: Receive data
  • SPI_2_CLK: Clock
  • SPI_2_FS0: Slave Select (or Chip Select)

So if the Edison is the slave device, the directions should be the following:

  • SPI_2_TXD: Output
  • SPI_2_RXD: Input
  • SPI_2_CLK: Input (The master device controls this signal)
  • SPI_2_FS0: Input (The master device controls this signal)

However, I haven't configured the Edison as SPI slave and if I'm not mistaken, the SPI interface can be configured only as SPI master. There is a thread about using the Edison as SPI slave: . As you can see in the thread, the way to use Edison as SPI slave was to emulate a SPI port through software using GPIOs to emulate the SPI signals.

I hope you find this information useful.

Regards,

Diego.

View solution in original post

YUsui1
Novice
106 Views

Hello DiegoV_Intel,

Edison does not have the true SPI slave function?

Can you tell me the port setting of GP115, GP144, GP109 and GP110?

For example When edison operates in SPI slave, SPI_2_CLK and SPI_2_FS0 will be input.

Is the port setting okay below?

# echo mode1 > /sys/kernel/debug/gpio_debug/gpio109/current_pinmux

# echo mode1 > /sys/kernel/debug/gpio_debug/gpio110/current_pinmux

Will GP109 and GP110 be output?

(Isn't there the SPI slave example code yet?)

Regards,

Diego_V_Intel
Employee
106 Views

Hi Yosuke,

According to the http://www.intel.com/content/www/us/en/support/boards-and-kits/000005808.html Compute Module Hardware Guide for Boards and Kits, the SPI pins have a fixed direction when they are configured to work as SPI, and these directions correspond to the SPI Master device, so it cannot be configured to work as SPI Slave.

Regarding the port setting, yes that port setting is correct. The IO pins should be configured to mode1 for SPI functionality. I recommend you to check the following document; at the end there is an example of the port setting in order to use the SPI: http://www.intel.com/content/www/us/en/support/boards-and-kits/000005583.html Intel® Edison Kit for Arduino* Hardware Guide for Boards and Kits

On the other hand, as I said the SPI interface works only when the Edison is configured as Master. For SPI Slave applications you would have to emulate the interface through software programming general IOs to work as SPI IOs as suggested in here: . But let me check, just to be sure, if the SPI can't be configured as SPI Slave. I'll confirm it as soon as possible.

Additionally, there aren't code examples for SPI Slave functionality.

Regards,

Diego.

YUsui1
Novice
106 Views

Hello Diego,

However, it's written "slave mode" in "Table 23" of "4.6 SPI interface" of "Intel Edison Compute Module Hardware Guide".

And it's written "SPI slave AC specification" in "4.6.2" of "Intel Edison Compute Module Hardware Guide".

I saw this and had thought that Edison has the true SPI slave function.

Are they specifications when it emulate the interface through software programming general IOs to work as SPI Slave?

Regards,

Diego_V_Intel
Employee
106 Views

Hello Yosuke,

I'm checking about the SPI Slave configuration. I'll post the information I'm able to find as soon as possible.

Regards,

Diego.

Diego_V_Intel
Employee
106 Views

Hi Yosuke,

I apologize for the delay in my response. I've confirmed that the SPI Slave mode is not supported on Edison. The documentation will be updated to avoid confusions about the SPI Slave mode.

If you want to use the Edison as SPI Slave device, then as I mentioned above, you will have to emulate the SPI interface through software using GPIOs for the SPI pins.

Regards,

Diego

YUsui1
Novice
106 Views

Hello Diego,

Thank you for your reply.

I understand.

Regards,

Yosuke

Reply