GPIO, UART and SPI...

136 views
Skip to first unread message

nio

unread,
Aug 10, 2010, 4:39:14 PM8/10/10
to Technexion Thunderpack
Hello,

I've finally found some time to work with my thunderpack and my first
objective is to interface it to some basic hardware (uC, sensors...).

I've read the note on www.technexion.org regarding the GPIO, so I
downloaded the source tar, the SourceryG++ toolchain and crosscompiled
u-boot to enable CAM_D1 to be used as GPIO100, with thunder.h modified
like this :
MUX_VAL(CP(CAM_D1), (IEN | PTD | DIS | M4)) /*GPIO_100, NOT(CAM_D1)*/
\

I then booted the last binary image for the thunder and replaced the u-
boot.bin with my new_one. BTW, shouldn't be the source and the binary
from the same release ? The source is older, that could be
problematic, no ?

Seeing everything booted fine, i went to /sys/class and did this :
echo "100" > export
cd gpio100
echo "out" > direction
echo "1" > value
echo "0" > value

But the voltage on GPIO100 (==CAM_D1, pin 4 on the expansion header)
didn't reflect those changes...

Perhaps I should give a pin number to export, and not the GPIO
reference... Does anybody know where can I find this information ?

Another question : I found I2C3 and UART1 in the thunder.h, but not
SPI3, which yet seems to be exposed on the expansion header... is it
normal ?

Thanks in advance for your help !

Have fun.

Nicolas.

Karl RobinSod

unread,
Aug 11, 2010, 2:48:18 AM8/11/10
to technexion-...@googlegroups.com
Aha! I thought I was going mad :)

I spent several days trying to use D0, D1 and D2 as GPIO buttons (home, back & menu in Android). I tried the same mods as you in uBoot etc but only D0 appears to work.

In the end I gave up and used D5, D6, D7 and they work very well.
--
http://www.nicecupoftea.com/
http://www.biscuit.com/

nio

unread,
Aug 11, 2010, 5:30:49 AM8/11/10
to Technexion Thunderpack
Hello Karl,

Thanks for the info., but I could'nt use D0 nor D5...

- Did you use some specific option to recompile u-boot, or just told
omap3_thunder_config ?
- are you passing the GPIO number to sys/class ?

I tried that for CAM_D5/GPIO104 :
cd /sys/class
echo "104" > export
cd gpio104
echo "out" > direction
echo "0" > value
echo "1" > value
but the relevant pin #12 on the expansion header stayed at 0V all the
time.

I'm using the latest angstrom binary image from technexion.org, I just
replaced the u-boot.bin with mine enabling all the GPIOs.

Thanks!

Nicolas.

Greg Hamilton

unread,
Aug 3, 2011, 9:47:52 PM8/3/11
to technexion-...@googlegroups.com
I have been trying to use the CAM pins as GPIO. I am running Android. I have discovered two interesting things.

CAM_D0 and CAM_D1 (GPIO 99 and GPIO 100) are input only. The Technexion documentation does not indicate this but I have read a TI datasheet for the OMAP3530 which clearly shows that in Mode 4 these pins are input only, the remaining CAM_Dn pins are I/O.

The Linux kernel in the Technexion Android image for the Thunder board is compiled with "CONFIG_OMAP_MUX=y". This means the kernel configures the MUX overriding the config specified by u-boot. I've recompiled the kernel with "CONFIG_OMAP_MUX=n" and compiled u-boot to set the CAM_D0 - CAM_D7 pins to Mode 4.

Using /sys/class/gpio I'm able to export and interrogate the relevant GPIOs. I even have a switch and a couple of LEDs on a breadboard - I can read the switch and toggle the LEDs. Happy days.

Greg



nio

unread,
Aug 4, 2011, 2:39:57 AM8/4/11
to Technexion Thunderpack
Thanks for your answer, Greg!

I'll give it another try then...

Nicolas.
Reply all
Reply to author
Forward
0 new messages