1 / 15

51MCU+Ethernet

51MCU+Ethernet. Protocol Stack. Ethernet Frame. ARP Protocol. Internet. IP Routing. ICMP-Ping. HTTP. Ethernet 晶片 -NE2000 Compatiable. Memory Organization. The Connection. Read/Write Timing. Driver 變數. #define MAC_TX_BUFFER_SIZE (1024) // 定義每一傳送封包最大 Size

fruma
Download Presentation

51MCU+Ethernet

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 51MCU+Ethernet

  2. Protocol Stack

  3. Ethernet Frame

  4. ARP Protocol

  5. Internet

  6. IP Routing

  7. ICMP-Ping

  8. HTTP

  9. Ethernet 晶片-NE2000 Compatiable

  10. Memory Organization

  11. The Connection

  12. Read/Write Timing

  13. Driver 變數 • #define MAC_TX_BUFFER_SIZE (1024) //定義每一傳送封包最大Size • #define MAC_TX_BUFFER_COUNT (1) //定義幾個傳送封包的Buffer • #define NIC_PAGE_SIZE ( 256) //定義網卡每一個page等於256 bytes • // ( 此大小由網卡網卡硬體結構決定) • #define RAMPAGES (0x20) //網卡內建0x20(32) pages • // ( 此大小由網卡網卡硬體結構決定) • #define TXSTART (0x40) //網卡的傳送啟始頁(RAMPAGES由 此 • 開始往下到[0x20+0x40-1]結束) • #define TXPAGES (MAC_TX_BUFFER_COUNT * (MAC_TX_BUFFER_SIZE/NIC_PAGE_SIZE)) • #define RXSTART (TXSTART+TXPAGES) //網卡的接收起始頁 • #define RXSTOP (TXSTART+RAMPAGES-1) //網卡的糾收結束頁 • #define RXPAGES (RXSTOP - RXSTART) //定義網有多少接收page • // (PS.感覺RXSTOP-RXSTART比起實際的會少一頁) • // (需再仔細探討)

  14. RTL8019AS Ethernet Chip TXSTART、RXSTART、RXSTOP 這三個初始化後,將固定不動 CURRP 初始化後,當開始接收封包時,網卡會依據收到的封包調整此暫存器之數值 BNRY 初始化後,當使用者從Receive Buffer拿走資料後,要將其空間釋放給網卡繼續接收封包時,必須有使用者自行修改新的數值

  15. MCU 變數管理 NICReadPtr; 指向下一個新的receive packet所在網卡page number NICCurrentRdPtr 目前正在讀取的Receive packet起始page number NICCurrentTxBuffer 指定目前正在使用的Tx Buffer為規劃中的哪一塊

More Related