- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi friends
I'm using PSoC 5LP CY8C5868-AXI Psoc device. I need two spi modules in Psoc5 series. But I have a problem.
I uploaded an image as an attachment. The circuit as shown in the picture.
in this circuit the SPIM_1 module works fine, but the SPIM_2 module is not running. I use the following function to write data.
SPIM_2_WriteByte(0xAA); //Write to SPIM_2 module
while (0u == (SPIM_2_ReadTxStatus() & SPIM_2_STS_SPI_DONE)){} //wait for data send
What could be the problem? How many SPI modules can I use in this way?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@hli
thank you for the reply. I'm resolved the problem. I forgot to start the SPI2 Module.
But I do not understand the UDB resources. How do I calculate UDB usage? I want to know how UDB works. Is there a manual you can recommend?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use as many SPI modules as can be put into the UDB resources of your PSoC5LP.
Looking at the code above - what is it that doesn't work? Is the loop never finished? In that case I would suspect that SPIM_2 is never started. Or its using a large buffer and you did not enable global interrupts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@hli
thank you for the reply. I'm resolved the problem. I forgot to start the SPI2 Module.
But I do not understand the UDB resources. How do I calculate UDB usage? I want to know how UDB works. Is there a manual you can recommend?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Read the Architecture TRM for the PSoC5, it explains the UDBs in quite some detail. The SPI component data sheet shows in the technical spec how many UDBs are consumed. And Creator also has a resource meter which shows how many resources are consumed by your project.