EmbDev.net

Forum: ARM programming with GCC/GNU tools data overrun LPC1768


von Tom (Guest)


Rate this post
useful
not useful
Hey,
I just wanted to know if anybody is well schooled in data overrun with 
the LPC1768.

Maybe I am wrong but i think that there are two receive buffer, one for 
the last message and the other one for the one which is receiving when 
the other is processed.
If there is a third message a data overrun occures.

Does anybody know how I can see that there is a data overrun and how I 
can avoid it?
Maybe it is enough when I am reset my receive buffer by writing a "0" 
into the buffer?

thanks

von Tom (Guest)


Rate this post
useful
not useful
When I receive a message an interrupt occurs and the data will be 
processed. But there occurs an DOS so my controller is maybe to slow? it 
works with 12MHz and the CPU with 90MHz and my CAN data come in with 
500KB/s has anyone an idea how I can avoid that data overrun?
1
void CAN_ISR_Rx1( void )
2
{
3
  uint32_t * pDest;                  
4
5
  /* initialize destination pointer  */
6
  pDest = (uint32_t *)&MsgBuf_RX1;
7
  *pDest = LPC_CAN1->RFS;  /* Frame  */
8
9
  pDest++;
10
  *pDest = LPC_CAN1->RID; /* ID  */
11
  
12
13
  pDest++;
14
  *pDest =  LPC_CAN1->RDA; /* Data A */
15
16
17
  pDest++;
18
  *pDest = LPC_CAN1->RDB; /* Data B  */
19
20
  //Data_Score();        /* jedem Nachrichtenteil A oder B nach der ID geordnet ein Feld zuweisen*/
21
  
22
  CAN1RxDone = TRUE;
23
24
  data[0]=MsgBuf_RX1.DataA;
25
  data[1]=MsgBuf_RX1.DataB;
26
27
 // LPC_CAN1->CMR = (0x01 << 2); /* release receive buffer */
28
  LPC_CAN1->CMR |= (1<<1);
29
  LPC_CAN1->CMR |= (1<<2);
30
  LPC_CAN1->CMR |= (1<<3);
31
 /* LPC_CAN1->RFS = 0;
32
  LPC_CAN1->RID= 0;
33
  LPC_CAN1->RDA= 0;
34
  LPC_CAN1->RDB= 0;*/
35
  return;
36
37
38
}

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.