Hi! I think that if you set the direction to output, set it "high" and read the state, the read should return "high". If you then do the same but set the state to "low", then the read should return "low". I would write a simple program that sets the pins to both states, reads the state after each change, and checks that the read state matches the written state for both high and low. The built-in test program won't work since it just displays an "X" on the pins that are set as outputs. When I say "read", I mean a function that reads the state of the pin, not the "read()" system call.
I can't guarantee it will work on the etrax, but I have successfully tried it on other microcontrollers. Or you can build a simple logic probe. I'm sure you know how, but here's what I did when I couldn't find my logic probe: Just take a resistor and put some heat shrink tubing or tape around one of the legs leaving a millimeter of the leg exposed (this is the probe end), and connect the other end to a LED. Then connect this led via a wire to one of the supply rails. (I think port A has symmetrical drive capacity, so it shouldn't matter if you connect the LED to vcc or gnd as long as you observe the polarity of the led.) Not pretty but it gets the job done. And don't skip the heat shrink/tape. Mr Murphy WILL interfere and give you a nasty short if you do. At least he did that to me one night :-(. And don't forget to change "CONFIG_ETRAX_PA_CHANGEABLE_DIR" and "CONFIG_ETRAX_PA_CHANGEABLE_BITS". If you don't, I don't think the driver will allow the application to change those IO-pins. (I'm not sure if this also applies to the gpio-syscalls). I needed some PB pins, so I disabled the DTR/RI/DSR/CD signals and changed the configs mentioned above, and it worked for me. I see no reason why it shouldn't work on PA. Regards /Tobias --- In [email protected], "Geert Vancompernolle" <[EMAIL PROTECTED]> wrote: > > Hi, > > When looking to the set-up of the FoxBoard, then one can see that with > the default settings only one pin is left for IO or interrupt purposes > on port PA. > > The rest of the pins are claimed to control the LED's, spy the switch > and also control ttyS2 (4 pins of PA are used for DTR, DSR, DCD and RI > signals). > > In the kernel configuration, I disabled serial port 2, since I don't > need this port. > > After recompiling the kernel, I saw during the boot process that ttyS2 > has indeed disappeared. > > I assume the 4 pins of PA have become available now as IO again. > > How can this easily be tested just to be sure I can use them as IO or > interrupt again? > > Best rgds, > > --Geert >
