how to dispaly the a/d value from PIC16F877 using visual basic in digital value
Do you mean something like this:GioppY
can you teach mo how? like to ask for your code on that... please
I have attached the vb6 source code and the exe.
It communicate by one of the available com port on your pc @ 2400 baud,n,8,1
It wait for a string in the following format xx,xCR (CR means carriage return) where xx,x is a numeric value in the 00,0 to 19,9 range (please note the comma).
When receive the string it display the value (the string as received) and plot a graphic representation; after 128 samples the plot is erased and restarted.
It wait for a string every second; i do not know if it can handle higher sample rate.
Obviously you have to modify the code for your requirement.
Regards
Gianni
P.S.
220v ??? I hope that you use a transformer to REDUCE and ISOLATE the mains from the pic and from the pc
Hi.
I have attached the vb6 source code and the exe.
It communicate by one of the available com port on your pc @ 2400 baud,n,8,1
It wait for a string in the following format xx,xCR (CR means carriage return) where xx,x is a numeric value in the 00,0 to 19,9 range (please note the comma).
When receive the string it display the value (the string as received) and plot a graphic representation; after 128 samples the plot is erased and restarted.
It wait for a string every second; i do not know if it can handle higher sample rate.
Obviously you have to modify the code for your requirement.
Regards
Gianni
P.S.
220v ??? I hope that you use a transformer to REDUCE and ISOLATE the mains from the pic and from the pc
GioppY
Gioppy can you check my c program for microcontroller if its correct? thanks
Can you explain your project in some detail(mainly the algo)....
As for the C program some things look suspect.....
norms = (( 2.5 *1023)/5);
Now why would you do that?Why not simply 'norms=511',which is the value you get from that computation.
And what is 'volts_out'?Are you reading in some value from the serial port?
else if(volts_out==get_adc)
You haven't initialised get_adc,so you're in effect comparing volts_out to garbage.
Private Sub CmdExit_Click() If MSComm1.PortOpen = True Then MSComm1.PortOpen = False End If End End Sub Private Sub Form_Load() MSComm1.InputLen = 0 MSComm1.CommPort = 1 MSComm1.Settings = "2400,N,8,1" End Sub Private Sub Timer1_Timer() Dim BytesToRead As Integer Dim norms As Variant MSComm1.PortOpen = True BytesToRead = 1 Do DoEvents Loop Until MSComm1.InBufferCount = BytesToRead norms = MSComm1.Input Text1.Text = (((Asc(norms) * 0.01) * 230) / 2.5) & " Volts AC" MSComm1.PortOpen = False End Sub
[ Edited Fri Feb 22 2008, 10:26 pm ]