1

Now I'm developing project and I want to choose Raspberry like the control module. I want to control the frequency synthesizer by SPI, but also I need SPI for TFT Touch Display. So what can I do to combine this devices?

1

Recent Pis (the ones with the 40 pin expansion header) and the compute module have two accessible SPI peripherals.

The main SPI has two chip selects.

The auxiliary SPI has thee chip selects.

http://abyz.me.uk/rpi/pigpio/index.html#Type_3 shows the pin outs. Main SPI MOSI/MISO/SCLK/CE?, auxiliary SPI mosi/miso/sclk, ce?.

The recent kernel driver (spi_bcm2835) can handle both devices and can also use arbitrary GPIO for chip selects. For details see the SPI overlays mentioned in /boot/overlays/README.

Personally I would leave the TFT screen on the main SPI device and connect your synthesiser to the auxiliary SPI device.

0

There are select pins on the Raspberry Pi hardware, the MISO, MOSI and SCK pins can share across the slave device (in your case, it's frequency synthesizer and TFT Display), however, you will need to separate the CE(Chip Enable/Chip Select) pins. The RPi itself have TWO hardware select pins, you can look into that.

  • I still don't have Raspberry Pi and I can't understand how RPi works with TFT over SPI? What module manage TFT (Linux core?)? I want to say, that if I will begin to use Main SPI trough C or Python to manage synthesizer it will be conflict. I will change CE pin trough Python script, but Linux Core will continue to send its data trough MOSI, MISO – Sergei Alejnik Jul 13 '16 at 12:08
  • That's not quite true. You have two ways to interface with the SPI, one is with kernel driver, another is with userspace. Most people will choose the later one as you can use C(see wiringPi) and Python, or other languages to interface with SPI. Normally the linux core will not send data through SPI, unless you have some kernel dirvers that will transmit data through the SPI bus (like custom drivers, etc., but normally nothing on the kernel will use the SPI bus). In other words, it is unlikely that your userspace will conflict with the kernel. – Kong Chun Ho Jul 13 '16 at 12:58
  • So Is there a program/driver started by user manually to manage TFT Display? It means: my python-script can run TFT over SPI. I can put a command into python-script to change frequency in the synthesizer - and here script will disable tft-driver, send commands to synthesizer, and enable TFT again? – Sergei Alejnik Jul 13 '16 at 13:53
  • "Disable tft-driver, enable synthesizer", i think this part could be done by the hardware automatically if you are using the Hardware CE pins. It just like you have two channels of SPI, you can select to send to the first channel (i.e. TFT, the hardware will use the first CE pin), and the second channel (i.e. Synthesizer, hardware will use the second CE pin). – Kong Chun Ho Jul 13 '16 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.