Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need 150hz square wave(50% duty) on parallel port in vb

Status
Not open for further replies.

vijayragavalu

Member level 1
Member level 1
Joined
Aug 29, 2005
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,558
square wave parallel port

hello guys
i would like to inetrface parallel port to my driving circuit(SCR).for that i need 150hz square wave with 50% duty cycle in digital data lines.In vb i tried to make the same but i was not able to make 150hz in parallel port. instead i am getting only 32 hz. i used both sleep and timer routines in vb. though i passed correct ms in parameters in function,i couldnt make 150 hz cycle
i tried same in vc++,c . i got same 32 hz only i dont know what was wrong on that
can any one suggest me to over come the problem.
i am using normal LPT(0x378) what about EPP is it give any probs(above)
 

vb square wave

I am assuming you are working on Windows.

The sleep and timer routines do not give enough precision to get down to 150 Hz because the they are based on a time interrupt which occurs approximately once every 40 or 60 ms or so. In fact the normal timers are not very precise in windows and are low priority messages that windows doesn't process immediately.

You should probably use QueryPerformanceCounter and QueryPerformanceFrequency to make a high resolution timer on windows. Check out

https://msdn.microsoft.com/library/...nui/windowsuserinterface/windowing/timers.asp

I haven't used it myself, but I've read about it. I would probably use a frequency generator or a microcontroller.

-jonathan
 

square wave on parallel port

Another method ...

In modern Windows you can usually increase the timer interrupt resolution to 1.0ms, but unfortunately that value doesn't multiply cleanly to give 6.667ms period required for 150Hz.

To set the timer resolution and start a timer interrupt callback, use Win32 functions timeBeginPeriod and timeSetEvent. When you are done, use timeKillEvent and timeEndPeriod.
 

thank you all
i will check out above link and ask u if any doubt. pls help me out

Added after 1 hours 39 minutes:

hello jonathan
thnx for ur suggestion but i think this timer link would be a VC++ related one.but i need VB timers other than sleep and timer components. can u pls send me VB code to gen 150hz on LPT
and what is EPP,ECP port are there any differents
bt normol one and EPP,ECP.

Added after 8 minutes:

hello echo47
thanx for ur suggetion and my problem is when i pass 6ms to sleep instruction i get only 32hz . if pass
50ms to sleep ins i get exact frequency(1/50ms) 20hz that is if i pass parameter above 30ms to sleep instruction i am getting exact frequency wave . but below 30ms i am getting only 32hz(1/30ms) i dont know what was the problem. can u pls give solution to the problem.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top