Hi,
Are you trying to access the registers from a userspace application?
This is not allowed by the kernel. Normally you would put such code
in a kernel driver or module. If really necessary it is possible to
allow such accesses but in most cases it would be a bad idea (since
the userspace application may screw up the system by writing to
the ETRAX hardware registers).
/Mikael
-----Original Message-----
From: Dave Rovner [mailto:david.rovner1@xxxxxxx.net]
Sent: Friday, November 22, 2002 4:13 AM
To: Mikael Starvik; dev-etrax
Subject: RE: using parapin freeware on etrax100lx
OK, thanks - solved my design issues. Now I have implementation issues. I
found the R_PAR0* register addresses in your designer's reference (chapter
19). According to it, the base address is 0xB0000044 for R_PAR0_CONFIG.
However when I try to write to that address, I get a Segmentation fault. is
there a special procedure to perform before I write out to the registers at
this address?
Dave
-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Mikael Starvik
Sent: Thursday, November 21, 2002 7:08 AM
To: 'Dave Rovner'; dev-etrax
Subject: RE: using parapin freeware on etrax100lx
You have to remember the last state.
-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Dave Rovner
Sent: Thursday, November 21, 2002 12:35 PM
To: Mikael Starvik; dev-etrax
Subject: RE: using parapin freeware on etrax100lx
OK, in this case, how do I write a one to the seli bit in the register,
without affecting the state of the other bits? Do I need to maintain the
last state and re-write the other bits, or is there a simpler way (through
asm)?
Dave
-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Mikael Starvik
Sent: Thursday, November 21, 2002 6:42 AM
To: 'Dave Rovner'; dev-etrax
Subject: RE: using parapin freeware on etrax100lx
>Just so its clear to me, If I want to turn the seli on and then off and
then
>on and so on, can I just write 1, 0, 1, and so on to the seli bit?
Yes
>And if I disable the data buffer for output, does the data buffer for input
>become enabled automatically?
Yes
-----Original Message-----
From: Dave Rovner [mailto:david.rovner1@xxxxxxx.net]
Sent: Thursday, November 21, 2002 12:16 PM
To: Mikael Starvik; dev-etrax
Subject: RE: using parapin freeware on etrax100lx
Just so its clear to me, If I want to turn the seli on and then off and then
on and so on, can I just write 1, 0, 1, and so on to the seli bit?
And if I disable the data buffer for output, does the data buffer for input
become enabled automatically?
TIA,
Dave
-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Mikael Starvik
Sent: Thursday, November 21, 2002 1:53 AM
To: 'Dave Rovner'; 'Mikael Starvik'; dev-etrax
Subject: RE: using parapin freeware on etrax100lx
>Does this also disable/enable the data buffer for input?
Yes
>Also, I need to know how to toggle the seli (p0selectin bit) - the
>description is unclear whether I need to also invert the signal (using the
>R_PAR0_CONFIG iseli bit 24); or can I just write a 0 to the seli bit.
On the developer board there is an inverter on the board between
the ETRAX and the parallel port connector (for lp0). You can
compensate for this inverter by enabling inversion in ETRAX
through R_PAR0_CONFIG. My suggestion is that you write the
code and test if seli has the correct polarity, if not you
can invert it through R_PAR0_CONFIG.
/Mikael
-----Original Message-----
From: Dave Rovner [mailto:david.rovner1@xxxxxxx.net]
Sent: Thursday, November 21, 2002 4:10 AM
To: Mikael Starvik; dev-etrax
Subject: RE: using parapin freeware on etrax100lx
I'm considering using the PAR0 registers directly. Basically, I need the
data pins (i/o), the strobe (as output), and the select line (as output).
Looking at the Designer's reference(chapter 19), I'm not sure the proper
method to switch the data buffers from input to output. The "oe" bit on the
R_PAR0_CTRL_DATA register claims to enable/disable data buffer output. Does
this also disable/enable the data buffer for input? If not, what is the
propoer method (without using interrupts)?
Also, I need to know how to toggle the seli (p0selectin bit) - the
description is unclear whether I need to also invert the signal (using the
R_PAR0_CONFIG iseli bit 24); or can I just write a 0 to the seli bit.
TIA,
Dave
-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Mikael Starvik
Sent: Tuesday, November 19, 2002 10:06 AM
To: 'Dave Rovner'; dev-etrax
Subject: RE: using parapin freeware on etrax100lx
ETRAX does not have I/O mapped devices like e.g. i386 and hence
no inb/outb. The latest version of the gpio driver
(arch/cris/drivers/gpio) lets you manipulate parallel port pins
with ioctls. The parallel port driver framework may also have
som application to do this but I am not sure about that.
/Mikael
-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Dave Rovner
Sent: Tuesday, November 19, 2002 12:19 PM
To: dev-etrax
Subject: using parapin freeware on etrax100lx
Hello,
I am porting a linux application which uses the parapin freeware (controls
parallel port pins individually as i/o) to the etrax100lx. In order to
compile using cris, I need inb() and outb() functions, put I can't find
them, or the headers that include the prototypes. Any help with this, or
other suggestion on using a different method to control the parallel port
i/o pins. Prefer to use the current parapin code to minimize time.
TIA,
Dave Rovner
ACT1, Inc