Forums

SCI communication problem

Started by Indrajit 5 years ago4 replieslatest reply 5 years ago286 views
Hi I am using c2000 piccolo launchpad(28027F) for sci communication . It has two multiprocessor communication mode -1. idle line 2. address bit mode , out of which i am using idle line mode to communicate with bq76pl455A-Q1 IC which has standard 8-N-1 uart , when i send some command to that ic it respond correctly but at the launchpad side i am enable to receive any signal , the program stopped at
while(SciaRegs.SCIRXST.bit.RXRDY !=1) {}
line in code .
My question is how to receive standard uart signal on c2000 launchpad which has sci idle line mode .

void sciReceive(Uint32 length, uint8 *data)
{
while(length--)
{
while(SciaRegs.SCIRXST.bit.RXRDY !=1) {}
*data=(uint8)(SciaRegs.SCIRXBUF.all);
*data++;
}
}
[ - ]
Reply by JohnHPoteApril 10, 2017

When your program waits at the while(...RXRDY !=1) line has it received any bytes at all? Check with an oscilloscope that the bq76pl455A is sending the correct number of correctly formatted bytes to the launchpad. If any bytes are being received (check the length var in your debugger) then perhaps not enough are being sent and the function will wait at this line forever or until another byte is sent.

The last line in the outer while loop is incorrect. *data++ is equivalent to (*data)++ which increments what 'data' points to. ie it increments the byte saved on the previous line. This line should increment the pointer itself, so use 'data++'.

It is often considered good practice to prefix pointers with a lower case 'p'. This make it very obvious in the code that the variable is a pointer. eg in this case 'pData'.

As it stands the function will block forever if 'length' bytes are not received. This might happen because the of a bq76pl455A fault or interference on the signal lines. You might want to consider adding a timeout to the function. The function should then return an appropriate code to indicate that not enough bytes were received.

[ - ]
Reply by IndrajitApril 10, 2017

Thanks for your reply.

 But when I sends some signal from other c2000 launchpad the same program receives the whatever i send from second launchpad . My actual question is can we receive standard 8-N-1 uart signal on launchpad running in SCI-idle line multiprocessor mode .If yes how to receive standard signal.  

Also i have checked on CRO that signal is coming correctly, But c2000 launchpad Rx pin is not getting wake-up because ,i think it is waiting for idle period or address . Is it possible to to receive standard uart on idle line mode uart.

Please help me.

[ - ]
Reply by JohnHPoteApril 10, 2017

My answer to your question was of a general nature. I am unfamiliar with the particular processor peripheral you are using so unless someone else knows the answer of the top of their head you will have to read and study the peripheral's documentation to see what the required formats in 'IDLE' mode and if the bq76pl455A transmissions conform to those formats. Hard work I'm afraid.

But you do say you can successfully send a message/frame/packet from another launchpad and receive that successfully. I suggest you use the oscilloscope to record one of these messages and see what the format is and how it compares to the message from the bq76pl455A.

[ - ]
Reply by Tim WescottApril 10, 2017

If you have a good digital storage scope, look at the message sent by the second launchpad, then reconnect and look at the message sent by the bq76pl455A.  Clearly they are different -- figuring out what the important differences are will tell you what you need to know.