¿Alguién puede corregir mi programación en MIKROC para Comunicación Serial?

Tengo que enviar los datos de la temperatura a Visual C#, el problema está que al llegar mis datos la temperatura ya no va´ria, se queda quita.

¿Dónde debo colocar el UART?

/*Cabecera******************************************************/

// Conexiones del módulo LCD
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// Final de conexiones del módulo LCD
char uart_rd;
const unsigned short TEMP_RESOLUTION = 9;
char *text = "000.00";
unsigned temp;

void Display_Temperature(unsigned int temp2write) {
const unsigned short RES_SHIFT = TEMP_RESOLUTION - 8;
char temp_whole;
unsigned int temp_fraction;
uart_rd=text;
// comprobar si la temperatura es negativa
if (temp2write & 0x8000) {
text[0] = '-';
temp2write = ~temp2write + 1;
}

// extraer temp_whole
temp_whole = temp2write >> RES_SHIFT ;

// convertir temp_whole en caracteres
if (temp_whole/100)
text[0] = temp_whole/100 + 48;
else
text[0] = '0';

text[1] = (temp_whole/10)%10 + 48; // Extraer dígito de decenas
text[2] = temp_whole%10 + 48; // Extraer dígito de unidades

// extraer temp_fraction y convertirlo en unsigned int
temp_fraction = temp2write << (4-RES_SHIFT);
temp_fraction &= 0x000F;
temp_fraction *= 625;

// convertir temp_fraction en caracteres
text[4] = temp_fraction/1000 + 48; // Extraer dígito de miles
text[5] = (temp_fraction/100)%10 + 48; // Extraer dígito de centenas
text[6] = (temp_fraction/10)%10 + 48; // Extraer dígito de decenas
text[7] = temp_fraction%10 + 48; // Extraer dígito de unidades

// Visualizar temperatura en el LCD
Lcd_Out(2, 5, text);

}

void main() {
ADCON1 = 6;

Lcd_Init(); // Inicializar el LCD
Lcd_Cmd(_LCD_CLEAR); // Borrar el LCD
Lcd_Cmd(_LCD_CURSOR_OFF); // Apagar el cursor
Lcd_Out(1, 1, " Temperatura: "); //Asigno el nombre de lo que quiero que aparezca arriba.

// Visualizar el carácter de grado, 'C' para centígrados
Lcd_Chr(2,13,223); // distintos visualizadores LCD tienen diferentes códigos
// de caracteres para el grado
// si ve la letra griega Alfa, intente introducir 178 en vez de 223
Lcd_Chr(2,14,'C');

do {
//--- realizar lectura de temperatura
Ow_Reset(&PORTE, 2); // Señal de reinicio de Onewire
Ow_Write(&PORTE, 2, 0xCC); // Ejecutar el comando SKIP_ROM
Ow_Write(&PORTE, 2, 0x44); // Ejecutar el comando CONVERT_T
Delay_us(120);
Ow_Reset(&PORTE, 2);
Ow_Write(&PORTE, 2, 0xCC); // Ejecutar el comando SKIP_ROM
Ow_Write(&PORTE, 2, 0xBE); // Ejecutar el comando READ_SCRATCHPAD
temp = Ow_Read(&PORTE, 2);
temp = (Ow_Read(&PORTE, 2) << 8) + temp;
Display_Temperature(temp); //--- Formatear y visualizar el resultado en el LCD
Delay_ms(500);
UART1_Init(9600);
Delay_ms(100);
UART1_Write_Text(uart_rd);

while (1) { // Endless loop
if (UART1_Data_Ready()==1) { // If data is received,
uart_rd = UART1_Read(); // read the received data,
UART1_Write(uart_rd); // and send data via UART
}
}
// Wait for UART module to stabilize
} while (1);

}



¿dónde debo poner el UART?
 
Atrás
Arriba