manoj madhavan
Banned

- Joined
- May 1, 2010
- Messages
- 119
- Helped
- 5
- Reputation
- 10
- Reaction score
- 5
- Trophy points
- 1,308
- Location
- India, Kerala, Moolamattom
- Activity points
- 0
Hallo Viewers,
I get a good and simple LCD based Voltmeter with PIC16F688 form internet.It can measure only 1.5 V to 20 V DC. But i need to change the Voltage range between 1.5 V to 70 V DC. can anyone know how to convert the source code for given purpose? I dont know to change the source code. This this the programme code of the PIC16F688 and the Cfile for the code.
.................................................................
// LCD module connections
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections
char Message2[] = " DVM Ver 1.1s";
char Message1[] = " OUTPUT=";
unsigned int ADC_Value, DisplayVolt;
char *volt = "00.0";
void main() {
ANSEL = 0b00000100; // RA2/AN2 is analog input
ADCON0 = 0b00001000; // Analog channel select @ AN2
ADCON1 = 0x00;
CMCON0 = 0x07 ; // Disbale comparators
TRISC = 0b00000000; // PORTC All Outputs
TRISA = 0b00001100; // PORTA All Outputs, Except RA3 and RA2
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // CLEAR display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,Message2);
Lcd_Out(2,1,Message1);
Lcd_Chr(2,14,'V');
do {
ADC_Value = ADC_Read(2);
DisplayVolt = ADC_Value * 2;
volt[0] = DisplayVolt/1000 + 48;
volt[1] = (DisplayVolt/100)%10 + 48;
volt[3] = (DisplayVolt/10)%10 + 48;
Lcd_Out(2,10,volt);
delay_ms(100);
} while(1);
}
.......................................................................................................
Help me anyone please......now i am on yahoo messanger.........
manojsoorya at ymail dot com : this is my ID
I get a good and simple LCD based Voltmeter with PIC16F688 form internet.It can measure only 1.5 V to 20 V DC. But i need to change the Voltage range between 1.5 V to 70 V DC. can anyone know how to convert the source code for given purpose? I dont know to change the source code. This this the programme code of the PIC16F688 and the Cfile for the code.
.................................................................
// LCD module connections
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections
char Message2[] = " DVM Ver 1.1s";
char Message1[] = " OUTPUT=";
unsigned int ADC_Value, DisplayVolt;
char *volt = "00.0";
void main() {
ANSEL = 0b00000100; // RA2/AN2 is analog input
ADCON0 = 0b00001000; // Analog channel select @ AN2
ADCON1 = 0x00;
CMCON0 = 0x07 ; // Disbale comparators
TRISC = 0b00000000; // PORTC All Outputs
TRISA = 0b00001100; // PORTA All Outputs, Except RA3 and RA2
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // CLEAR display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,Message2);
Lcd_Out(2,1,Message1);
Lcd_Chr(2,14,'V');
do {
ADC_Value = ADC_Read(2);
DisplayVolt = ADC_Value * 2;
volt[0] = DisplayVolt/1000 + 48;
volt[1] = (DisplayVolt/100)%10 + 48;
volt[3] = (DisplayVolt/10)%10 + 48;
Lcd_Out(2,10,volt);
delay_ms(100);
} while(1);
}
.......................................................................................................
Help me anyone please......now i am on yahoo messanger.........
manojsoorya at ymail dot com : this is my ID