Re: LPT square wave




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

.



Relevant Pages

  • Re: testbench for a microprocessor
    ... ENTITY mp IS PORT ( ... Clock: IN STD_LOGIC; ... -- control signals ... MemWr: OUT STD_LOGIC; ...
    (comp.lang.vhdl)
  • Re: SPI on the User Port ... Mode Hang-Ups.
    ... hard pressed to give up their RS232 port for this, ... Ethernet cart, or they have a cardreader on a PC/Linux box on the net ... registers between an SPI interface and a RS-232C interface, ...
    (comp.sys.cbm)
  • Re: Stateful Packet Inspection Firewall
    ... you need a router with NAT to establish multiple machines to use one public ... An SPI firewall will help to keep out hackers/crackers and you will ... not application based but port based. ...
    (comp.security.firewalls)
  • no clock signals found ... xilinx ise
    ... I have a top level design with a clock ... Masters Student in Electrical/Computer Engineering ... CAVIS Office Phone: ...
    (comp.lang.vhdl)
  • Re: EPROM to RS232
    ... If you can deal with a parallel port, ... provides signals at 5V. ... One problem is that using a 555 for the clock is going to be tricky, ... the counters to address the EPROM. ...
    (sci.electronics.basics)