lacoste
Newbie level 1
![Newbie level 1](/styles/images/ranks/alevel1.gif)
Are there any examples, links, posts, or other information I can follow to build a voltmeter (5 volts, simple) circuit by using a pic16f887? The result is to be displayed on an ldc......
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
can u give me exp.it perform the conversion (scaling) inside the Pic and then display it, and ur scaling depends upon ur reference voltages at the Pic16f676.engr_najam said:you will also have to perform the conversion (scaling) inside the Pic and then display it, and ur scaling depends upon ur reference voltages at the Pic
engr_najam said:suppose ur reference voltages are 0 - 5 volts
program softwarefor887Voltmeter
dim LCD_RS as sbit at RB4_bit
LCD_EN as sbit at RB5_bit
LCD_D4 as sbit at RB0_bit
LCD_D5 as sbit at RB1_bit
LCD_D6 as sbit at RB2_bit
LCD_D7 as sbit at RB3_bit
LCD_RS_Direction as sbit at TRISB4_bit
LCD_EN_Direction as sbit at TRISB5_bit
LCD_D4_Direction as sbit at TRISB0_bit
LCD_D5_Direction as sbit at TRISB1_bit
LCD_D6_Direction as sbit at TRISB2_bit
LCD_D7_Direction as sbit at TRISB3_bit
dim ADCResult as longword
dim voltage as word[5]
dim display as string[5]
sub procedure GlobInit
ANSEL = 1
ANSELH = 0
TRISA = 1
TRISB = 0
PORTB = 0
LCD_Init()
LCD_Cmd(_LCD_CLEAR)
LCD_Cmd(_LCD_CURSOR_OFF)
LCD_Out(1, 1, "Voltage:")
LCD_Chr(1, 16, "V")
display[1] = "."
end sub
main:
GlobInit
while true
ADCResult = (ADC_Read(0) * 500) >> 10
voltage[0] = ADCResult div 100
voltage[1] = (ADCResult div 10) mod 10
voltage[2] = ADCResult mod 10
display[0] = voltage[0] + 48
display[2] = voltage[1] + 48
display[3] = voltage[2] + 48
vout:
LCD_Out(1, 10, display)
delay_ms(50)
wend
end.
Tahmid said:Hi lacoste,
I present here a simple voltmeter with 16F887 (0-5v scale). But mind it, this is very basic with no input overvoltage protection. A voltage greater than 5v applied to the input will destroy the 16F887.
Source code (written in mikroBasic):
Code:program softwarefor887Voltmeter dim LCD_RS as sbit at RB4_bit LCD_EN as sbit at RB5_bit LCD_D4 as sbit at RB0_bit LCD_D5 as sbit at RB1_bit LCD_D6 as sbit at RB2_bit LCD_D7 as sbit at RB3_bit LCD_RS_Direction as sbit at TRISB4_bit LCD_EN_Direction as sbit at TRISB5_bit LCD_D4_Direction as sbit at TRISB0_bit LCD_D5_Direction as sbit at TRISB1_bit LCD_D6_Direction as sbit at TRISB2_bit LCD_D7_Direction as sbit at TRISB3_bit dim ADCResult as longword dim voltage as word[5] dim display as string[5] sub procedure GlobInit ANSEL = 1 ANSELH = 0 TRISA = 1 TRISB = 0 PORTB = 0 LCD_Init() LCD_Cmd(_LCD_CLEAR) LCD_Cmd(_LCD_CURSOR_OFF) LCD_Out(1, 1, "Voltage:") LCD_Chr(1, 16, "V") display[1] = "." end sub main: GlobInit while true ADCResult = (ADC_Read(0) * 500) >> 10 voltage[0] = ADCResult div 100 voltage[1] = (ADCResult div 10) mod 10 voltage[2] = ADCResult mod 10 display[0] = voltage[0] + 48 display[2] = voltage[1] + 48 display[3] = voltage[2] + 48 vout: LCD_Out(1, 10, display) delay_ms(50) wend end.
can give HEX FILE.PIC 16F676 voltmeter ,it i\p rang 0-500 v AC.7 segment display & ckt diagram also.Tahmid said:Hi sahu,
I wrote the program in mikroBASIC and so don't have any ASM file except the one generated by mikroBASIC which isn't of much help.
DEAR FRIENDTahmid said:Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.
sahu said:DEAR FRIENDTahmid said:Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.
my & ur country r diffr.so i hope no commercial problome with us.
pl pl pl pl ................help me .if any other problome .can u cont. me on ............shivendrakumarsahu77(at)yahoo.com
Tahmid said:Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.
I can fully understand what Tahmid is saying, Basically his father uses it in a commercial product so if his father is selling it then it does not matter what country you’re in the same rules apply,hameeds01 said:Tahmid said:Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.
did u make a formula for Atom Bomb ?? is it so secret ?? u made it urself OMG
![]()
wizpic said:I can fully understand what Tahmid is saying, Basically his father uses it in a commercial product so if his father is selling it then it does not matter what country you’re in the same rules apply,hameeds01 said:Tahmid said:Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.
did u make a formula for Atom Bomb ?? is it so secret ?? u made it urself OMG
![]()
Why should he release is code anyway, I know how long it can take to develop something and I can tell you it's a lot of hard work and time, And Time is money, The trouble is with some people rahter than do it there self’s there to lazy to learn for themselves, This would be liking asking one of the manufactures can you give me the code you use in one of there products and say but it’s ok I don’t live in your country, Would you think there be fourth coming in saying sure no problem yeah right sure they will.
A good example is lacoste first post in asking is there any sample code if he had bothered to use google he woudl have founds lots of samples and schematics, It looks like his really needed has he has never come back to say thanks for your help, So this means it's either not exactly what his after or his took the advise and may never post here again