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

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.
begin:vcard 
n:Weilhartner;Stefan
tel;cell:+43 664 3106170
tel;fax:+43 732 771111-111
tel;home:+43 664 3106170
tel;work:+43 664 3106170
x-mozilla-html:FALSE
url:www.eins.com
org:EINS - Einführung integrierter EDV-Systeme
version:2.1
email;internet:WhyLee@xxxxxxx.com
title:Systemadministrator
adr;quoted-printable:;;Gruberstrasse 2-4;Linz;Oberösterreich;4020;=D6sterreich
fn:Weilhartner Stefan
end:vcard