[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problems using I/O-pins on par0



Hi!

The problem might be that the parallell port driver is enabled 
and conflicts with your code. Try to disable the parallel 
support in kernelconfig and rebuild your kernel.

Regads,
/Mikael

-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Stefan Weilhartner
Sent: Sunday, January 07, 2001 6:07 AM
To: dev-etrax
Subject: Problems using I/O-pins on par0


If i use this code for getting a approximately 100Hz-Output:

for (i=0;i<10000;i++)
{
  *R_PAR0_CONFIG=0x00000060;  // Initialise manual mode
  *R_PAR0_CTRL_DATA=0x001000ff; // Set output on D0-D7 to High
  *R_PAR0_CONFIG=0x00000060;  // Initialise manual mode
  *R_PAR0_CTRL_DATA=0x00100000; // Set output on D0-D7 to Low
}

it works cause initialisation of the manual mode takes very long.

But if i use this code:

*R_PAR0_CONFIG=0x00000060;  // Initialise manual mode
for (i=0;i<10000;i++)
{
  *R_PAR0_CTRL_DATA=0x001000ff; // Set output on D0-D7 to High
  udelay(200);
  *R_PAR0_CTRL_DATA=0x00100000; // Set output on D0-D7 to Low
  udelay(200);
}

no signal comes out!?

Why? Is there a task (kernel) running in the background whitch
manipulates the R_PAR0_CONFIG-Register?
Why does using the R_PAR0_CONFIG-Register takes so long (about 1000ms to
0,01sec)??

Is it too illigal to use the registers to control the I/O-Ports?
Should I use a device? (/dev/lp0 or /dev/gpioa)

The background is a very simple one: I want to use some pins from par0
for output ( LEDs etc) and
some pins from par0 for input (Switches etc)

Does somebody knows why my solution above doesn't work?
And what should I use instead?

Any help would be great, thanks!

C.U.,
    Weilhartner Stefan.