Profile cover photo
Profile photo
Carlos Paixão
O melhor filme que já ví, as nossas vidas!
O melhor filme que já ví, as nossas vidas!

Carlos's posts

Post has shared content
Qual foi o resultado que uma empresa obteve ao decidir trabalhar apenas 5 horas por dia?
"I moved my whole company to a five-hour workday where everyone works from 8 a.m. to 1 p.m."

Post has shared content

Post has shared content

Post has shared content
Nova operadora para IoT é lançada no Brasil e no mundo
Things Mobile, a primeira operadora móvel destinada à Internet das Coisas, representa mais um avanço em inovação no setor. Antes da grande novidade, responda: você já ouviu falar em  Internet das Coisas  (IoT)? Basicamente, o termo diz respeito a uma tecnol...

Post has shared content
Simba Content contra ex-diretor da SKY
Joint-venture formada por Record, SBT e RedeTV contratou o ex-presidente da Sky para ajudar nas negociações com as operadoras de televisão. A Simba Content , joint-venture formada pelas emissoras SBT, RecordTV e RedeTV! , contratou Ricardo Miranda Silva, ex...

Post has shared content
Celulares 'xing ling' devem ser bloqueados pela Anatel em outubro
Donos de celulares piratas começarão a ser avisados do bloqueio a partir de 30 de julho. A Agência Nacional de Telecomunicações (Anatel), anunciou que, a partir de outubro , serão bloqueados os celulares que não tenham certificação do órgão e IMEI válidos. ...

Post has shared content
With Udemy, you pay for every course. With SitePoint, you pay once and gain access to their whole library of coding courses. #Deals #News #OnlineCourses

Post has attachment

Post has shared content
USB Type C’s Configuration Channel

I’ve been getting questions about why certain kinds of USB adapters or cables work to charge new Type-C devices, and why other adapters are necessary to charge legacy devices from Type-C chargers.

This post will explain why, and will do a deeper dive into Type-C’s Configuration Channel (CC).

USB Type-A and Type-B
But first, I will start out with a description of how USB worked before Type-C so that we all understand some of the basic concepts.

USB cables are directional, meaning that each end of a cable has physically different plug: Type-A plug (the rectangular port and plug we find on our PCs, hubs, and chargers), and a Type-B plug (the squareish plug, or the smaller mini-B and much more common micro-B variants).

USB systems always form a tree based structure with a single USB host at the root (typically your PC), and one or more devices as leaves. USB was designed this way for simplicity. Hubs always have exactly one Type-B port and one or more Type-A ports. Devices by definition only have one Type-B port. Type-A plugs always plug into something that is closer to the root, or in other words Type-A plugs point “upstream.” Type-B plugs always plug into something that is further away from the root, or in other words Type-B plugs point “downstream.”

This architecture prevents problematic loops that are possible with other systems that have the non-directional cables, for example, Ethernet. A user simply cannot set up an incorrect USB tree by virtue of the physically different plugs and connectors.

Enter Type-C and CC
Type-C does not just replace one of the two classic USB connectors. It replaces both A and B types, making completely symmetrical and reversible Type-C cables possible. This does beg the question though: Does this mean that since the connectors and the plugs are physically identical that the tree structure of USB is no longer enforced?

The answer is no. USB Type-C systems still maintain the same tree structure as before with one USB host and one or many USB devices. Instead of a physically different connector and plug to signify the direction of data and power, USB Type-C devices now indicate their roles electrically through a brand new mechanism: the Configuration Channel or CC.

Each USB Type-C port has 2 CC pins, oriented in such a way that when you flip the cable over the the CC pin in the cable plug always land on one of the two CC pins. Each cable only has one CC wire.

The new USB specification defines a new set of terminology to represent different ports, now that both types of ports are now share the same formfactor:
* “Type-A” ports become Downstream Facing Ports (DFP)
* “Type-B” ports become Upstream Facing Ports (UFP)

A resistor is placed on CC to mark whether a Type-C port is a DFP or a UFP:
* DFP uses an Rp, or a pull-up resistor between CC and 5V (not Vbus, as Vbus may change using PD)
* UFP uses an Rd, or a pull-down resistor between CC and Gnd

When a DFP (usb host) is connected to a UFP (usb device) by means of a cable, the CC on both sides are connected together, and the shared CC line has both a pull-up and a pull-down on it. Both sides read the voltage on this line and can recognize that a connection has just been made when the voltage becomes a predictable value.

There’s more! The CC lines are also how Type-C implements connector “flip”ability or cable twist. Remember I noted that there are actually two CC pins in the Type-C receptacle. Each Type-C cable and plug of any kind has just one CC pin. By monitoring the voltage on both CCs, a host or device can figure out which orientation the cable is in and route the other wires appropriately. The side that forms the Rp/Rd resistor divider is the "up" side.

Legacy cables and adapters
CC works great when you have all Type-C cables and ports, but Type-A hosts and Type-B devices will still exist. Type-A and Type-B ports and plugs do not have the new CC line, but what happens when you try to connect a Type-A host or Type-B device to a Type-C host/device?

The cables and adapters themselves must provide the proper CC pullup or pulldown in lieu of the Type-A or Type-B port that is missing the CC pin. Here are the two classes of cables :

* Legacy Host Port Adapter - Standard-A plug or Micro-B receptacle on one end - Requires a 56kΩ pullup from CC to Vbus
* Legacy Device Port Adapter - Micro-B plug, or Standard-A receptacle, or Standard B plug on one end - Requires a 5.1kΩ pulldown from CC to Gnd.

Many people ask me if “OTG” adapters are allowed in USB Type-C, and the answer I always give is that “OTG”, an older USB standard that allowed for devices to swap roles, doesn’t apply to USB Type-C, and that the adapter they are probably looking for is the Legacy Device Port adapter above that goes to a Standard-A receptacle for a USB flash drive, for example.

An example of a Legacy Host Port adapter for sale is this A-to-C cable from Google:
An example of a Legacy Device Port adapter for sale is this A-port-to-C adapter from Google:
So, the Type-C legacy cables that you can buy on the market today have (or at least are supposed to have) the correct resistor such that their roles are always fixed.

On Legacy Host Port Adapters, power and data always flow toward the Type-C plug.
*On Legacy Device Port Adapters, power and data always flow from the Type-C plug.

This also answers the question that some have asked why they can’t simply chain together a clever series of adapters and non-compliant cables and hope it will charge their phone.

This leads to the topic that I’ve been quite vocal about in my Amazon reviews, which is power. The original USB port provided 500mA at 5V, or 2.5W of power. Ever since USB micro-B became the near universal standard for cell phone and other handheld device charging (thanks, Europe!) there’s been an arms race to increase the power that a USB charger or port can provide over the same wire to a device.

In the past decade, the USB-IF and other 3rd parties (most notably Apple) have responded by creating protocols that allow for chargers to deliver higher currents over the same wire to supported devices. They do this by signaling over USB’s data lines (D+ and D-). Chargers that support USB’s Battery Charging 1.2 specification may support up to 1.5A, while Apple’s protocols allow for 1A, 2A, and 2.4A levels.

With the USB Type-C specification, the requirements are beefed up so that every cable must be able to support 3A, however, that doesn’t mean that 3A is possible in every situation : the charger or power source must still be able to provide it, which is where CC comes in.

Remember before that every DFP (Downstream Facing Port or Host port) must use an Rp to identify itself as a DFP. The USB Type-C specification actually uses different values of resistance of Rp in order to allow the DFP to advertise its supply capabilities:

Default USB Power - 56kΩ pullup
* 1.5A - 22kΩ pullup
* 3.0A - 10kΩ pullup

The bottom two modes are only allowed on non-legacy USB Type-C ports and cables, and only if the power supply has satisfied the electrical requirements to meet a 1.5A or 3.0A load. Under no circumstances may Legacy cables use 1.5A or 3.0A advertisements.

Legacy cables must use “Default USB Power” which at a minimum, means that it restricts it to 500mA for USB 2.0 or 900mA for USB 3.1. However, “Default USB Power” still allows for the negotiation on USB’s data lines D+ and D- using all of the protocols that would have worked on USB A-to-Micro-B cables, meaning that a Default USB Power legacy cable should be able to provide from 500mA to 2.4A of charging.

The specification allows a Type-C DFP power source to actually modify the Rp value in response to changing conditions.

For example, a 3A charger may be built with two USB Type-C ports. When one device is plugged in, it should advertise to that device a 10kΩ pullup to tell it that it can draw 3A. When a second Type-C device arrives, the charger can change the Rp on the first port to 22kΩ to tell it that it can only draw 1.5A. The second port may also be given a 22kΩ Rp, balancing the loads evenly across both ports.

When one of the devices is detached, the charger could even recognize that it's back down to 1 consumer, and give that port back its 10kΩ pullup, allowing it to draw 3A again.

Conclusion and Much More
USB Type-C’s configuration channel provides a ton of functionality. To summarize :
* Determines role, Host Vs. Device
* Determines when devices are attached to host
* Determines orientation, allowing for Type-C’s “flipability”
* Negotiates up to 3A power between charger and device.

There’s actually MUCH more that CC does, specifically, the configuration channel is integral for USB Power Delivery, a protocol that allows for much more robust, flexible and complex communication between both sides, and for Alternate Mode too…

Just as a preview for next time, CC, PD, and Alt Mode allow for :
 *Negotiated higher voltage and current, up to 20V, 5A for 100W of power
 * Power role switching, so your hub powers your laptop, instead of the other way around
 * Data role switching
 * Alt mode, so you can use your USB cable to display video, or much much more.

See you next time!

#USB   #TypeC   #USBC

EDIT : Added more clarification around cable twist. There are 2 CCs in the diagram here. This figure I've attached is the pin assignments for the receptacle not the plug. The plug only has 1 CC line at A5, and Vconn at B5.

EDIT2 : Small correction around Rp pullup on a Type-C port. Pulled up to 5V, not Vbus.

Post has shared content
Xiaomi opens second factory in India. Meanwhile, in Brazil...
Xiaomi announced that it has opened a second production plant in India. The company can now produce one smartphone every second during operational hours. #India #News #Xiaomi
Wait while more posts are being loaded