- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello every one, Hello BOB:
I set the UART interrupt as 'Rx-on byte received' and keep other parameters as default, then writed a simple ISR as following:
CY_ISR(Isr_UART_Rx)
{
/* ISR Code here */
//uint8 rxStatus;
uint8 rxData;
rxData = UART_RXDATA_REG;
switch(rxData)
{
case '1':
LED1_Write(0u);
break;
.........
default:
break;
}
UART_TXDATA_REG = rxData;
}
I find that evey time immediately after I download the program into the chip,
the interrupt occurs whenever a character is received;
But when I powerdown and then powerup the board again, the interrupt always occures after four characters are received,
which means the Rx interrupt occurs not at byte received but at the receiving FIFO becoming full.
How can I make the interrupt ocurring at each byte received?
- Labels:
-
PSoC 5LP
- 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.
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
I created a project to reproduce your issue, but I cannot reproduce the issue with my CY8CKIT-059. Please refer attached example project.
uint8 rxData = 0;
CY_ISR(int_Rx_isr) {
rxData = UART_RXDATA_REG;
UART_TXDATA_REG = rxData;
}
In the ISR, the value of RXDATA register is copied into the TXDATA register like your code.
int main(void) {
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
UART_Start();
int_Rx_StartEx(int_Rx_isr);
UART_PutString("HELLO WORLD\r\n");
for (;;) {
/* Place your application code here. */
}
}
In the main() function, UART and Interrupt components are started and show a greeting message.
When this project is written to the Prototyping kit, the greeting message was displayed and loop-back the entered characters. ISR is called once a character.
In my project, both FIFO size are set to four. This means the UART component uses the hardware FIFO only. Please check the FIFO size you specified.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Noriaki,
Thank you very much for your help.
I post the project here, Please help me to check if there is any uncorrect setting if you have time!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have converted your project into my CY8CKIT-059 but the issue is not reproduced.
I assigned pins as follows. Other pins are automatically assigned.
Pin Name | Pin |
---|---|
UART_Rx | P12[6] |
UART_Tx | P12[7] |
CMOD | P15[4] |
LED1 | P2[1] |
When I typed '1' and '3' alternately, the LED1 on the CY8CKIT-059 turns ON and OFF.
The behavior is same when the CY8CKIT-059 is disconnect and reconnect.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you dear Noriaki!
The phenomenon is weird.
Could it be a specific problem of the cypress chip on my PCB?
Or could it be a problem of the PCB designed by myself?
I will try the hardware and report it again.
Thanks again!