please choosego to mobile | Continue to access the PC version
View: 4117|Reply: 1

how to use second spi on OPi one?

[Copy link]

1

threads

1

posts

7

credits

Novice

Rank: 1

credits
7
Published in 2017-6-23 08:13:19 | Show all floors |Read mode
Hi,
I've an OPi one board. It has 2 spi interfcae. one of them is connected to CON3 but not all 4 pins of the other is connected to CON3!

is it possible to change the spi1 default pins in fex file to other pins that are connected to CON3?

I tried to use PA00 ... PA03 for spi1 pins but after converting fex 2 bin, spidev1.0 is not added to device list?
the fex file after my changes look like below:


  1. [uart2]
  2. uart_used = 0
  3. uart_port = 2
  4. uart_type = 2
  5. uart_tx = port:PA00<2><1><default><default>
  6. uart_rx = port:PA01<2><1><default><default>
  7. uart_rts = port:PA02<2><1><default><default>
  8. uart_cts = port:PA03<2><1><default><default>

  9. [uart3]
  10. uart_used = 0
  11. uart_port = 3
  12. uart_type = 4
  13. uart_tx = port:PA13<3><1><default><default>
  14. uart_rx = port:PA14<3><1><default><default>
  15. uart_rts = port:PA15<3><1><default><default>
  16. uart_cts = port:PA16<3><1><default><default>

  17. [spi0]
  18. spi_used = 1
  19. spi_cs_bitmap = 1
  20. spi_mosi = port:PC00<3><default><default><default>
  21. spi_miso = port:PC01<3><default><default><default>
  22. spi_sclk = port:PC02<3><default><default><default>
  23. spi_cs0 = port:PC03<3><1><default><default>

  24. [spi1]
  25. spi_used = 1
  26. spi_cs_bitmap = 1
  27. spi_mosi = port:PA00<2><default><default><default>
  28. spi_miso = port:PA01<2><default><default><default>
  29. spi_sclk = port:PA02<2><default><default><default>
  30. spi_cs0 = port:PA03<2><1><default><default>

  31. [spi_devices]
  32. spi_dev_num = 2

  33. [spi_board0]
  34. modalias = "spidev"
  35. max_speed_hz = 33000000
  36. bus_num = 0
  37. chip_select = 0
  38. mode = 0
  39. full_duplex = 1
  40. manual_cs = 0

  41. [spi_board1]
  42. modalias = "spidev"
  43. max_speed_hz = 33000000
  44. bus_num = 1
  45. chip_select = 0
  46. mode = 0
  47. full_duplex = 1
  48. manual_cs = 0
Copy code

command I used:
  1. sudo mount /dev/mmcblk0p1 /mnt/
  2. bin2fex /mnt/script.bin /tmp/orange.fex
  3. sudo nano /tmp/orange.fex
  4. sudo fex2bin /tmp/orange.fex /mnt/script.bin
  5. sudo reboot
  6. ls /dev/s*
Copy code


6

threads

32

posts

626

credits

Senior member

Rank: 4

credits
626
Published in 2017-6-25 09:36:38 | Show all floors
I'm new to this, but aren't those PORT <=> PIN definitions defined by hardware?
OPi's: 3 Zero, 4 One, 1 Plus, 1 PC2, 1 cam
OPi on transit: 1 One, 1 2G-IOT, 1 2G IOT Touch LCD
3 RPi 3, 1 RPi 2, 3 RPi cam
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list