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.

How to create a square wave on LPT port

Status
Not open for further replies.

vibrasphere

Newbie level 3
Newbie level 3
Joined
Sep 20, 2006
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
I'm trying to write a program in C++ to communicate with an AVR microcontroller's SPI via the LPT port.

I have to generate a clock (SCK) signal on one of the pins of the LPT. I am using the WinIO library. I'd like to have way to create a square wave of a given frequency (within some limit of course).

My question is: what is the best way to generate such signal and what is the maximum frequency one can obtain? Excluding of course such code:
Code:
 for (;;) { 
    pin = 0; pin = 1;
}
 

Re: LPT + Square Wave

take into consideration the dirextion of the port u r using.
For LPT port, u have to setup the port mode in the Motherboard setup section. Use the (Standard) port type as it will set the data port to O/P by default. This port is located at pins (2,3,...,8,9) in the DB25F parallel port, which corresponds to (D0, D1, ..., D7, D8) bits directly.
 

Re: LPT + Square Wave

I think it is possible to produce some kHz square wave on LPT. It also heavily depends on driver used. Old DOS aplications, that can directly access LPT, are faster.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top