Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

I think, Config TCP is not confortable with W5500
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> EASY TCP/IP
View previous topic :: View next topic  
Author Message
katipefendi

Bascom Member



Joined: 24 Oct 2013
Posts: 30

blank.gif
PostPosted: Sat Jul 14, 2018 12:06 am    Post subject: I think, Config TCP is not confortable with W5500 Reply with quote

Hi all,

i try to use the code from Atilio Mosca [url] https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13767&highlight=dhcp [/url]
it is works but only till SETTCP.
After then i have to disconnect and connect the Wire to Cs = PORTB.4. then it works.

Has anybody an idea, why this it is so?

My Config see below:
Code:

Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 0
Spiinit

Config Tcpip = Noint , Mac = 0.8.220.77.05.30 , Ip = Ip_ , Submask = Subnetmask_ , Gateway = Gateway_ , Localport = 2005 ,  Chip = W5500 , Spi = 1 , Cs = Portb.4


 
Back to top
View user's profile
plouf

Bascom Member



Joined: 19 Jan 2012
Posts: 27
Location: Athens,Greece

greece.gif
PostPosted: Sat Jul 14, 2018 5:34 am    Post subject: Reply with quote

whats the reason of Cs = Portb.4 ? as i see you use a single hardware SPI
try removing it from config
Back to top
View user's profile
katipefendi

Bascom Member



Joined: 24 Oct 2013
Posts: 30

blank.gif
PostPosted: Sat Jul 14, 2018 11:06 am    Post subject: Reply with quote

Not works

Code:


Config Tcpip = Noint , Mac = 0.8.220.77.05.30 , Ip = 192.168.178.77 , Submask = 255.255.255.0 , Gateway = 192.168.178.1 , Localport = 2005 , Chip = W5500 , Spi = 1
 


Is it Possible the Cs = PORT.4 with BASCOM to disconnect and connect again?
Back to top
View user's profile
plouf

Bascom Member



Joined: 19 Jan 2012
Posts: 27
Location: Athens,Greece

greece.gif
PostPosted: Sat Jul 14, 2018 12:09 pm    Post subject: Reply with quote

dont understand !
now it works or not ?

C(hip)S(elect) reason is if you have more that 1 conected
Back to top
View user's profile
katipefendi

Bascom Member



Joined: 24 Oct 2013
Posts: 30

blank.gif
PostPosted: Sat Jul 14, 2018 12:30 pm    Post subject: Reply with quote

Hi,

without Cs = PORT.4 from Config is not work. I have frequently Hard Reset

The Cs have to be in Config, i have this from BASCOM Help.

The Function from Atilio Mosca [url] https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13767&highlight=dhcp [/url]
Get the DHCP OK if SETTCP it if was set.

But it will not set until I disconnect and reconnect the Cs wire once.

I think tihs is an Error in BASCOM.
Back to top
View user's profile
plouf

Bascom Member



Joined: 19 Jan 2012
Posts: 27
Location: Athens,Greece

greece.gif
PostPosted: Sat Jul 14, 2018 6:39 pm    Post subject: Reply with quote

i have try here DHCP for 5100 works, then recompile for 5500 and replace chip.... not working

ALSO i have hard time getting my project with 5500 working back .. seems that W5500 lib have some glitches for sure Smile
(i did some test with 5500 since you asked these to check out)
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 693

poland.gif
PostPosted: Sat Jul 14, 2018 9:51 pm    Post subject: Reply with quote

Im using W5500 without any problems. Look on the attached pics. One is original (bought in Poland ~20$), second is from China 4,7$
They both work...same Very Happy

Because my Bascom programmed devices have settings for ETH stored in the eeprom Im using this following steps:

1.First of all Im configuring pin SS of hardware SPI as output and set it HIGH(mandatory to be output, set HI is because Im using this pin for CS).
2.Configure Hardware SPI as Master with NOSS = 1 (it means "no ss")
3.Then I configure Wizz with my chosen CS pin. Pin can be same as original SS pin or any other. If another pin is used then I configure it as Output first and set it High.
-Important (for me)-step is that I configure WIzz with parameter Noinit
This is decribed in the Help. So I must complete/can change configuring by Settcp later.

With this order everything works fine for me. I can change settings almost in the fly by sending AT commands.
I also store once sent settings in the eeprom so next boot is quicker.

So ->NOSS=1 ->Noinit parameter ..and when you have alias for the Wizz CS pin then you can use it anytime you want.
Back to top
View user's profile Visit poster's website
katipefendi

Bascom Member



Joined: 24 Oct 2013
Posts: 30

blank.gif
PostPosted: Sat Jul 14, 2018 10:54 pm    Post subject: Reply with quote

Yes, TCP is not Problem, the Problem is, if you use the UDP
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 693

poland.gif
PostPosted: Sat Jul 14, 2018 10:56 pm    Post subject: Reply with quote

Okay. I will test it tommorow. Im curious Very Happy
Back to top
View user's profile Visit poster's website
katipefendi

Bascom Member



Joined: 24 Oct 2013
Posts: 30

blank.gif
PostPosted: Sun Jul 15, 2018 12:47 am    Post subject: Reply with quote

If i use UDP, then I measure the following first picture on the PIN Cs


and

if i use TCP, then I measure the following second picture on the PIN Cs
Back to top
View user's profile
six1

Bascom Expert



Joined: 27 Feb 2009
Posts: 552

germany.gif
PostPosted: Thu Aug 23, 2018 7:34 am    Post subject: Reply with quote

@Mark
can you confirm, that DHCP Sample isn't working on WIZ5500 ?

best, Michael

_________________
For technical reasons, the signature is on the back of this message.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5070
Location: Holland

blank.gif
PostPosted: Thu Aug 23, 2018 9:29 am    Post subject: Reply with quote

no, i did not test it on all supported wiz chips. So i can not confirm if it works or not.
it should work but since wiznet makes each new chip totally different, it would not surprise me if there is some difference.
A csw_reset (soft chip reset) is executed, it should be sufficient.

_________________
Mark
Back to top
View user's profile Visit poster's website
six1

Bascom Expert



Joined: 27 Feb 2009
Posts: 552

germany.gif
PostPosted: Thu Aug 23, 2018 3:36 pm    Post subject: Reply with quote

thank you Mark!

@katipefendi
check hint from Mark! (csw_reset)

_________________
For technical reasons, the signature is on the back of this message.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5070
Location: Holland

blank.gif
PostPosted: Thu Aug 23, 2018 9:16 pm    Post subject: Reply with quote

I connected the w5500 and while the provided samples work, indeed the Settcp hangs the chip.

After checking it seems that the w5500 register does not reset properly.
According the datasheet : If this bit is 1, All internal registers will be initialized. It will be
automatically cleared as 0 after S/W reset.

So at init and re init the bit is set, then there is a check to see if the bit clears. With a hard reset this seems to work, while with a soft reset, it doesnt.
To fix it, you can remark these lines in the tcpip-w5500.LBX file (open with nodepad)
Search the label _Re_init_tcpip_lp: and remark the lines as shown :


_Re_init_tcpip_lp:
; rcall _read_TCPSPIX
;.OBJ FCD7
; rjmp _Re_init_tcpip_lp


then save.

_________________
Mark
Back to top
View user's profile Visit poster's website
six1

Bascom Expert



Joined: 27 Feb 2009
Posts: 552

germany.gif
PostPosted: Fri Aug 24, 2018 9:57 am    Post subject: Reply with quote

Thanks a lot Mark!
_________________
For technical reasons, the signature is on the back of this message.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> EASY TCP/IP All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum