Hi,
I am trying to program the SDIO controller for MMC and in my embedded device documentation it there is a GPIO 16 bit port which has pins 10,9,8,7 for SDATA3,SDATA2,SDATA1,SDATA0 and 6 & 5 for SDCMD and SDCLK. I am not able to understand what's the use of these pins. Is this how my SD controller is wired and I don't have to worry about these pins except not use these pins?
Thanks.
Confusion regarding GPIO pins.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Confusion regarding GPIO pins.
More context needed: what's the exact board you are using? what is physically connected to what on that board?
Several controllers out there have a general choice of input/output ports which means you can program into on/off/tri-state/read modes. On many such controllers, some ports double with some specific purpose: a port may instead of general configuration also be connected to a FIFO for serial communication, it may be connected to a DAC or ADC, or in this case, a SD host controller may be optionally using a set of ports (since the ports are both labeled as SD* and GPIO). Try to see if you can find something about enabling/disabling the SD controller or its control over that port range.
That said, if you are using a set of ports in the general-purpose mode when there's an actual SD slot (especially with card inserted) then things will strangely break when the other end starts talking back.
Several controllers out there have a general choice of input/output ports which means you can program into on/off/tri-state/read modes. On many such controllers, some ports double with some specific purpose: a port may instead of general configuration also be connected to a FIFO for serial communication, it may be connected to a DAC or ADC, or in this case, a SD host controller may be optionally using a set of ports (since the ports are both labeled as SD* and GPIO). Try to see if you can find something about enabling/disabling the SD controller or its control over that port range.
That said, if you are using a set of ports in the general-purpose mode when there's an actual SD slot (especially with card inserted) then things will strangely break when the other end starts talking back.
-
- Member
- Posts: 42
- Joined: Thu Jan 13, 2011 3:33 pm
Re: Confusion regarding GPIO pins.
Its a mini2440 board (http://www.friendlyarm.net/products/mini2440) . How can I check what is physically connected? The schematics here http://www.friendlyarm.net/downloads does not show or I might not have understood the connections between SD and GPIO pins.More context needed: what's the exact board you are using? what is physically connected to what on that board?
I have read that gpio pins are used for card detection. Also sometimes a router which does not have a SD card reader can be connected to these pins but I think it would be spare GPIO pins and not these pins which are already used.
I would not be using it for general purpose. I want to know why they doubled it as GPIO when it is used exclusively as SD. Can I disable the SD card and then use GPIO for general purpose? Also in the normal SD operation is it useful to read these pins? If yes what can I do with it?That said, if you are using a set of ports in the general-purpose mode when there's an actual SD slot (especially with card inserted) then things will strangely break when the other end starts talking back.
The Ben Nanonote(http://en.qi-hardware.com/wiki/Hardware-Ben#GPIO_pins ) is very similar and it too uses the same config.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Confusion regarding GPIO pins.
It's not exclusive use: not all users of that chip need an SD slot attached. In those cases they can use those pins for some "general purpose" task. Your board's designer apparently decided that Joe Random Hacker would rather have the SD slot than some more GPIO pins.mindentropy wrote:I want to know why they doubled it as GPIO when it is used exclusively as SD.
I'm not familiar with the electric specifications of SD cards and such, so you might be able to revert the SD pins to their GPIO state if and only if there's no SD card inserted (because it will talk otherwise and screw up your signals or even fry something). In any case, I have little to add to what berkus said: there are manuals to be read.