Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hello,
I am receiving GPS data through SCIB, and i wanted to send this thata through SCIA. I have based on the example project "Example_2806xSci_Echoback.c".
When i only use SCIB (i use pins 77 scibtx and 75 scibrx) to receive GPS data, the code works fine, it reads the data, and then processes it to extract the information i am intrested in (Latitude, longitude, speed, and another parameter). Then i connected SCIA (pins 3 sciarx and 4 sciatx) to an external display, which also seem to work fine, i have tested this connection, commenting out the SCIB portion of the code, and the screen received correct data from SCIA.
However, when i try to use both scia and scib in the same code, scib doesn't seem to correctly receive the GPS data. I think i might have a timing problem, where scib doesn't have enough time to receive all the data because i made other functions that may take too long to finish, but i amb really new to this so i might be missing sth important.
Appart from that i also wanted to ask whether it would be much more dificult to use interrupts to achieve my goal, i have never used interrupts so i am not familiar with how they work...
Here is the main loop code with comments. some functions have wierd names because i made them in my language catalan:
for(;;)
{
scia_msg("velocitat.val=");
scia_msg(vel); // vel is a char array containing info for the display
scia_xmit(255);
scia_xmit(255);
scia_xmit(255);
}
while(ScibRegs.SCIFFRX.bit.RXFFST ) { // while there is sth sent by gps and received by scib
ReceivedChar = ScibRegs.SCIRXBUF.all;
missatge[index] = ReceivedChar; //this creates a char array of the bytes received from GPS, which sends Sentences starting with '$' and then the information.
index++;
if ('$' == ReceivedChar) {
index = 0;
analitza_paraula(); //this function analyses the array "missatge" received from GPS to extract the info and update the variables "latutude", "longitude", speed etc...
}
}
}
i only posted the main loop, if i comment out the first lines, from scia_msg("velocitat.val="); to the last scia_xmit(255); the code works and extracts the correct information from the GPS, but if i add these first 5 lines of code SCIB doesn't seem to read data, it never enters the if ('$' == ReceivedChar) {} condition, neither the while (ScibRegs...) loop.
Does anyone have any idea of what could be the cause?
Thank you very much for the attention, i am really stuck at this point