You are here

M0036 - Resource Limit Error when adding SPI & UART module | Cypress Semiconductor

M0036 - Resource Limit Error when adding SPI & UART module

Summary: 17 Replies, Latest post by #ok on 14 Sep 2016 11:34 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
#ok
user_361616940's picture
User
97 posts

Hi All,

I am using SPI & UART in my project,

Initially i added  UART(v2.50) into my project , works everything as expected.

Later i added SPI Master Fullduplex macro  and getting this below error.

Pin guidance unavailable: Resource limit: Maximum number of Macrocells exceeded (max=32, needed=37).

If i add the originlal SPI Master (v2.50) aslo im getting same error

please provide me the solutions

 

Thanks,

Ashok R

user_1377889's picture
User
10419 posts

Your UART component uses UDBs, better is to take the SCB based UART. Same for the SPI component.

 

Bob

#ok
user_361616940's picture
User
97 posts

Hi Bob,

If i use SCB based UART , how do i can configure the UART reception ISR?

Also in SPI,

     SPIM_SpiUartPutArray(dummyBuffer, 3);    How do i can set register address here? and Data  to write ?

 

Thanks,

Ashok R

user_1377889's picture
User
10419 posts

There is nearly no functional difference between the UDB and the SCB implementation except the GPIO pins are quite dedicated in the SCB version. Refer to datasheet.

 

Bob

#ok
user_361616940's picture
User
97 posts

Hi Bob,

I tried with SCB mode but could not getting interrupt on reception , here my code

int main()
{
    CyGlobalIntEnable; /* Enable global interrupts. */

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */
    
    UART_1_SCB_IRQ_StartEx(UART_1_ISR);
    
    
    
    UART_1_Start();
       CyDelay(250);
    UART_1_UartPutString("AT\r\n");
    
    CyDelay(250);

    for(;;)
    {
        /* Place your application code here. */
    }
}

 

CY_ISR(UART_1_ISR){
    
    
   breakpoint...
       
    
}

 

 

user_1377889's picture
User
10419 posts

Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

As I understood you: The breakpoint isn't reached?

 

Bob

#ok
user_361616940's picture
User
97 posts

Hi Bob,

Please find the project herem, also im getting some error after adding SCB SPI module.

please check

 

Thanks,

Ashok R

user_1377889's picture
User
10419 posts

As I said in a previous post: "the GPIO pins are quite dedicated in the SCB version". Right click on the "Lock" header in the .cydwr view and select "Auto assign..." then build the project. You will get a working version. Then lock all pins and try manual pin assign when needed.

 

Bob

#ok
user_361616940's picture
User
97 posts

Hi Bob,

Yes , The Error is cleared now, but my issues is receiving the UART data on interrupt.

Thanks,

Ashok R

user_1377889's picture
User
10419 posts

One after the other...  ;-)

You did not specify on which event the interrupt should fire, UART advanced page.

Just a tip: Increase the Tx buffer (if you like, the Rx buffer too) to something like 100..200. Thzen an interrnal interrupt jumps in and handles all for you. Use the GetTxBufferSize() (and GetRxBufferSize()) APIs to see how much is left (or already) in the queue.

 

Bob

#ok
user_361616940's picture
User
97 posts

Hi Bob,

I tried that also, but there is no option to set ISR for On receive of Every byte.

#ok

Log in to post new comments.