Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - erikbrannlund

Pages: [1]
1
General Board / Help with Jelu:s tenpin ethernetmodule...
« on: 08.10.2007 at 16:05:26 »
Hi!

I this module from Jelu in the beginning of the year but haven't had the time to try to get it working before. Unfortunately it doesn't want to work. There are three possible reasons as far as I can see.


- I have connected the wires incorrectly as I'm using and ATmega644 instead of ATMega128.  This is what happens when I connect the cable to the diodes on my STK500.

644side ENCside
7-------------1
6-------------3
5-------------2
4-------------0
3-------------4
2-------------7
1-------------6
0-------------5

- I broke the circuit when I tried connecting et the first time before realising that the pinconfiguration was different and running on 3V instead of 5V.
 
- I have changed the code incorrctly or insufficiently.


Below are the changes I've made.
Im enc28960.h line ~260

#define ENC28J60_CONTROL_PORT   PORTB
#define ENC28J60_CONTROL_DDR   DDRB
#define ENC28J60_CONTROL_CS     4  // I've changed this several times when nothing worked.


In enc28j60.cpp line ~250

   // setup SPI I/O pins
   PORTB &= ~(1<<7);   // set SCK lo
   DDRB  |=  (1<<7);   // set SCK as output
   DDRB  |=  (1<<5);   // set MOSI as output
   DDRB  &= ~(1<<6);   // set MISO as input

   DDRB |= (1<<4);      // SS must be output for Master mode to work


And line ~277

   DDRB |= (1<<3);
   PORTB &= ~(1<<3);
   delayms(10);
   PORTB |= (1<<3);


I've changed this several times also in desperation when nothing works.

Hoping for help/Erik

P.S
How can I check if I managed to break it with 5V or soething else.
D.S

Pages: [1]