more information we need pls. add more explanation,
I think pulsein command acn help you, try it or explain it completely
more information we need pls. add more explanation,
I think pulsein command acn help you, try it or explain it completely
Electrical & Electronic Engineering
Undergraduate Student
HII !!!
Look,my friend.I need make next :
I must have interface with PIC16F84,and also he must connect with my PC.With any terminal program,I need to send decimal number,like 10 or 15 etc. to interface.With interface,I need 8 electrome chanical counters (he works with 12 V DC).For Examples:If I send A10 or another number,PIC must count with first counter 10 impulses.Or If I sent H10, eight counter must count 10 impulses.The A...,B...,C...,D...,E...,F...,G... anh H... is name of counter or his address.
That is my problems and I must find solution for this interface.
Thank you for any help
Best reguards
Miro245
first you need to know how to communicate with pc using serial port, I have a laptop pc and it has no serial port so I dont know how to use serial port.
but you can search on this foorum,there are lots of examples about it.
you can send A10 or C10 to the pic with serial port, and the pic will select the counter according to the info that you send.
And to understand when the counter finish count, you should find a solution.
Does it informs you when it finish counting?
Electrical & Electronic Engineering
Undergraduate Student
Well here's 75% of your project complete...
http://www.picbasic.co.uk/forum/showthread.php?t=573
The other 25% is down to you...
Yes,I have NOTEBOOK and adapter USB to RS232.You are rihgt.But,First or other counter port out work diferents than another.Any counter received yours decimal number and work counting.In second solution,if I (examples) send to first counter A10 and he started counting,and in next moment I send second A20,he must make sum nad continue counts to finish.Other works like first..
Thank tou for yours help
Miro245
Thank you for you help.But,I have one question for you.If you send that one led blinks (examples) 15 second.He started,and in moment you send 10 plus.Is led blink countinius blinking 25 second???Is programs make sum like 15+10 seconds.???
Thank you once gain
Miro245
Miro245, for activating your electro-mechanical device (counter) you will need to put the pic pin connected to it high for few milliseconds than low again, in doing so you will obtain one count. So the sub routine for activating counter A could be as follow:
Now let's assume you will send via RS232 a command A10 pic will receive the command and will decode it. It will read address "A", it will load 10 in the variable "ValueReceived" and it will gosub "LabelA" (since address was "A").Code:Label_A: For A0=1 to ValueReceived HIGH Pin_x Pause 100 LOW Pin_x Pause 100 Next A0 return
Now the pic will make your electro-mechanical device counting up to ten, but since it is very slow pic will take two seconds to complete the job (100 millisecs + 100 millisecs x 10)
You have to understand that during this two seconds you cannot send anything to your 16F84 because otherwise it will be lost, since the pic is busy to make your electromechanical device counting.
One solution is that you wait for an answer from the pic telling you that the job has been completed and now it is still listening. To do that is pretty simple,
at the end of the count you will activate the following code:
When your PC receive the word "done" you know that pic is available for receiving a new command, and you can send it. Now suppose you send A20Code:SEROUT Pin_y,baudrate,["done"]
pic will do the same work already explained above, but it will count 20 and it will take twice the time (4 seconds). Your electro-mechanical counter was recording 10 (the previous command) so at the end of the second command it will record 30 (10 + 20 "additive capability of the device).
Pin_x and Pin_y are pic pins of your choise.
Hope this will help you in completing your project.
Al.
All progress began with an idea
I suggest you to use ULN2803 instead.I use IC driver ULN2804.
Al.
All progress began with an idea
Bookmarks