So I was wondering if its possible to use a single voltage regulator (with one input and one output) to power two usb ports? Or would I need two voltage regulators to this. The voltage regulator takes in 12V and outputs 1.5A at 5v.Both my usb ports require .5A @ 5V. I will be using TI ptn78060w. This is my first electronics projects and im still trying to get the hang of all this. Any help is greatly appreciates or any book recommendation to help me understand power would be great.
Use of common power supply for ALL USB ports in a host/hub design is very common practice. This type of power distribution is called "ganged" power, and is used in vast majority of PC desktop mainboards. The USB ports don't have to have power protection or current limiting, the limiting and corresponding overcurrent reporting is optional. USB specs says (Section 7.2.1 of USB 2.0 base specification) that ports MUST SUPPLY AT LEAST five units of load (one unit = 100 mA for USB2, and 150 mA for USB3), which means no upper limit. However, to avoid potential overloading of connectors and internal system components it is wise to limit the current at the source, using either high-side power switches or simple resettable polyfuses.
One thing, however, is a must: the power distribution network between ports must be decoupled to a certain degree. The reason is to protect already connected and working port from power glitches related to hot-plug of another USB device. This effect is called "droop" in USB terminology. USB specification mandate that the droop on an already functional port shouldn't be more than 330 mV when a standard load of 10 uF ( in || 44 OHms) is connected to an adjacent USB port. It is called "droop test". The proper de-coupling is usually achieved with trace separation, placing ferrite beads, and individual port bypass caps (47 - 100 uF) close to each port VBUS pin.
For recommendations of component placing and board routing, look up reference designs of USB hubs, say, on MICROCHIP.COM
Yes, if you have two 500mA loads you can power them from a single PTN78060W which can supply up to 3A (3000mA). If this is for a product and you want USB compliance (so you can use the USB logo), or you just want to engineer things better you should look at protected USB load switches like the two port TPS2052C, or at least use a PTC thermistor on each power output. Note that some devices require resistors on D+/D- to signal the available charging current, although most devices default to 500mA without these resistors.