For a project, I need to make a testbed (shield) for the ShieldBuddy. I need SPI to control a set of digital potentiometers.
As I need to place the digipots on the shield, I had wanted to use the SPI channels 1 or 2 (p12,11,13 or p50,51,52 - MOSI) instead of the P201.
I checked the manual, and I couldn't make it seem to work. (SPI.begin(BOARD_SPI_SS0_S1) etc.).
I was wondering if there is an example code how to use channels 1 or 2.
*I also tried looking in the Variant.h (C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\variants\tc275) to find any clues if there are other pins that I need to declare to change the MOSI, MISO and SCK pins.
**I also tried setting the SPI pins, but Shieldbuddy's SPI library doesn't support the SPI.setMISO etc. to assign the SPI pins unlike the teensy.
***The Shieldbuddy's Spi ICSP P201 doesn't seem to be physically connected to the other pins (11,12,13,50,51, or 52) like the mega or uno.
It enabled the SPI Channel 1, but I can't seem to make the digital potentiometer work in channel 1.
I have the digipot wired to both P201 and channel 1 and just changed the channel.
I am not sure what the real problem is. If it is the MOSI or the CS or something else that is different between the channels.
My suspicion is that whenever I call the SPI.transfer(BOARD_SPI_SS0_S1, cmd) then SPI.transfer(BOARD_SPI_SS0_S1, data), it toggles the CS in between. Is there a way for it to not toggle the CS, or would I need to use the 16-bit (SPI.transfer16). If so, where can I get references on how to use that.
I have attached pics of the oscilloscope (yellow-CS, blue-SCK, violet-MOSI,green-digipot). The first image is using P201, while the second one is channel 1.
Hi, I have a problem similar to that of angsanto08. My shield has two SPI devices. Both devices are using the SPI Channel 1 at pins 11, 12 and 13. One device is connected to CS pin 10 and one is connected to CS pin 4. Now I am looking for a possibility to communicate with the CS pin 4 device without addressing the CS pin 10 device at the same time. Is there a way to prevent the automatic switching of CS pin 10 while using a different manually switched CS pin?