Skip to content

SAM4S W5100 driver

SAM4S W5100 driver

Alan

Published November 02, 2022

Original author: DizzoOriginal source (new tab)

SAM4S W5100 driver

Project description

In the past several days I was working on many different things, including my project which involves SAM4S development with ASF. I'm working on a device which will communicate on a local network, using W5100 (http://www.wiznet.co.kr/product-item/w5100/). I wrote a "driver" for this ethernet controller in the last days, so, I can start to implement the higher level code which will use this driver to send/receive packets, but that's a different story.

They say that is good to have same pictures in the post to make it more interesting. So, here is my config which helps me to learn the basics of ARM and get some experience with ASF.


 

SAM4S W5100 driver



 


 
Since I didn't find much about SAM4S, W5100 and SPI on the net, I decided to share my code here, it's free to use. 
It has the following features:


 

  • SPI interface init
  • SPI handling on low level (sending/receiving bytes)
  • w5100 register reading/writing
  • w5100 TX/RX Memory writing/reading (data sending/receiving) including all the calculations needed for that

 
The driver uses ASF, so you will need the drivers and services which I specified earlier in one of my previous posts about SPI with ASF.

 
My driver is not a general driver, most likely it won't work out of the box on your board. It's customized on a way as I needed it, however, if you just start to implement something similar, my code could be a very good starting point for you. I tried to comment the less obvious parts, hopefully you will understand it.

 
You can download the files from here: SAM4 SPI w5100 driver
If you have any question do not hesitate to ask...

Comments

Similar projects you might like

Comments