Part Number: TMS320F28335
Tool/software: Code Composer Studio
Hi Team,
We received inquiry from customer asking for support regarding CCS and TMS320F28335 device. For me to not miss any information, I'll be copying the query below.
"
When I tried to convert data and send them for the serial, it's seems that I am using a function provided at string.h that it dosn't work like I would like. The code is like that:
interrupt void Task_2()
{
DefaultType fZOH36, fBlock13, fZOH34, fZOH37, fZOH38, fZOH39;
PS_MaskIntr(M__INT14);
fZOH39 = fGblADC1_10;
fZOH38 = fGblADC1_11;
fZOH37 = fGblADC1_8;
fZOH34 = fGblADC1_9;
{
static int contador=0;
static char mensaje_1[17]="00000000000000000";
static char Vin[7]="0000000";
static char Vout[7]="0000000";
static char Iin[7]="0000000";
static char Iout[7]="0000000";
fBlock13=1;
if (contador>=4){
contador=0;
}
else{
contador++;
}
switch(contador) {
case 0:
sprintf( Iin,"%f",fZOH39);
sprintf( Iout,"%f",fZOH38);
sprintf( Vin,"%f",fZOH37);
sprintf( Vout,"%f",fZOH34);
strcpy(mensaje_1, "ADC:CH1:");
strcat(mensaje_1, Vin);
mensaje_1[15]='\n';
mensaje_1[16]='\0';
The conflict I thinks it's the way I use the sprintf and the concatenates, due when I remove the mensaje_1[15]='\n';
mensaje_1[16]='\0'; and use only a number like 1 or 2, the variable wich stores the scia missatges don't become crazy.
the memory browser also revels:
mensaje_1
A D C : C H 1 : 0 . 7 6 4 6 4 . .
mensaje_2
A D C : C H 2 : 0 . 7 6 5 3 8 1 2
"
Thank you and looking forward for your kind response.
Regards,
Maynard