multilanguage

Saturday, March 10, 2012

Ethernet driver

One day I got to do driver inputs / outputs managed by the ethernet.
Design assumptions are as follows:
  • 20 inputs
  • 20 relay outputs
  • controling by www page and comand line
  • UART and ISP/I2C interfaces
  • all based on PIC18F97J60 with hardware Ethernet control 


To do it faster i got microchip development kit PICDEM2.net:

Microcontroller even though only 8-bit is really quite a lot to offer:
  • Timing for 41,67MHz (obtained by PLL with 25MHz quartz)
  • 5 timers including one with the possibility of connecting an external oscillator
  • two USARTs and SPI/I2C
  • bulid-in Ethernet controler
  • 16 channel 10 bit ADC
  • 128kB flash and 3808B SRAM
In order to use it you have to get along with it, the manufacturer provide a fairly friendly environment and what surprised me it work out of box without problems on 64-bit Linux kernel, it was enough just to install provided software. The same applied to the programmer, after connecting ICD3 is immediately detected and most importantly it works! 


Together with software microchip provides libraries (download from their website) that incorporate a ready TCP / IP stack with examples. The only small bug is a program to generate a charge to the EEPROM memory (there is stored www), fired in different environments give different results (the same size but wrong checksums), it is with this bit of fun, but once in a while you can survive.
In this case, part of the programming has not proved to be too difficult.

In order to implement the driver was a little modified (mainly to remove what is not needed). Due to the fact that some of the elements is not available, you had to check how they behave their counterparts. The changes mainly related equipment to provide network connectivity (which is, however, quite important). To this end, they needed to order parts and build a model.
The case turned out to be a bit more difficult than it seemed. PIC instead of raster 0.5 turned out to be 0.4 (we bought it with development boards). I do not think I have to write what has it consequences. What's interesting device with 0.4 pitch is not listed in any of the notes.
In Poland I could only find one store with adapter to 0.4mm TQFP100 (but do not recommend it because PCB was walking week, came in another pitch and went again - a total of two weeks back). In the end, as i got all parts with more or less difficulty and with several different PCB i made something like this:
It made it a little difficult and consumed a lot of time, but ultimately succeeded.
Parallel to the development model and software, the PCBwas created. Eventually hatched something like this:

What's next?
Waiting on the PCB! Part have been already arived. Simply put together and hope it will work. 


P.S. Thank for my photographer to take pictures!
P.S.2 Those pesky I made personally.

Other articles about the driver:

No comments:

Post a Comment