Mar 03, 2016
02:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 03, 2016
02:29 AM
Hi ,
i´m trying to jump into the interrupt routine but without sucsess. I rebuilt Example UART001_Example1_XMC11 to UART001_Example3_XMC11 but never could jump into the interupt routine.
Its no matter what i choose for FIFO Size/trigger limit or baud rate. I tried it with Pin 1.2/1.3 and also with P2.0/P2.1.
What could be the problem to never get into the NVIC routine ? I used a breakpoint in FIFO_Receive but never reach it. Attached is the actual small Projekt.
---------------------------------------------------
void FIFO_Receive (void)
{
UART001_ReadDataBytes(&UART001_Handle1,&FifoReaddata[Count],1);
Count++;
}
uint8_t FifoReaddata[11];
uint8_t Count = 0;
int main(void)
{
uint16_t Data[11] = {0x48,0x45,0x4C,0x4C,0x4F,0x20,0x57,0x4F,0x52,0x4C,0x44};
uint8_t tempCount = 0;
DAVE_Init();
while(1)
{
while(tempCount != Count);
UART001_WriteDataBytes(&UART001_Handle1, &Data[Count], 1);
tempCount++;
}
return 0;
}
---------------------------------------
i´m trying to jump into the interrupt routine but without sucsess. I rebuilt Example UART001_Example1_XMC11 to UART001_Example3_XMC11 but never could jump into the interupt routine.
Its no matter what i choose for FIFO Size/trigger limit or baud rate. I tried it with Pin 1.2/1.3 and also with P2.0/P2.1.
What could be the problem to never get into the NVIC routine ? I used a breakpoint in FIFO_Receive but never reach it. Attached is the actual small Projekt.
---------------------------------------------------
void FIFO_Receive (void)
{
UART001_ReadDataBytes(&UART001_Handle1,&FifoReaddata[Count],1);
Count++;
}
uint8_t FifoReaddata[11];
uint8_t Count = 0;
int main(void)
{
uint16_t Data[11] = {0x48,0x45,0x4C,0x4C,0x4F,0x20,0x57,0x4F,0x52,0x4C,0x44};
uint8_t tempCount = 0;
DAVE_Init();
while(1)
{
while(tempCount != Count);
UART001_WriteDataBytes(&UART001_Handle1, &Data[Count], 1);
tempCount++;
}
return 0;
}
---------------------------------------
6 Replies
Mar 03, 2016
07:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 03, 2016
07:43 PM
Hello,
Are you trying to do a loop back function, i.e. each byte transmitted will also be received?
In this case, are you using a single pin for both transmit and receive functions or connecting a wire externally between the RXD and TXD pins?
Regards,
Min Wei
Are you trying to do a loop back function, i.e. each byte transmitted will also be received?
In this case, are you using a single pin for both transmit and receive functions or connecting a wire externally between the RXD and TXD pins?
Regards,
Min Wei
Mar 04, 2016
01:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 04, 2016
01:06 AM
Hello,
in this example i tried to send data from Pin 1.2 (Tx) to Pin 1.3 (Rx). I also tired it to send Data from Pin 1.2 (Tx, Handle0) to Pin 2.1 (Rx, Handle1) and vice versa. But this is only to get a test situation.
(under using of Version Dave3)
I´m searching for a solotuion to jump into a Interrupt routine. For example:
1. Send a string "STRING_NAME" via a Hyper terminal (UART protocoll)
2. This Stirng or the first character should be recognize and jump into the Interupt Handler (NVIC) without set a While() in the main()
3. In the Interrupt routine I want a string comparison to hadle it i.e. "LED_OFF"
4.I´m using App UART001 amd NVIC002. is this wrong for my scenario?
So I try to send a special command to leave the user productive Mode. Until now i could´t reach to get into the Interrupt Routine [ FIFO_Receive(void)]
in this example i tried to send data from Pin 1.2 (Tx) to Pin 1.3 (Rx). I also tired it to send Data from Pin 1.2 (Tx, Handle0) to Pin 2.1 (Rx, Handle1) and vice versa. But this is only to get a test situation.
(under using of Version Dave3)
I´m searching for a solotuion to jump into a Interrupt routine. For example:
1. Send a string "STRING_NAME" via a Hyper terminal (UART protocoll)
2. This Stirng or the first character should be recognize and jump into the Interupt Handler (NVIC) without set a While() in the main()
- While(1) { while((UART001_GetFlagStatus(&UART001_Handle0,UART001_FIFO_STD_RECV_BUF_FLAG))!= UART001_SET); .... }
3. In the Interrupt routine I want a string comparison to hadle it i.e. "LED_OFF"
4.I´m using App UART001 amd NVIC002. is this wrong for my scenario?
So I try to send a special command to leave the user productive Mode. Until now i could´t reach to get into the Interrupt Routine [ FIFO_Receive(void)]
Attachments are accessible only for community members.
Mar 04, 2016
01:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 04, 2016
01:40 AM
Hello,
I have created a simple example, which triggers a receive interrupt function whenever the device receives a byte from the hyperterminal.
To test, I did the following:
- Setup Docklight hyperterminal program @19.2kbaud
- Sent 11 bytes to the device
- Checked that the 11 bytes are correctly received in the variable FifoReaddata[].
Note that the example is based on XMC1300 as I do not have an XMC1100 board on hand.
Can you have a look?
Regards,
Min Wei
I have created a simple example, which triggers a receive interrupt function whenever the device receives a byte from the hyperterminal.
To test, I did the following:
- Setup Docklight hyperterminal program @19.2kbaud
- Sent 11 bytes to the device
- Checked that the 11 bytes are correctly received in the variable FifoReaddata[].
Note that the example is based on XMC1300 as I do not have an XMC1100 board on hand.
Can you have a look?
Regards,
Min Wei
Mar 04, 2016
01:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 04, 2016
01:50 AM
Just wondering if you could have missed the signal connection step in your example:
This assigns the UART interrupt to an NVIC node for interrupt generation.
Regards,
Min Wei
This assigns the UART interrupt to an NVIC node for interrupt generation.
Regards,
Min Wei
Not applicable
Mar 04, 2016
03:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 04, 2016
03:47 AM
Hi Forian31,
you may want to check, if the USIC0_CHx->INPR, the USIC0_CHx->RBCTR are set correctly. Also check the the interrupt routine will be called:
void CHx_RxInterruptCall()
{ // put your code here!
}
void IRQ_Hdlr_9 (void) {CHx_RxInterruptCall();}
Also be aware that size has to be set to zero prior setting DPTR in RBCTR, otherwize the RBCTR will not be set correctly.
//FIFO Rx
const uint32_t size0=0x7<<24;
uint8_t DPTR; DPTR=1< USIC0_CH0->RBCTR &= ~size0;
USIC0_CH0->RBCTR= DPTR + (LofRx<<28) + (LimitRx<<1) + (SizeRx<<24);
you may want to check, if the USIC0_CHx->INPR, the USIC0_CHx->RBCTR are set correctly. Also check the the interrupt routine will be called:
void CHx_RxInterruptCall()
{ // put your code here!
}
void IRQ_Hdlr_9 (void) {CHx_RxInterruptCall();}
Also be aware that size has to be set to zero prior setting DPTR in RBCTR, otherwize the RBCTR will not be set correctly.
//FIFO Rx
const uint32_t size0=0x7<<24;
uint8_t DPTR; DPTR=1<
USIC0_CH0->RBCTR= DPTR + (LofRx<<28) + (LimitRx<<1) + (SizeRx<<24);
Mar 07, 2016
02:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 07, 2016
02:27 AM
Hey,
thank you for the example and no i did the signgal connection.
A few words, i just rebuild your example and tried it first without reach the Interrupt routine. So i changend my baud rate from 115200 ( in UART configuration and Hyper Terminal) to 19200. Also i had to change the FIFO amount to 16. <-- because I only got three bytes an not 11
I also used in the UART configuration the FIFO receive buffer interrupt. Maybe that was also a mistake ??? I my unterstanding it is just the different when the interrupt should occurs or there are othe sepzifications?
Finaly in case of a reception an interrupt occurs. Therfore i changed baud rate ( lower speed), FIFO size and rebuild a new Project. Why my other examples ( UART examples) and other project didn´t work are still misterious. I hope I can check this in the next few days,...
@ smktec
Thank you for your support. I will look after this, just for getting a better understanding because i´m a beginner. Therefor one further question:
USIC0_CH0->RBCTR= DPTR + (LofRx<<28) + (LimitRx<<1) + (SizeRx<<24);
this line mean, that i just set the part of the RBCTR i mentioned here ?
thank you for the example and no i did the signgal connection.
A few words, i just rebuild your example and tried it first without reach the Interrupt routine. So i changend my baud rate from 115200 ( in UART configuration and Hyper Terminal) to 19200. Also i had to change the FIFO amount to 16. <-- because I only got three bytes an not 11
I also used in the UART configuration the FIFO receive buffer interrupt. Maybe that was also a mistake ??? I my unterstanding it is just the different when the interrupt should occurs or there are othe sepzifications?
Finaly in case of a reception an interrupt occurs. Therfore i changed baud rate ( lower speed), FIFO size and rebuild a new Project. Why my other examples ( UART examples) and other project didn´t work are still misterious. I hope I can check this in the next few days,...
@ smktec
Thank you for your support. I will look after this, just for getting a better understanding because i´m a beginner. Therefor one further question:
USIC0_CH0->RBCTR= DPTR + (LofRx<<28) + (LimitRx<<1) + (SizeRx<<24);
this line mean, that i just set the part of the RBCTR i mentioned here ?