#Power supply to the USB port on Terra board

<span class="abstract">
This article illustrates how to control the power supply on Terra USB host ports.
</span>

Each USB port can shutdown independently via GPIO lines. This is very useful to recover freeze conditions of any USB devices. 

The lines used to USB power control are:

| Aria G25 pad | Atmel line | Kernel ID | Description                |
|--------------|------------|-----------|----------------------------|
| N7           | PC5        | 101       | Power control of **USB A** (1=ON) |
| N8           | PC6        | 102       | Power control of **USB B** (1=ON) |
| N9           | PC7        | 103       | Power control of **USB C** (1=ON) |

At startup all the power lines are set to ON.

A green led for any USB port indicates the current USB power line state:

![](usb_power_led.jpg) 

##Code examples

* USB line power control. This example simple turn on and off each USB power line 
each second: @pg='python/terra/usb_power.py' 

#Related link

* [TERRA-M schematic](http://terzo.acmesystems.it/downloadschematics/schematic_terra.pdf)
* [MAX1564 Triple 1.2A USB power switch datasheet](http://terzo.acmesystems.it/download/datasheets/MAX1564.pdf)

#Buy

* [Evaluation kit](/catalog_kit)
* [Single parts](/catalog_terra)

@shop='TERRA-M'





