打印
[ZLG-MCU]

实现Ethernet功能最简单的方法.

[复制链接]
2029|7
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
zlgmcu|  楼主 | 2007-6-29 10:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
LM3S6965其仅需以下步骤即可轻松实现Ethernet功能,比RTL8029/8039,NE2000之类的芯片方便多了.

//------------------------------------------------------------------
To use the Ethernet Controller, the peripheral must be enabled by setting the ETH bits in the RCGC2 register. The following steps can then be used to configure the ethernet controller for basic operation.
1. Program the MACDIV register to obtain a 2.5 MHz clock (or less) on the internal MII. Assuming a 20 MHz system clock, the MACDIV value would be 4. 
2. Program the MACIA0 and MACIA1 register for address filtering.
3. Program the MACTCTL register for Auto CRC generation, padding, and full duplex operation using a value of 0x16.
4. Program the MACRCTL register to reject frames with bad FCS using a value of 0x08.
5. Enable both the Transmitter and Receive by setting the LSB in both the MACTCTL and MACRCTL register.
6. To transmit a frame, write the frame into the TX FIFO using the MACDATA register. Then set the NEWTX bit in the MACTR register to initiate the transmit process. When the NEWTX bit has been cleared, the TX FIFO will be available for the next transmit frame.
7. To receive a frame, wait for the NPR field in the MACNP register to be non-zero. Then begin reading the frame from the RX FIFO by using the MACDATA register. When the frame (including the FCS field) has been read, the NPR field should decrement by one. When there are no more frames in the RX FIFO, the NPR field will read 0.
//-----------------------------------------------------------------

相关帖子

沙发
mcu123ad| | 2007-6-30 15:06 | 只看该作者

不错不错..

感觉比LPC236X强多了..LPC236X芯片只带MAC不带PHY,晕死.
更晕的是LPC236X出来时,提供的都是工程样片,,BUG一堆.


不知LM3S6965价格怎么样?虫子应该不会很多吧.

使用特权

评论回复
板凳
王紫豪| | 2007-7-2 10:20 | 只看该作者

能给我一个样片不?

使用特权

评论回复
地板
zlgmcu|  楼主 | 2007-7-2 15:25 | 只看该作者

目前我们这边有从美国寄过来的LM3S ethernet demo.

LM3S6965在上面稳定可靠地运行.

另关于样片,各位感兴趣请与我们各地的销售联系.

使用特权

评论回复
5
mcu123ad| | 2007-7-2 15:54 | 只看该作者

广州市新赛格二楼有样片吗?

开发环境有哪个较好?还是用CrossWorks for ARM 1.6?

使用特权

评论回复
6
王紫豪| | 2007-7-3 01:55 | 只看该作者

4楼的管理,给我一个电话把,我在哈尔滨!

使用特权

评论回复
7
mcu123ad| | 2007-7-3 13:50 | 只看该作者

好的,谢谢zlgmcu

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

81

主题

1146

帖子

0

粉丝