element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Additional SPI slave
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 3 replies
  • Answers 2 answers
  • Subscribers 665 subscribers
  • Views 721 views
  • Users 0 members are here
  • spi
  • raspberry_pi
  • raspeberry_pi_accessories
Related

Additional SPI slave

hiroolt
hiroolt over 9 years ago

Hi,

 

I'm using CLAC with raspberry pi 3, and it works well. (Linux raspberrypi 4.4.6-v7+, cirrus-linux-4.4.6).

As a next step, I'm trying to add one more SPI slave somehow in order to use mcp3008.

But SPI1 pins (GPIO 18-21) are occupied by I2S functions which are used by CLAC,

and I'm not sure if I could add SPI0.2 by modifying "rpi-cirrus-wm5102.dts".

 

Could anyone kindly tell me how to add additional SPI slaves?
#Should I use I2C ADC?

 

Thanks,

  • Sign in to reply
  • Cancel
  • clem57
    0 clem57 over 9 years ago

    Depends how often you use the CLAC at the same time as the MCP3008. If you use both nearly at the same time, I would use software SPI.

    The MCP3008 connects to the Raspberry Pi using a SPI serial connection.  You can use either the hardware SPI bus, or any four GPIO pins and software SPI to talk to the MCP3008.  Software SPI is a little more flexible since it can work with any pins on the Pi, whereas hardware SPI is slightly faster but less flexible because it only works with specific pins.  If you aren't sure which to use I recommend software SPI as it's easier to setup.
    From: https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/mcp3008

    Clem

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • hiroolt
    0 hiroolt over 9 years ago in reply to clem57

    Hi Clem,

     

    Thanks you for your prompt reply.

    I don't need frequent access to the device (less than once/sec), so your suggestion would be perfectly suitable for me.

    Thanks!!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • hiassoft
    0 hiassoft over 9 years ago

    You could also use SPI0.0 if you move the SPI0 CS0 pin away from GPIO8 (which connects to WM8804 reset on the Cirrus card) and remove the spidev0 disable block in the Cirrus DT overlay.

     

    The Cirrus card only uses SPI0.1 (CS1), but I've also disabled spidev0 (SPI0.0/CS0) because (accidentally) using that would interfere with Cirrus card operations. Since you can't easily configure the CS0 pin with a dtparam or similar there was not much point allowing access to spidev0. But, of course, if you write your own overlay or hack the RPi dts files you can use it.

     

    BTW: I haven't used another SPI device in parallel on the same bus so I can't tell how well this works. About a year ago I hooked up a VFD display to the I2C bus and that worked quite nicely.

     

    so long,

     

    Hias

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube