User Tools

Site Tools


doc:hardware:port.gpio
This wiki is read only and for archival purposes only. >>>>>>>>>> Please use the new OpenWrt wiki at https://openwrt.org/ <<<<<<<<<<

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:hardware:port.gpio [2017/08/16 14:39]
danitool [Finding GPIO pins (input) on the PCB]
doc:hardware:port.gpio [2017/09/18 18:43] (current)
tmomas
Line 8: Line 8:
  
 ===== Hardware ===== ===== Hardware =====
-GPIOs are commonly used in router devices for buttons or leds. They only safely supply or sink (pull to GND) a maximum of 4mA aprox., and the voltage is usually 3.3V when active. Only two states are posible: high or low. Depending on how a device is activated by a GPIO, active low or active high is defined.+GPIOs are commonly used in router devices for buttons or leds. They only safely supply or sink (pull to GND) a maximum of 4mA approx., and the voltage is usually 3.3V when active. Only two states are possible: high or low. Depending on how a device is activated by a GPIO, active low or active high is defined.
  
   * **Active high**: the device is activated when the GPIO is HIGH   * **Active high**: the device is activated when the GPIO is HIGH
Line 43: Line 43:
 Many times some GPIOs cannot be controlled by the kernel because they are multiplexed,​ and they are not acting as GPIOs. It might be possible to undo the multiplexing by writing some particular software programmable register settings, and then recover the GPIO functionality. But probably on most cases those GPIOs were multiplexed for some good reason, like using a [[doc/​hardware/​soc|SoC]] pin  for a signal on an ethernet phy, SPI, PCI, UART or another purpose. Many times some GPIOs cannot be controlled by the kernel because they are multiplexed,​ and they are not acting as GPIOs. It might be possible to undo the multiplexing by writing some particular software programmable register settings, and then recover the GPIO functionality. But probably on most cases those GPIOs were multiplexed for some good reason, like using a [[doc/​hardware/​soc|SoC]] pin  for a signal on an ethernet phy, SPI, PCI, UART or another purpose.
  
-  * Example 1: on the Broadcom BCM6328 SoC, GPIO pins 25, 26, 27 and 28 are used to indicate the LAN activity with hardware controlled LEDs. The memory register for setting this multiplexing is at 0x1000009C address, 64bits wide. Let's read it in Openwrt\\ ''<​color grey>​root@OpenWrt:/#​ devmem 0x1000009C 64+  * Example 1: on the Broadcom BCM6328 SoC, GPIO pins 25, 26, 27 and 28 are used to indicate the LAN activity with hardware controlled LEDs. The memory register for setting this multiplexing is at 0x1000009C address, 64bits wide. Let's read it in OpenWrt\\ ''<​color grey>​root@OpenWrt:/#​ devmem 0x1000009C 64
 0x0154000000000000</​color>''​\\ {{:​media:​doc:​hardware:​bcm6328-lan-led_pinmux-bits.png?​nolink|}}\\ These enabled bits are enabling every LAN LED to be controlled by hardware, therefore they cannot be controlled as regular GPIO'​s\\ ​ Let's disable this multiplexing for all LEDs\\ ''<​color grey>​root@OpenWrt:/#​ devmem 0x1000009C 64 0x0</​color>''​\\ Now we can export these GPIOs and control them via software. 0x0154000000000000</​color>''​\\ {{:​media:​doc:​hardware:​bcm6328-lan-led_pinmux-bits.png?​nolink|}}\\ These enabled bits are enabling every LAN LED to be controlled by hardware, therefore they cannot be controlled as regular GPIO'​s\\ ​ Let's disable this multiplexing for all LEDs\\ ''<​color grey>​root@OpenWrt:/#​ devmem 0x1000009C 64 0x0</​color>''​\\ Now we can export these GPIOs and control them via software.
  
doc/hardware/port.gpio.1502887179.txt.bz2 · Last modified: 2017/08/16 14:39 by danitool