1284p Ethernet Shield

Moin Leutz.
Ich habe auf dem Breadboard ein 1284p Chip mit dem Sketch von Webduino RGB drauf und möchte das Ethernet Shield mit dem verbinden.
Was ich versucht habe:
Am 1284p die PB 4,5,6,7 an dem Shield mit PIN 10,11,12,13 zu verbinden. Den ICSP vom Shield mit PB 5,6,7 und RESET am 1284p und nichts davon hat funktioniert.
Wie kann man es hinbekommen?

Hast Du auch versucht, die drei ICSP-Pins wie von Dir dargestellt zu verbinden und zusätzlich Pin 10 vom Shield nach PB4? Das ist nämlich die Konfiguration, wie das Shield mit Mega2560 und UNO verbunden wird.

Funktioniert auch nicht

Es blinkt ab und zu mal die RX LED am Shield, 3 Gelb und eine rote LED leuchten.

Hat das Shield auch eine Stromversorgung und Masse-Verbindung?

Mit welchen Einstellungen für Board compilierst Du den Sketch? Allenfalls musst Du SS (Pin 10) an PB2 verbinden (ist der Fallback).

Es blinkt ab und zu mal die RX LED am Shield, 3 Gelb und eine rote LED leuchten.

Sonst wäre es nicht so.

Das Blink Beispiel funktioniert ja. AVRISP mkII und Mighty 1284p 16MHZ

Bei mir gibt's kein Board "Mighty 1284p 16MHz". Woher hast Du die boards.txt?

Hast Du SS an PB2 versucht?

Geht auch nicht

Brauch das Ethernet Shield die TX und RX?

http://www.gammon.com.au/forum/?id=11637 weiter unten ist das 1284p
Danach hab ich es gemacht und zusätzlich an RX ein 60k drangehängt

Ich nutze das UNO Board um Sketchs Uploaden (ohne den 328 Chip, die RX und TX nicht vertauscht)

Danach hab ich es gemacht und zusätzlich an RX ein 60k drangehängt

Wozu?

Ist RESET auch verbunden?

Weil sonst ein Fehler kommt beim Upload. ( hier auch beschrieben: http://arduino.cc/forum/index.php/topic,139671.120.html « Reply #126 on: 03-02-2013, 10:06:53 » )

RESET mit was verbinden?

RESET mit was verbinden?

Der Reset-Pin des Shields mit dem Reset-Pin des 1284p. Damit das Shield auch geresettet wird, wenn der MCU einen Reset durchmacht.

Kannst Du ein Oszi anhängen, um den SS-Pin zu testen?

Hast das Bild angeschaut? Hab kein Oszi.

0.4-0.6V sind da drauf

Hast das Bild angeschaut?

Auf dem Bild ist aber nichts mit PB2 verbunden.

Poste mal den Code, den Du zum Testen verwendest.

Ist der normale Webduino RGB Sketch

/* Web_AjaxRGB.pde - example sketch for Webduino library */

#include "SPI.h"
#include "Ethernet.h"
#include "WebServer.h"

// CHANGE THIS TO YOUR OWN UNIQUE VALUE
static uint8_t mac[6] = { 0x02, 0xAA, 0xBB, 0xCC, 0x00, 0x22 };

// CHANGE THIS TO MATCH YOUR HOST NETWORK
static uint8_t ip[4] = { 192, 168, 178, 177 }; // area 51!

/* all URLs on this server will start with /rgb because of how we
 * define the PREFIX value.  We also will listen on port 80, the
 * standard HTTP service port */
#define PREFIX "/rgb"
WebServer webserver(PREFIX, 80);

#define RED_PIN 12
#define GREEN_PIN 13
#define BLUE_PIN 14

int red = 0;            //integer for red darkness
int blue = 0;           //integer for blue darkness
int green = 0;          //integer for green darkness

/* This command is set as the default command for the server.  It
 * handles both GET and POST requests.  For a GET, it returns a simple
 * page with some buttons.  For a POST, it saves the value posted to
 * the red/green/blue variable, affecting the output of the speaker */
void rgbCmd(WebServer &server, WebServer::ConnectionType type, char *, bool)
{
  if (type == WebServer::POST)
  {
    bool repeat;
    char name[16], value[16];
    do
    {
      /* readPOSTparam returns false when there are no more parameters
       * to read from the input.  We pass in buffers for it to store
       * the name and value strings along with the length of those
       * buffers. */
      repeat = server.readPOSTparam(name, 16, value, 16);

      /* this is a standard string comparison function.  It returns 0
       * when there's an exact match.  We're looking for a parameter
       * named red/green/blue here. */
      if (strcmp(name, "red") == 0)
      {
	/* use the STRing TO Unsigned Long function to turn the string
	 * version of the color strength value into our integer red/green/blue
	 * variable */
        red = strtoul(value, NULL, 10);
      }
      if (strcmp(name, "green") == 0)
      {
        green = strtoul(value, NULL, 10);
      }
      if (strcmp(name, "blue") == 0)
      {
        blue = strtoul(value, NULL, 10);
      }
    } while (repeat);
    
    // after procesing the POST data, tell the web browser to reload
    // the page using a GET method. 
    server.httpSeeOther(PREFIX);
//    Serial.print(name);
//    Serial.println(value);

    return;
  }

  /* for a GET or HEAD, send the standard "it's all OK headers" */
  server.httpSuccess();

  /* we don't output the body for a HEAD request */
  if (type == WebServer::GET)
  {
    /* store the HTML in program memory using the P macro */
    P(message) = 
"<!DOCTYPE html><html><head>"
  "<title>Webduino AJAX RGB Example</title>"
  "<link href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css' rel=stylesheet />"
  "<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script>"
  "<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js'></script>"
  "<style> body { background: black; } #red, #green, #blue { margin: 10px; } #red { background: #f00; } #green { background: #0f0; } #blue { background: #00f; } </style>"
  "<script>"

// change color on mouse up, not while sliding (causes much less traffic to the Arduino):
//    "function changeRGB(event, ui) { var id = $(this).attr('id'); if (id == 'red') $.post('/rgb', { red: ui.value } ); if (id == 'green') $.post('/rgb', { green: ui.value } ); if (id == 'blue') $.post('/rgb', { blue: ui.value } ); } "
//    "$(document).ready(function(){ $('#red, #green, #blue').slider({min: 0, max:255, change:changeRGB}); });"

// change color on slide and mouse up (causes more traffic to the Arduino):
    "function changeRGB(event, ui) { jQuery.ajaxSetup({timeout: 110}); /*not to DDoS the Arduino, you might have to change this to some threshold value that fits your setup*/ var id = $(this).attr('id'); if (id == 'red') $.post('/rgb', { red: ui.value } ); if (id == 'green') $.post('/rgb', { green: ui.value } ); if (id == 'blue') $.post('/rgb', { blue: ui.value } ); } "
    "$(document).ready(function(){ $('#red, #green, #blue').slider({min: 0, max:255, change:changeRGB, slide:changeRGB}); });"

  "</script>"
"</head>"
"<body style='font-size:62.5%;'>"
  "<div id=red></div>"
  "<div id=green></div>"
  "<div id=blue></div>"
"</body>"
"</html>";

    server.printP(message);
  }
}

void setup()
{
  pinMode(RED_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(BLUE_PIN, OUTPUT);

//  Serial.begin(9600);

  // setup the Ehternet library to talk to the Wiznet board
  Ethernet.begin(mac, ip);

  /* register our default command (activated with the request of
   * http://x.x.x.x/rgb */
  webserver.setDefaultCommand(&rgbCmd);

  /* start the server to wait for connections */
  webserver.begin();
}

void loop()
{
  // process incoming connections one at a time forever
  webserver.processConnection();
//  Serial.print(red);
//  Serial.print(" ");
//  Serial.print(green);
//  Serial.print(" ");
//  Serial.println(blue);
  analogWrite(RED_PIN, red);
  analogWrite(GREEN_PIN, green);
  analogWrite(BLUE_PIN, blue);
}

An PB2 habe ich auch versucht, funktioniert nicht.

An PB2 habe ich auch versucht, funktioniert nicht.

Du solltest den Pin 10 des Shields an PB2 lassen, der Code wird den Pin ansprechen, vorausgesetzt, Du compilierst wirklich für den 1284p.

Wie äussert sich "funktioniert nicht"? Lass mal ein paar Serial-Aufrufe drin und schau, wo Du welche Ausgaben bekommst. Um das Shield zu testen, würde ich keinen Webserver verwenden, sondern einen einfachen Beispielsketch der Ethernet-Bibliothek (z.B. ChatServer).

PIN10 an PB2

Chat server address:0.0.32.0
Chat server address:0.0.240.4
Chat server address:2.0.32.0
Chat server address:0.0.0.4
Chat server address:0.32.0.32
Chat server address:0.32.0.32
Chat server address:0.32.0.4
Chat server address:0.4.0.4
Chat server address:0.0.0.4
Chat server address:2.0.32.0
Chat server address:4.0.0.4
Chat server address:255.255.0.4
Chat server address:0.32.0.0
Chat serverÿChat server address:0.4.16.4
Chat server address:0.4.0.4
Chat server addressChat server address:0.0.32.0
Chat server address:2.0.32.0
Chat server address:0.32.0.3Chat server address:0.0.0.4
Chat server address:0.37.0.32
Chat server address:0.32.0.4
Chat server address:0.32.0.32
Chat server address:2.0.16.16
We have a new client
Chat server address:0.32.0.4
Chat server address:85.0.32.0
Chat server address:0.0.32.0
/*
 Chat  Server
 
 A simple server that distributes any incoming messages to all
 connected clients.  To use telnet to  your device's IP address and type.
 You can see the client's input in the serial monitor as well.
 Using an Arduino Wiznet Ethernet shield. 
 
 Circuit:
 * Ethernet shield attached to pins 10, 11, 12, 13
 * Analog inputs attached to pins A0 through A5 (optional)
 
 created 18 Dec 2009
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe
 
 */

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network.
// gateway and subnet are optional:
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,178, 177);
IPAddress gateway(192,168,178, 1);
IPAddress subnet(255, 255, 0, 0);


// telnet defaults to port 23
EthernetServer server(23);
boolean alreadyConnected = false; // whether or not the client was connected previously

void setup() {
  // initialize the ethernet device
  Ethernet.begin(mac, ip, gateway, subnet);
  // start listening for clients
  server.begin();
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
 


  Serial.print("Chat server address:");
  Serial.println(Ethernet.localIP());
}

void loop() {
  // wait for a new client:
  EthernetClient client = server.available();

  // when the client sends the first byte, say hello:
  if (client) {
    if (!alreadyConnected) {
      // clead out the input buffer:
      client.flush();    
      Serial.println("We have a new client");
      client.println("Hello, client!"); 
      alreadyConnected = true;
    } 

    if (client.available() > 0) {
      // read the bytes incoming from the client:
      char thisChar = client.read();
      // echo the bytes back to the client:
      server.write(thisChar);
      // echo the bytes to the server as well:
      Serial.write(thisChar);
    }
  }
}

PIN10 an PB4

Chat server address:255.255.255.255
Chat server address:255.255.255.255
Chat server address:255.255.255.255
Chat seòChat server address:255.255.255.255
Chat server address:255.255.255.255
Chat server address:255.255.255.255
Chat server address:255.255.255.255
Chat server address:255.255.255.255
Chat server address:255.255.255.255

Sieht so aus, als wäre Dein 1284p im Dauerreset. Denn eigentlich kommt die Ausgabe der Chat-Server Adresse nur einmal im setup().
Weiterhin wundert mich die Ausgabe nicht die gesetzte IP liefert. Auch die Netzmaske kommt mir komisch vor. Normalerweise ist die ehre 255.255.255.0.
Hast Du das Shield mit genau diesen Sketchen mal auf einem Uno probiert? Nicht, das es ein Netzwerkproblem und kein Chip-Problem ist.

Auf UNO läufts richtig:

ChaChat server address:192.168.178.177

Subnet habe ich auch angepasst, ändert sich nichts.

Ich habe soeben bemerkt, dass das ChatServer-Beispiel wirklich die falschen Parameter an die Ethernet-Bibliothek übergibt. Der dritte Parameter von Ethernet.begin() ist die IP des DNS-Servers und nicht der Gateway. Kannst Du das noch ändern?

Aber ich stimme mit mkl0815 überein, es sieht so aus, als würde Dein Breadboard-Rechner ständig resetten. Als erstes würde ich die Glättungskondensatoren näher an den Chip bringen und noch einen hinzufügen, der mind. 10µF gross ist.

Auf UNO:
Cha address:192.168.178.1
Chat server address:192.168.178.1

Auf 1284p:
C32.0.0
Chat server address:0.0.0.4

Ich habe hier nur 0,1µf und 22pf