MikroC Ethernet lib RX filters wrong ...

Discuss about beta versions of mikroC compiler.
Author
Message
User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#16 Post by srdjan » 31 Jan 2008 16:54

yo2lio wrote:Hei ...... Who edit my message !!!!! :evil: :evil: :evil: :evil: :evil:
- That would be me. Sorry, they keep putting quote and edit buttons so close :cry:
yo2lio wrote:
Well, I can not enable those filters and allow user to change them in the same time in init routine. It will have to be, either let users take care of filters or set them by default.
I don't say that !! :shock:

Well, I want to implement it in init routine and keep backward compatibility and make it easy...

bruno
Posts: 767
Joined: 10 Sep 2005 02:10
Location: Lyon, France
Contact:

#17 Post by bruno » 31 Jan 2008 16:56

srdjan wrote:Well, I can not enable those filters and allow user to change them in the same time in init routine. It will have to be, either let users take care of filters or set them by default.
to me default POR must be kept and init routine has nothing to do with filters.

why not functions or pseudo-functions like :
Ethernet_Unicast([ON|OFF]) ;
would need only one ROM byte.
Bruno
Bored with 7-segment ? Try the [url=http://www.micro-examples.com/public/microex-navig/doc/079-touchclock.html]TouchClock[/url]

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#18 Post by srdjan » 31 Jan 2008 17:01

bruno wrote:
srdjan wrote:Well, I can not enable those filters and allow user to change them in the same time in init routine. It will have to be, either let users take care of filters or set them by default.
to me default POR must be kept and init routine has nothing to do with filters.

why not functions or pseudo-functions like :
Ethernet_Unicast([ON|OFF]) ;
would need only one ROM byte.
I do think that rx logic must be disabled while configuring filters. So, the easiest way would be to set them in init while rx is not enabled yet.

bruno
Posts: 767
Joined: 10 Sep 2005 02:10
Location: Lyon, France
Contact:

#19 Post by bruno » 31 Jan 2008 17:09

It is not mentioned in the datasheet that RX logic must be disabled before modifying filters
To me, the init sequence of the datasheets prevents only from receiving unwanted packets
Bruno
Bored with 7-segment ? Try the [url=http://www.micro-examples.com/public/microex-navig/doc/079-touchclock.html]TouchClock[/url]

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#20 Post by yo2lio » 31 Jan 2008 17:43

I made few tests one moment ago and we can change ERXFCON and MAADR registers, ON THE FLY !

Conclusion : Ethernet filters can be modified at any time !
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#21 Post by srdjan » 31 Jan 2008 17:45

bruno wrote:It is not mentioned in the datasheet that RX logic must be disabled before modifying filters
To me, the init sequence of the datasheets prevents only from receiving unwanted packets
I see where the confusion lies. Sorry, I did not express myself correctly, there should have been a should instead of a must. I did not mean that you can not modify filter register while rx is enabled, but, exactly what you said, unexpected packets may be received while filters are modified. This is what I was referring to, taken form the microchip's data sheet:

Code: Select all

... to prevent unexpected packets from arriving,
it is recommended that RXEN be cleared before
altering the receive filter configuration (ERXFCON) and
MAC address...

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#22 Post by srdjan » 31 Jan 2008 18:39

Ok then,
init routine will keep rx filter reset settings and additional routines will be used for filter enabling. Just another question:
Let's say we will allow this CRC on/off, unicast on/off, multicast on/off, brodcast on/off.
If we make a separate function for each feature we will have 8 different routines.
How about making one routine for enabling one for disabling filters? Both of them will have a byte input parameter whose each bit will correspond to appropriate filter. Bits for advance filtering and and/or bode will be ignored.
Suggestions?
Speak now or be silent for ever :wink:

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#23 Post by yo2lio » 31 Jan 2008 18:50

srdjan wrote:Speak now or be silent for ever :wink:
Your proposition it's OK !

PS. I want to speak after the new release ! :twisted:

What about I2C bug ? http://www.mikroe.com/forum/viewtopic.p ... hlight=i2c
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

bruno
Posts: 767
Joined: 10 Sep 2005 02:10
Location: Lyon, France
Contact:

#24 Post by bruno » 31 Jan 2008 19:19

srdjan wrote:Ok then,
init routine will keep rx filter reset settings and additional routines will be used for filter enabling. Just another question:
Let's say we will allow this CRC on/off, unicast on/off, multicast on/off, brodcast on/off.
If we make a separate function for each feature we will have 8 different routines.
How about making one routine for enabling one for disabling filters? Both of them will have a byte input parameter whose each bit will correspond to appropriate filter. Bits for advance filtering and and/or bode will be ignored.
Suggestions?
Speak now or be silent for ever :wink:
:?: not too late for speaking :lol:

if you mean something like :
Ethernet_enable(UNICAST) ;
Ethernet_disable(MULTICAST) ;
it is OK to me too.
be careful with function naming because something like :
Ethernet_setFilter() or clearFilter() is ambiguous : if I set the filter, does it enable filtering (I will not receive packets) or enable reception (I will receive packets) ?

advance filtering needs datasheet understanding anyway, so it is not a big deal to leave it to user.
Bruno
Bored with 7-segment ? Try the [url=http://www.micro-examples.com/public/microex-navig/doc/079-touchclock.html]TouchClock[/url]

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#25 Post by srdjan » 01 Feb 2008 13:08

yo2lio wrote:
PS. I want to speak after the new release ! :twisted:
- You are welcome to speak now and after the release!
yo2lio wrote:[
What about I2C bug ? http://www.mikroe.com/forum/viewtopic.p ... hlight=i2c
- This was entered on the todo list too late for this release. However, on your insistence, I have checked this request. After investigation of pic18f4520 erratas I have concluded that this issues is listed only for the A1 revision. Please, do correct me if I'm wrong.
Therefore, I have removed this request from the ToDo list as it is not going to be implemented.
Anyway, thank you for your suggestion, we do appreciate it.

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#26 Post by yo2lio » 01 Feb 2008 13:53

srdjan wrote:However, on your insistence, I have checked this request. After investigation of pic18f4520 erratas I have concluded that this issues is listed only for the A1 revision. Please, do correct me if I'm wrong.
Yes but is listed for a lots of MCU's.

For PIC18F87J10 is listed in A2 revision

This problem not appear to PIC18F97J60 family ! I don't know, maybe not yet ! :?

Anyway, for safety, is good to put this sequence code :

Code: Select all

1. Configure the SCLx and SDAx pins as outputs by clearing their corresponding TRIS bits.
2. Force SCLx and SDAx low by clearing the corresponding LAT bits.
3. While keeping the LAT bits clear, configure SCLx and SDAx as inputs by setting their TRIS bits.
in I2C_Init for all devices .

PS. I got 100 USD (is not too much...) from my BOSS, because I fix this problems to our devices ! Thanks to Zoran ! :D
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

#27 Post by zristic » 01 Feb 2008 14:03

yo2lio wrote:PS. I got 100 USD (is not too much...) from my BOSS, because I fix this problems to our devices ! Thanks to Zoran ! :D
I drink BECKS.

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#28 Post by srdjan » 01 Feb 2008 14:16

Hi,
Ok, if you have already investigated this issue, share your knowledge with me. You will save me from reading tons of erratas. What i2c modules are affected with this? Only the ones on portC or all of them, because we have a different library for each module.

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#29 Post by yo2lio » 01 Feb 2008 14:30

This was tested by me only on PORTC ! I don't know about I2C module2 ?

But ... from PIC18F8722 ERATA A1 rev. :

Before configuring the module for I2C operation:
1. Configure the SCLx and SDAx pins as outputs by clearing their corresponding TRIS bits.
2. Force SCLx and SDAx low by clearing the corresponding LAT bits.
3. While keeping the LAT bits clear, configure SCLx and SDAx as inputs by setting their TRIS bits.

x mean module 1 and 2.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#30 Post by yo2lio » 01 Feb 2008 14:44

I think, this issue appear just in nanoWatt Technology MCU.

For PIC18F452, 252, 458, etc, is not signaled !

At our products (devices) this issue was signaled when was changed PIC18F452 with PIC18F4520.
Also appear randomly, not to all PIC18F4520 in my case.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

Post Reply

Return to “mikroC Beta testing”