• AVR Freaks

AnsweredHot!I have problem with AN1921

Author
Jin_sys
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/10/04 04:53:56
  • Location: 0
  • Status: offline
2018/10/18 01:21:55 (permalink)
0

I have problem with AN1921

 
I use PIC dem net2 board and PIC dem net2 board base custom board and my job is verifying ethernet.
 
I read AN1921 and try it.
 
first, using MCC, oscillator set HS and PLL enable, External Clock 25Mhz.
ADD TCP/IP lite and set as same as AN1921, ADD mac and select ETHxxj6x
set Timer1 and 1s callback
and add TRISA &= 0xFC; at ETH_Init() in ETHxxJ6x_driver.c to set LEDA, B as output.
 
second, edit main.c as AN1921 tcpClientDEMO.
 
and compile with c90 and no error, download to board and run AN1921 TCPIP_demo.jar
 
but when click listen it not work. but link LED on and rx/tx LED blink.
 
 
I set ethernet LEDA as tx, LEDB as rx.
rx LED light when board start, but tx never light.
 
I try many thing but always same result except when I add DHCP. On wire shark DHCP Dicover - Transaction packet is capture. and host name is pic16F97j60 that I set. so it may work. but I don't know why AN1921 Demo not work. 
 
So, please help me to run AN1921 demo.
 
Also
I use MPLAB X 4.2 MCC 3.65.1 TCP/IP stack 2.2.8 XC8 2.0.
#1
christinaz
Starting Member
  • Total Posts : 32
  • Reward points : 0
  • Joined: 2018/05/17 09:58:42
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/19 15:31:27 (permalink) ☄ Helpfulby Jin_sys 2018/10/25 20:23:35
0
If the DHCP transaction packets have been captured, that means most of the configuration is correct. Have you configured your board's IP address through MCC in case of non-DHCP project?
BTW, what is your MCU?
post edited by christinaz - 2018/10/19 15:39:55
#2
Jin_sys
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/10/04 04:53:56
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/20 00:31:50 (permalink)
0
my MCU is pic16F97j60.
 
And at first, I configure my board's IP address through MCC but AN1921 AN1921 TCPIP_demo.jar is not work
and when checking packet through wireshark, no packet is come from my board.
#3
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: I have problem with AN1921 2018/10/20 01:37:01 (permalink)
0
Jin_sys
my MCU is pic16F97j60.

No such device. I guess you meant pic18F97j60.

Nearly there...
#4
Jin_sys
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/10/04 04:53:56
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/20 01:47:52 (permalink)
0
Oh sorry, pic18F97j60 is right.
 
And I am not yet firewall disable, I will try it.
 
Windows 10 has problem with this issue?
#5
Jin_sys
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/10/04 04:53:56
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/21 17:43:55 (permalink)
0
I try without firewall.
but same result..
 
I attach wireshark result
post edited by Jin_sys - 2018/10/21 17:57:27
#6
christinaz
Starting Member
  • Total Posts : 32
  • Reward points : 0
  • Joined: 2018/05/17 09:58:42
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/22 10:12:32 (permalink)
0
From your wireshark capture, I see several DHCP discover packets sent out by the board. But it seems there is no DHCP server to reply this packet. Did you always configure the DHCP module? BTW, please check your "MCC Generated Files" under "Source files" in project tree to see if there is dhcp_client.c file before you program the board, even if you configure without it. If you configure without DHCP module but there is this file in your project, you need to manually remove it from your project by right click on the file and select "Remove From Project".
Is your PC's IP 169.254.44.73? What is your configuration of your board's IP in MCC? Can you attach your ip_database.c file when you configure without DHCP?
#7
christinaz
Starting Member
  • Total Posts : 32
  • Reward points : 0
  • Joined: 2018/05/17 09:58:42
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/22 10:17:53 (permalink)
0
Another question about your test environment: did you connect both your PC and your board to a switch?
 
#8
Jin_sys
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/10/04 04:53:56
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/22 20:03:09 (permalink)
0
my pc is 169. 254.44.73 and board is 192.168.0.21.

and I connect board and pc directly. Is it the problem?
I have a home router
#9
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: I have problem with AN1921 2018/10/22 20:10:41 (permalink) ☼ Best Answerby Jin_sys 2018/10/25 20:23:17
+1 (1)
Yes, that is a problem.
How is your PC getting its IP address? That appears to be a self-assigned address, and it will NOT connect to a device on a totally different subnet like your board.
I can't imagine your PC would have internet access through your router, unless you have an extremely unusual setup.
What about if you enable DHCP in your PC so it gets its IP address from the router?
Otherwise, force your PC to an address starting with "192.168.0."
 

Nearly there...
#10
Jin_sys
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/10/04 04:53:56
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/22 21:14:56 (permalink)
0
Oh, I have no experience with network. 
I will try it. 
#11
christinaz
Starting Member
  • Total Posts : 32
  • Reward points : 0
  • Joined: 2018/05/17 09:58:42
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/23 10:14:54 (permalink) ☄ Helpfulby Jin_sys 2018/10/25 20:24:02
+1 (1)
Yes, your IP is the problem. Try qhb's suggestion to enable your PC's DHCP and connect both of you PC and board to a router to let the router to assign the IP first. Then try the demo.
#12
Jin_sys
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/10/04 04:53:56
  • Location: 0
  • Status: offline
Re: I have problem with AN1921 2018/10/25 20:26:41 (permalink)
0
Thank you everyone.
 
I also notice that tmr1 register init source that MCC generate is wrong, So fix it and check tmr1 run well.
 
finally, when I  connect board to router.
AN1921_demo.jar works!!
#13
Jump to:
© 2019 APG vNext Commercial Version 4.5