Skip to content

Stm32f4 Pin Assignment Of Rj11

6 pin RJ11, RJ14, RJ25 female connector at the phone and wallet socket (Jack).

6 pin RJ11, RJ14, RJ25 male connector at the cable (Plug).

The six-position plug and jack commonly used for telephone line connections may be used for RJ11, RJ14 or even RJ25, all of which are actually names of interface standards that use this physical connector. The RJ11 standard dictates a 2-wire connection, while RJ14 uses a 4-wire configuration, and RJ25 uses all six wires. The RJ abbreviations, though, only pertain to the wiring of the jack (hence the name “registered jack”); it is commonplace but not strictly correct to refer to an unwired plug connector by any of these names. Typically you’ll find the RJ-11 and RJ-14 on your Plain Old Telephone Service (POTS) though your RJ25 typically is found in an Integrated Services Digital Network (ISDN) Line. It is the communication standards that lets telephone lines to carry digital, voice, video, and network services.

Notes

  • While the old solid color code was well established for pairs 1 and 2, there are several conflicting conventions for pair 3. The colors shown above were taken from a vendor of “silver satin” flat 8-conductor phone cable that claims to be standard. Other 3 pair solid (old) bellwire cables may substitute white for orange. At least one other vendor of flat 8-conductor cable uses the sequence blue, orange, black, red, green, yellow, brown and white/slate.
  • Holding the connector in your hand tab side down with the cable opening toward you, the pins are numbered 1-6, left to right.
  • In modern structured wiring Cat5e or Cat6 is commonly used in homes and buildings. The Cat 5e and Cat 6 data lines are often used for both voice or data. The color codes above are the standard and defined within wiring guides.
  • The CAT 3 Cable can also be used for the RJ-14 Pinout with the same color code as the CAT5 and CAT6. The internal pairs to the pinout are trasmit and recieve (1 and 1), while the 2 side pairs (2 and 2) are your power.
  • The RJ25 is going to be the standardized phone cable for your ISDN (Integrated Services Digital Network) it allows phones such as the (STE) to carry digital, voice, video, and network services. Though there is an RJ45 port connection, you can implement the RJ25 to push all information if the Port has the proper configurations at the switch. For an RJ25 you’ll need to use CAT5 or CAT6 since a CAT3 is only a 4 wire cable.

References and Sources

Category:Networking Connectors

The STM32 F4 Discovery board is currently our board of choice for demonstrations and training at Rapita Systems. Here I will explain why we chose it and demonstrate how to set the STM32 F4 Discovery up as an output port without using ST libraries.

Why we chose the STM32 F4 Discovery

It has a suitable amount of constraints to enable us to show how we get round some of the problems of on-target verification on embedded systems, without being too tricky and at a very agreeable price.

How we use the STM32 F4 Discovery

At Rapita, our main interest in writing to output ports of microcontrollers is to provide an efficient means of measuring code execution times or code coverage (via our RapiTime or RapiCover tools – both part of RVS).

To demonstrate data capture using the RTBx (100MHz) or RTBx mini (24MHz) we want to set up the output port so we have strong signals on output pins. Here is an example implementation for setting the first 8 pins of port B as outputs:

{ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_Init(GPIOB,&GPIO_InitStructure); }

This is fairly simple, but relies entirely on the firmware Libraries for the board that can be downloaded from the ST website here: http://www.st.com/internet/evalboard/product/252419.jsp. So I'm going to explain what each part of this code snippet does and show you how to achieve the same thing manually without the ST libraries.

Setting the STM32 F4 Discovery up without using libraries

For power consumption efficiency the peripheral clock is gated for most peripherals on the device. So, the first call to RCC_AHB1PeriphClockCmd enables the peripheral clock for GPIO on the B port. This sets bit 1 in the RCC AHB1 peripheral clock register (RCC_AHB1ENR). To do this manually you'd simply set

RCC_AHB1ENR |= 0x0002;

Next we select which pins on that port we want to enable - in this case the full 8 bits for this port, pin 0 to 7. This does not actually have an equivalent register call - it simply defines which parts of the various registers we need to set later. As we're looking at the lower 8 pins on the port, we will either be setting the lower word or lower byte (depending on how wide the register settings are) for the set up explained below. We have the option of setting the IO mode to be input, output, alternative function or analogue. We're setting this to output, which is equivalent to this:

GPIOB_MODER &= 0xFFFF0000; /* clear the bits first - reset value is not 0x00000000 on Port B */ GPIOB_MODER |= 0x00005555;

The first 8 bits of the port are set using the lower word of the register control. Input is 00 in binary, output is 01. Having set the pins to be output pins we now need to set the type of output and the speed they'll be driven at. This is done using the OTYPER and OSPEEDR registers. The output mode options available are push-pull or open drain. In our case we want the pin driven hard to get the cleanest edges possible so we've chosen Push-pull. This is equivalent to cleaning the bits for pin 0-7 like this:

GPIOB_OTYPER &= 0xFF00;

As we can potentially sample at 100MHz we want the output pins going as quickly as possible - although the STM32 board can be clocked at 168MHz the pins seem to be limited to a maximum speed of 100MHz (assuming 30pF). The reset value of this register is not zero, but as we want to set all the bits in the lower word there is no value in clearing those bits first:

GPIOB_OSPEEDR |= 0x0000FFFF;

Next we set this output port to have an internal pull down:

GPIOB_PUPDR &= 0xFFFF0000; /* clear the bits first - reset value is not 0x00000000 on Port B */ GPIOB_PUPDR |= 0x0000AAAA;

Each pin has the following options in binary:

00no pull up or pull down
01pull up
10pull down

Calling GPIO_Init initialises the port with the options I've outlined above. With these registers correctly configured outputting a value is as simple as:

GPIOB_ODR = output_value;

Find out more about RapiTime »