- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
what is the best example to use (spi regmode or spi dmamode) for setting up a CMOS sensor that uses SPI interface. Is there any code examples available setting up an SPI interface when using a LUPA-300 in parallel output without using an FPGA? This will mainly work in snapshot mode. Still in the process of learning how to program this type of device. Any help much appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tony,
You can implement SPI writes in sensor.c file by using reg mode of SPI.
Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I see that SPI_DATA pin of LUPA-300 is bidirectional and 3-wire Serial to parallel Interface is used. Can you please let me know if you are trying only to write to the sensor and not read from it? If yes, you can try connecting MOSI line of FX3 to SPI_DATA line of sensor and send the data using SpiRegMode example. You can make spiConfig.ssnCtrl = CY_U3P_SPI_SSN_CTRL_FW - so that you can control SPI_ENABLE pin of sensor in the firmware (assuming you connect SPI_SSN of FX3 to it) and spiConfig.wordLen as 16.
Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hemanth,
yes only intend writing to the sensor. Pin configuration is as per your suggestions, just was not too sure about which SPI mode to use.
So in sensor .c and sensor .h SPI read commands can be written out?
Regards,
Tony.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tony,
You can implement SPI writes in sensor.c file by using reg mode of SPI.
Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hermanth,
Thanks for that.
Have started working through this solution.
Thanks for your help.
Regards,
Tony.