This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28030: Sending ascci data corruption when while loop is removed

Part Number: TMS320F28030

Tool/software: Code Composer Studio

Hello,  data is transmitted via RS232 Bit bang,  using the while loop  there are no issues, the data s transmitted correctly with or without the debugger.

When the while loop is commented out  the data is garbage (fail), with and without the debuggert  

#define UART_WAIT_ONE_BIT for (delay1 = 1; delay1 <43; delay1++) {asm(" NOP"); asm(" NOP"); asm(" NOP");asm(" NOP"); asm(" NOP"); asm(" NOP"); asm(" NOP"); asm(" NOP"); asm(" NOP"); asm(" NOP");}

 

Uint8 FwRevision[] = {"12345678-  A"};

PASS:

while(1){

tx_FirmwareSerialNumber(FwRevision);

}

FAIL:  

//while(1){

tx_FirmwareSerialNumber(FwRevision);

//}

 

Sub

void tx_FirmwareSerialNumber(Uint8 *ptrFwRevision

Uint8 delay1,byteCount,mask,bitIndex;

byteCount = 11;

mask = 0x01; 

byteCount = 0;

for(byteCount = 0; byteCount < 11; byteCount++){

//Send start Bit

GpioDataRegs.GPACLEAR.bit.GPIO23 = 1;

UART_WAIT_ONE_BIT

//Transmit 8 bits, shift the data

for(bitIndex = 0; bitIndex <8; bitIndex++){

if(ptrFwRevision[byteCount] & mask){

GpioDataRegs.GPASET.bit.GPIO23 = 1;

}

else

{

GpioDataRegs.GPACLEAR.bit.GPIO23 = 1;

}

//LSB First,

mask <<= 1;

UART_WAIT_ONE_BIT

}

//Tx Stop bit

GpioDataRegs.GPASET.bit.GPIO23 = 1;

UART_WAIT_ONE_BIT

UART_WAIT_ONE_BIT

UART_WAIT_ONE_BIT

mask = 0x01;

}//End while