lockman_akim
Advanced Member level 1
- Joined
- Jul 12, 2010
- Messages
- 466
- Helped
- 76
- Reputation
- 152
- Reaction score
- 68
- Trophy points
- 1,308
- Location
- Malaysia
- Activity points
- 3,523
Hi,
I have a problem with my software uart, i dont receive any data at my computer after transmitting via soft uart. is that the problem cause by the unstable internal oscillator? here my code written using mikro c.
I have a problem with my software uart, i dont receive any data at my computer after transmitting via soft uart. is that the problem cause by the unstable internal oscillator? here my code written using mikro c.
Code:
char input[4];
char celcius[4];
char error,byte_read;
unsigned int raw_celcius;
int ad_val;
float ph;
char some_byte = 0x31;
void main()
{
UART1_Init(38400);
OSCCON.F6 = 1;
OSCCON.F5 = 1;
OSCCON.F4 = 1;
ADCON0 = 0b00000001;
ADCON1.F7 = 1;
ANSEL = 0b11111111;
TRISD = 0;
PORTD = 0;
UART1_Write_Text("LO");
UART1_Write(13);
PORTD = 255;
Delay_ms(500);
UART1_Write_Text("L1");
UART1_Write(13);
PORTD = 255;
Delay_ms(500);
error = Soft_UART_Init(&PORTC, 5, 4, 9600, 0);
do
{
if (error == 0)
{
PORTD = 255;
Soft_UART_Write(some_byte);
delay_ms(100);
PORTD = 0;
delay_ms(100);
error = Soft_UART_Init(&PORTC, 5, 4, 9600, 0);
}
else if (error > 0)
{
PORTD = 0;
}
}
while(1);
}