varunme
Advanced Member level 3
in the below code , it is to display "start" as soon as the com port / uC is connected isnt it ?, but it isnt and whenever the UART1_Write_Text is used, then some problem is there, but the program is echoing the character i sent
compiler mikroC and using hyperterminal
compiler mikroC and using hyperterminal
Code:
char uart_rd;
void main() {
ADCON1 |= 0x0F; // Configure AN pins as digital
CMCON |= 7; // Disable comparators
UART1_Init(19200); // Initialize UART1 module at 9600 bps
Delay_ms(100); // Wait for UART 1module to stabilize
UART1_Write_Text("Start");
UART1_Write(13);
UART1_Write(10);
while (1) { // Endless loop
if (UART1_Data_Ready()) { // If data is received,
uart_rd = UART1_Read(); // read the received data,
UART1_Write(uart_rd); // and send data via UART1
}
}
}