Re: LPT square wave
- From: "Leon" <leon.heller@xxxxxxxxxxxxxxx>
- Date: 3 Oct 2006 12:34:52 -0700
rpodraza@xxxxxxxxx wrote:
Hi,
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;
}
Generating SPI with software using the PC printer port is quite easy,
just follow the timing diagram. The clock doesn't have to be a
conventional square wave, just drive it high and low at the correct
time with the data line held high or low. Connecting a 74HC595 with
LEDs on the outputs to the printer port can be useful when debugging
the software, the 74HC595 is SPI-compatible and makes it easy to see
when you have got it right. I have one mounted on a small PCB with the
LEDs.
Leon
.
- Follow-Ups:
- Re: LPT square wave
- From: docent
- Re: LPT square wave
- References:
- LPT square wave
- From: rpodraza
- LPT square wave
- Prev by Date: Re: terrifying
- Next by Date: Re: Voltage regulator instability
- Previous by thread: Re: LPT square wave
- Next by thread: Re: LPT square wave
- Index(es):
Relevant Pages
|