We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Dear sir;
I am doing an automotive project in LPC2368.Here It uses CAN for making communication between the nodes .The bit rate for both TX and RX is at 500KBits per second.
I configured a network consisting of two transmission nodes and single reception node.If I transmit with 12 data from "CAN_Send_Data" buffer like
while(1) { pCAN_Send_Data = CAN_Send_Data; for( i=0;i<12;i++) { Return_Value=lpc2000CANdriver_CertainTxBufTransmitMessage(LPC2000_CANCHANNEL_1,pCAN_Send_Data,LPC2000_TXB_1); pCAN_Send_Data++; } }
In the receiver I am not getting all data from transmitter.If I put the delay I am getting most of data in Receiver.I am putting delay as shown below,
while(1) { pCAN_Send_Data = CAN_Send_Data; for( i=0;i<12;i++) { for(j=0;j<200000;j++); /*delay for making Receiver to proccess data*/ Return_Value=lpc2000CANdriver_CertainTxBufTransmitMessage(LPC2000_CANCHANNEL_1,pCAN_Send_Data,LPC2000_TXB_1); pCAN_Send_Data++; } }
Will you please tell me ,How I can transmit a data from transmitter in order to achieve 500KB per second(with or without delay) ,such that I can receive and proccess(printing in UART0) all data in the receiver.
Sincerely Shamsudheen OP
Are you making sure that the transmit buffers are empty before before inserting more packets to send?
Are the receiver polled or interrupt-driven? If interrupt-driven - have you given the CAN interrupt a high-enough priority?
How do you know that you miss packets? Because the receiving node doesn't pick up 12 packets, or because the receiving node doesn't manage to print out information about all 12 packets?
Are you sure that you mean 500KB per second? Not 500kb or more explicitly 500kbit/s? A large B normally means bytes, not bits...
Note that if you continuouslly sends packets at 500kbit/s over the CAN interface, your UART also needs a huge baudrate to be able to forward all the received data.