Debug stm32f407 + dp83848 again

Source: Internet
Author: User

As early as before graduation, I had debugged stm32f407 + dp83848. This debugging took another two days. Stm32 supports two industrial standard interfaces to connect to the external physical layer's PHY module. They are media-independent interfaces (MII) and simplified interfaces (rmii ). In the previous MII mode used by the PHY chip, the current rmii mode is used for this debugging (refer to the schematic diagram of various parties, mainly based on the Official Development Board's mb786 ). I 'd like to explain my usage in an official st manual.



1. if we draw a schematic diagram based on this figure, this is certainly correct, but for general use (we use full duplex), CRS and COL are not used much, as for why, I am not very clear about it. If you are familiar with it, you can add it.

2. How much serial resistance is required in the circuit when the dp83848 and stm32 are connected. According to a netizen's answer, the string connection resistance is used for impedance matching to prevent signal reflection. Generally, the PCB cabling is controlled to 50 ohm. In this case, when the receiving end has a high impedance, the source end can be connected to 50 ohm for matching and the signal reflected from the terminal can be absorbed, prevents re-launch at the source end. The signal-driven internal resistance (about 20 euro) determines how much resistance is connected in a string to match the PCB cabling. Therefore, the position of this resistor on the PCB must be close to the signal drive end. Otherwise matching depends on the signal speed and line length. The rule is generally that the line length is greater than 1/10 of the signal wavelength, and the 50 m clock is better to be connected, otherwise, you will see an obvious overhead. Generally, the resistance from 33 euro to 50 euro is acceptable.

3. Here, the MII mode is used to describe which pins need to be pulled up and pulled down.

Mdio requires K of pull-up resistance, and MDC does not need pull-up resistance. dp83848 led_act, led_speed, and led_link both require 2.2k of pull-up resistance;

The RD-, RD +, TD-, and TD + of dp83848 must be up to 49.9 euro 1% resistance, and two UF capacitors must be grounded;

Dp83848 20, 21 pin reserved must be connected to 2.2k pull-up resistance, and 24 pin rbias need a 4.87 euro 1% resistance grounding, pin 18, 23, 37 need capacitor grounding, these must be connected to the circuit in strict accordance with the dp83848 manual.

In addition, the 39 pin does not need the pull-up resistor. If it is in rmii mode, the resistor of 2 k is required. In this way, the rmii mode we use is selected.

Among them, there is an important signal that must be noted, this is also I am not paying attention to using the rmii mode, stm32 eth_rmii_ref_clk/eth_mii_rx_clk signal line pa1 is not connected, when using the rmii mode, pa1 should be connected to the clock source.

At last, the dp83848 7 pin is generally recommended to pull a 2 k resistor and connect it to the stm32 I/O pin, because we usually need to use some interruptions to handle the event, for example, hot swapping of Network cables.

During hardware debugging, if the external clock of stm32 is activated, the 25 pin of dp83848 should be able to output 25 MHz (MII) or 50 MHz (rmii) signals in rmii mode, tx_clk should have a 25 MHz signal. Note: It is recommended that the reset signal of PHY be not connected with the reset signal of stm32, because when PHY is not powered on, the reset pin of stm32 will always be pulled down, leading to the failure of stm32.

In the software debugging process, the official routine is used here. First, set the external clock frequency of stm32 correctly. Then, consider which mode to enable the macro definition. Then, if MCO provides the dp83848 clock signal, pay attention to the initialization of the pa8 pin of stm32. If the external clock source is used, MCO signals (but no need to connect to the PHY) are not considered. When initializing the software gpio, pay attention to the following, note the initialization part of pa8. You only need to comment out the initialization of the pin. do not comment on the initialization of the pin status, because the subsequent PIN initialization will be used.


The above are some of my usage feelings. What's wrong? Hope you can give me some advice!






Debug stm32f407 + dp83848 again

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.