DM9161A Ethernet PHY Confuses me....

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Guys,

 

I have a Problem with a DM9161AEP Phy, when i put the Cable in, then goes all LEDs on, and off, on and off. continuously....

The initialization by my Atmel SAM3X4C is complete without errors....

 

The VCC seems to be stable by my oszilliscope ...,

 

- have i a error in my circuit?

- or the wrong RJ45 Jack?

 

i use the Amphenol RJMG1BD3B8K1ANR RJ45....

 

When i try to desolder the R5 PIN from AVDDT on the RJ45, then i became the Link and 100Mbits LEDs continuously on.... my act LED are blinking...

 

But, my device is not pingable / reachable over the Ethernet.... by the Example Code from EMAC-Demo:

(emac_process_eth_packet is not executed when i ping my device, i become "target not reachable" yes the IP is manual set, and the gateway and Netmask is correctly set....)

 

void loop()
{
  
	uint32_t ul_frm_size;
	volatile uint32_t ul_delay;
	emac_options_t emac_option;
   
 	// Display MAC & IP settings
	printf("-- MAC %x:%x:%x:%x:%x:%x\n\r",
			gs_uc_mac_address[0], gs_uc_mac_address[1], gs_uc_mac_address[2],
			gs_uc_mac_address[3], gs_uc_mac_address[4], gs_uc_mac_address[5]);

	printf("-- IP  %d.%d.%d.%d\n\r", gs_uc_ip_address[0], gs_uc_ip_address[1],
			gs_uc_ip_address[2], gs_uc_ip_address[3]);

	// Reset PHY
	rstc_set_external_reset(RSTC, 13); // (2^(13+1))/32768
	rstc_reset_extern(RSTC);
	while (rstc_get_status(RSTC) & RSTC_SR_NRSTL) {
	};

	// Wait for PHY to be ready (CAT811: Max400ms)
	ul_delay = SystemCoreClock / 1000 / 3 * 400;
	while (ul_delay--);

	// Enable EMAC clock
	pmc_enable_periph_clk(ID_EMAC);

	// Fill in EMAC options
	emac_option.uc_copy_all_frame = 0;
	emac_option.uc_no_boardcast = 0;

	memcpy(emac_option.uc_mac_addr, gs_uc_mac_address, sizeof(gs_uc_mac_address));

	gs_emac_dev.p_hw = EMAC;
  
        printf("Init EMAC driver structure\r\n");
	// Init EMAC driver structure
	emac_dev_init(EMAC, &gs_emac_dev, &emac_option);

	// Enable Interrupt
	NVIC_EnableIRQ(EMAC_IRQn);
        
        printf("Init MAC PHY driver\r\n");

	// Init MAC PHY driver
	if (ethernet_phy_init(EMAC, BOARD_EMAC_PHY_ADDR, SystemCoreClock)
					!= EMAC_OK) {
		puts("PHY Initialize ERROR!\r\n");
		//return -1;
	}

	// Auto Negotiate, work in RMII mode
	if (ethernet_phy_auto_negotiate(EMAC, BOARD_EMAC_PHY_ADDR) != EMAC_OK) {

		puts("Auto Negotiate ERROR!\r\n");
		//return -1;
	}
        
        Serial.println("Establish ethernet link");
	// Establish ethernet link
	while (ethernet_phy_set_link(EMAC, BOARD_EMAC_PHY_ADDR, 1) != EMAC_OK) {
          Serial.println(EMAC_OK);
          puts("Set link ERROR!\r\n");
		//return -1;
	}
        
	while (1) {
		// Process packets
		if (EMAC_OK != emac_dev_read(&gs_emac_dev, (uint8_t *) gs_uc_eth_buffer,
						sizeof(gs_uc_eth_buffer), &ul_frm_size)) {
			continue;
		}

		if (ul_frm_size > 0) {
			// Handle input frame
			emac_process_eth_packet((uint8_t *) gs_uc_eth_buffer, ul_frm_size);
		}
	}
}

 

I attached my circuit from the DM9161AEP, sorry for the chaos ;)

 

Now, my question is:

- why the PHY is blinking with all LEDs, when i Solder R5 to AVDDT?

 

Attachment(s): 

Last Edited: Sun. Dec 23, 2018 - 07:46 PM