Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

USB superspeed peripherals

ToWo_4256761
Level 1
Level 1

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.

0 Likes
1 Solution
Hemanth
Moderator
Moderator First like given First question asked 750 replies posted
Moderator

Hi Tony,

You can implement SPI writes in sensor.c file by using reg mode of SPI.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
4 Replies
Hemanth
Moderator
Moderator First like given First question asked 750 replies posted
Moderator

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

Hemanth
0 Likes
ToWo_4256761
Level 1
Level 1

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.

0 Likes
Hemanth
Moderator
Moderator First like given First question asked 750 replies posted
Moderator

Hi Tony,

You can implement SPI writes in sensor.c file by using reg mode of SPI.

Regards,

Hemanth

Hemanth
0 Likes
ToWo_4256761
Level 1
Level 1

Hi Hermanth,

Thanks for that.

Have started working through this solution.

Thanks for your help.

Regards,

Tony.

0 Likes