- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your UART component uses UDBs, better is to take the SCB based UART. Same for the SPI component.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
Yes , The Error is cleared now, but my issues is receiving the UART data on interrupt.
Thanks,
Ashok R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
I tried that also, but there is no option to set ISR for On receive of Every byte.
#ok
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rx fifo not empty would be a good candidate...
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
Now i used UART_ESP_SetCustomInterruptHandler(UART_ESP_ISR); instead of UART_ESP_SCB_IRQ_StartEx(UART_ESP_ISR); and intereupt on reception is working but want to know what is the use of
UART_ESP_SCB_IRQ_StartEx(UART_ESP_ISR); ?
Thanks,
Ashok R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi bob,
here my ISR code,
CY_ISR(UART_ESP_ISR){
while(UART_ESP_INTR_RX_NOT_EMPTY ){
*RxWriteIndex++ = UART_ESP_UartGetByte();
}
}
After reading all received data , UART_ESP_INTR_RX_NOT_EMPTY flag not reseting to Zero, so the execution not coming out from the while loop. Can you suggest any other way to read all the data from FIFO?
Thanks,
Ashok R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See page 99 of datasheet: You have chosen the SetCustomInterruptHandler() which is additional to the internal interrupt handler.
SCB_IRQ_StartEx() does not exist. When replacing the internal interrupt completely, by using external interrupt, a signal is generated where you can connect an isr component to. For this isr you may specify a handler using isr_StartEx();
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
Ok, Please tell me should i go with the CustomInterrupt handler? or Default ISR ,
If default ISR means , what changes i need to do?
also provide me solution to below one, (right status register to come out from the loop after read all data)
while(UART_ESP_INTR_RX_NOT_EMPTY ){
*RxWriteIndex++ = UART_ESP_UartGetByte();
}
#ok
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I suggested before:
Increase the Tx buffer and the Rx buffer to something like 100..200. Then the internal interrupt handles all for you. Use the GetTxBufferSize() and GetRxBufferSize() APIs to see how much is left or already in the queue.
When you like to handle the interrupts yourself write a "circular buffer" (Google for that).
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
I agreed that internal interrupts handles the receiving data , but i do not want to use polling to read data, want some callbacks to execute on interrupt , UART_ESP_SetCustomInterruptHandler(UART_ESP_ISR); did that for me.
from this post http://www.cypress.com/forum/psoc-4-architecture/psoc4200-uart-interrupt-example
i got uart example code , which has the implemenation of ISR using UART_ESP_SCB_IRQ_StartEx(UART_ESP_ISR);
this is the reason i confused. why its not working in SCB mode.
Thanks,
Ashok R