Enabling SPI on RetroStone

Here is all the tutorials, FAQ and support for RetroStone
Post Reply
amcolash
Posts: 2
Joined: Mon 22 Jul 2019 10:21

Enabling SPI on RetroStone

Post by amcolash »

Hi! I am really loving my RetroStone so far. One issue that I have run into is getting SPI working properly with it. I have edited my .fex file with armbian-config to add the additional spi interface 1. Since the OS is using a legacy kernel, it seems that the only way to use SPI is with the boot configuration and not via device overlays.

Code: Select all

[spi0]
spi_used = 1
spi_cs_bitmap = 1
spi_mosi = port:PC00<3><default><default><default>
spi_miso = port:PC01<3><default><default><default>
spi_sclk = port:PC02<3><default><default><default>
spi_cs0 = port:PC03<3><1><default><default>

[spi1]
spi_used = 1
spi_cs_bitmap = 1
spi_cs0 = port:PA13<2><1><default><default>
spi_sclk = port:PA14<2><default><default><default>
spi_mosi = port:PA15<2><default><default><default>
spi_miso = port:PA16<2><default><default><default>

[spi_devices]
spi_dev_num = 2

[spi_board0]
modalias = "spidev"
max_speed_hz = 33000000
bus_num = 0
chip_select = 0
mode = 0
full_duplex = 1
manual_cs = 0

[spi_board1]
modalias = "spidev"
max_speed_hz = 33000000
bus_num = 1
chip_select = 0
mode = 0
full_duplex = 1
manual_cs = 0
I have hooked up an oscilloscope to the pins PA13 (CS), PA14 (CLK), PA15 (MOSI) and PA16 (MISO) and am only seeing CS and CLK working as expected with a simple python SPI test program.

In my investigations, I also found I had to disable PA13, PA15, PA16 from the GPIO list as well.

I cannot however seem to get any data out of it (joystick or battery). I am happy to write an analog joystick driver and battery monitor, but if I cannot access the data I will need to use a different interface like i2c.

If anyone has had luck actually enabling the SPI interface after installing an MCP3208 please let me know!
Post Reply