ola amigos to migrando da linguagem assembly pra "C" estou usando o MikroC E ESTOU COM UM PROBLEMINHA FIZ O CODIGO DO MEU PROGRAMA E DEPOIS TESTE NO PROTEUS SO QUE ACONTECE QUANDO O VALOR DA CONVERSAO FICA ABAIXO DE 1 VOLTS O DISPLAY LCD MOSTRA;
EXEMPLO DE CONVERSAO 0.59 VCC NO DISPLAY APARECE 5.90 OQ HA DE ERRADO NO MEU CODIGO.
// LCD module connections
sbit LCD_RS at Rc0_bit;
sbit LCD_EN at Rc1_bit;
sbit LCD_D4 at Rc2_bit;
sbit LCD_D5 at Rc3_bit;
sbit LCD_D6 at Rc4_bit;
sbit LCD_D7 at Rc5_bit;
sbit LCD_RS_Direction at TRISc0_bit;
sbit LCD_EN_Direction at TRISc1_bit;
sbit LCD_D4_Direction at TRISc2_bit;
sbit LCD_D5_Direction at TRISc3_bit;
sbit LCD_D6_Direction at TRISc4_bit;
sbit LCD_D7_Direction at TRISc5_bit;
// End LCD module connections
char valor [16];
char text [] =" Canal Analogico";
char volts[] ="Volts";
int ve = 0;
float leitura = 0.0;
void main() {
portc = 0 ; //saidas sao 0
trisc = 0 ; //saida
trisa.f0 = 1; //ra0 entrada
adcon1 = 0b00001110 ; //ra0 como analogico
lcd_init(); //inicializa lcd
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_cursor_Off);
lcd_out(1,1,text);
delay_ms(100);
lcd_out(2,1,volts);
do{
ve = ADC_Read(0); // Get 10-bit results of AD conversion
delay_us(10);
leitura = ve*0.00498;
floatToStr(leitura,valor);
//wordtostr(valor,valor);
lcd_out(2,12,valor);
}while(1);
}