free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes :: Forums :: Discuss and Learn :: PIC Microcontroller Discussion
 
<< Previous thread | Next thread >>
how to dispaly the a/d value from PIC16F877 using visual basic in digital value
Go to page  1 [2] 3 4
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
norms
Sat Feb 16 2008, 10:14AM
 User Offline
Registered Member #6079
Joined: Sat Feb 16 2008, 12:34AM

Posts: 28
Thanked 0 times in 0 posts
GioppY wrote ...

Do you mean something like this:




can you teach mo how? like to ask for your code on that... please

Back to top


GioppY
Sat Feb 16 2008, 11:27AM
 User Offline
Registered Member #6071
Joined: Fri Feb 15 2008, 03:10PM

Posts: 22
Thanked 7 times in 4 posts
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
batt_mon.zip
Back to top


norms
Sat Feb 16 2008, 11:39AM
 User Offline
Registered Member #6079
Joined: Sat Feb 16 2008, 12:34AM

Posts: 28
Thanked 0 times in 0 posts
thanks... yup i am using a transformer to step down the voltage then have some declarations equating 220=2.5 volts... thank you very much...
Back to top


norms
Sat Feb 16 2008, 10:25PM
 User Offline
Registered Member #6079
Joined: Sat Feb 16 2008, 12:34AM

Posts: 28
Thanked 0 times in 0 posts
GioppY wrote ...

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
batt_mon.zip


Gioppy can you check my c program for microcontroller if its correct? thanks
Back to top


GioppY
Sun Feb 17 2008, 07:56AM
 User Offline
Registered Member #6071
Joined: Fri Feb 15 2008, 03:10PM

Posts: 22
Thanked 7 times in 4 posts
Sorry! I do not know C language. I use picbasic.
Regards
Back to top


sashijoseph
Sun Feb 17 2008, 10:10AM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 554
Thanked 124 times in 117 posts
@Norms
Can you explain your project in some detail(mainly the algo)....
As for the C program some things look suspect.....
CODE:
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?
CODE:
else if(volts_out==get_adc)

You haven't initialised get_adc,so you're in effect comparing volts_out to garbage.

Let there be music........
Back to top


norms
Mon Feb 18 2008, 01:14AM
 User Offline
Registered Member #6079
Joined: Sat Feb 16 2008, 12:34AM

Posts: 28
Thanked 0 times in 0 posts
volts_out is the value read from the output of the load... its not from the serial port... hehehe, i just want to show the computation so any man know how i get the 511 value... so is the program ok?
Back to top


sashijoseph
Mon Feb 18 2008, 09:24AM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 554
Thanked 124 times in 117 posts
Except for get_adc value rest seems ok.
btw what is the get_adc for?

Let there be music........
Back to top


norms
Tue Feb 19 2008, 02:24AM
 User Offline
Registered Member #6079
Joined: Sat Feb 16 2008, 12:34AM

Posts: 28
Thanked 0 times in 0 posts
its for getting the reading from the load... like the decimal value and as well as the digital value...
Back to top


norms
Thu Feb 21 2008, 10:56PM
 User Offline
Registered Member #6079
Joined: Sat Feb 16 2008, 12:34AM

Posts: 28
Thanked 0 times in 0 posts
heres my vb code: please and kindly check it. thanks

CODE:
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, 08:56AM ]
Back to top


Go to page  1 [2] 3 4  

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems