ENC28J60 Buffer Throws out Old Packets(FIFO)

A little Back story:
I am playing around with an ENC28J60 and arduino nano, and I am using it to maintain a connection to a device(ATEM BlackMagic ME/1 Switcher). The Arduino is no way fast enough to catch all packets coming from a BlackMagic Switcher, however it seems that the BlackMagic Device does not really care as long as the Arduino does not lose too many packets.

My Question:
I noticed that when the arduino was not keeping up with all of these packets and the ENC28J60's buffer overflowed, it(ENC28J60) would throw out old packets and only keep the new incoming ones in its buffer. I was wondering if there is a way for the ENC28J60 to keep the old Packets instead of the new ones until the Arduino can read them and throw out any new incoming packets if there is no space in the (ENC28J60)buffer? I am experimenting with different ways of handling these dropped packets and was wondering if this method might help with it.

Sorry for writing mistakes and bad grammer, I am a little tired

EDIT: I am using the UIPEthernet-master Libaray: GitHub - UIPEthernet/UIPEthernet: UIPEthernet library for Arduino IDE,Eclipse with arduino plugin and MBED/SMeshStudio (AVR,STM32F,ESP8266,Intel ARC32, Nordic nRF51, Teensy boards,Realtek Ameba(RTL8195A,RTL8710)), ENC28j60 network chip. Compatible with Wiznet W5100 Ethernet library API.

you could try the EthernetENC library, but it is possible it will have the same problem

Did a little Digging and eventually found what I am looking for is actaully called LIFO(Last In First Out) and what I have right now is FIFO(First In First Out). I checked the enc28j60 datasheet (http://ww1.microchip.com/downloads/en/devicedoc/39662c.pdf) and it looks like it is a hardware configured FIFO so no way of making it LIFO :frowning:

new packets are dropped. the recive buffer is a circular buffer and if there is no space, packet is dropped.

I maintain the UIPEthernet library and I made the EthernetENC library

@Juraj
Yes, that is what it is. I've worked with the same buffering systems before(mostly with serial and i2c), just did not know the term for them.
Hey awesome job on the enc library, I really appreciate your hard work. It has some nice features in it, but yes same problem. Its a hardware issue(limitation). In most cases FIFO makes sense, but in my case, the arduino is far to slow to keep up and missing a lot of important packets that come first

I think the problem is in your code

I don't see anything obvious in the code but maybe I am missing something
ATEM_UIP_1.0.3.zip (2.7 KB)
This has no Serial debugging and it using the UIP_Ethernet Lib(GitHub - UIPEthernet/UIPEthernet: UIPEthernet library for Arduino IDE,Eclipse with arduino plugin and MBED/SMeshStudio (AVR,STM32F,ESP8266,Intel ARC32, Nordic nRF51, Teensy boards,Realtek Ameba(RTL8195A,RTL8710)), ENC28j60 network chip. Compatible with Wiznet W5100 Ethernet library API.)
Dropped packets begin to increase when you do auto, it is when the ATEM gets too excited.

it is UDP?
my EthernetENC library has a backlog for UDP. UIPEthernet doesn't. The size of the backlog is configurable with UIP_UDP_BACKLOG
https://github.com/jandrassy/EthernetENC/wiki/Settings
and you can turn off TCP with UIP_CONF_MAX_CONNECTIONS to save flash and RAM.
and you can set more frequent network handling with UIP_PERIODIC_TIMER

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.