am wondering what sort of activity (frequency of high & low) is happening on the Clock pin when the SPI bus is active.
since it's on Pin 13, one can see the LED flash when it's active.
i am troubleshooting using an ENC28J60 module on the SPI bus and i noticed the LED is staying on - or maybe flashing very fast because it's not as bright as when it's "fully HIGH".
is it normal for Ethernet activity to 'pulse' the Clock pin like that ?
i tried to observe an SD Card module on the same SPI bus and the LED only blinked a few times and then stayed off.
is there something not right happening on the SPI bus if the LED is "constantly on" ?
The clock signal is used whenever the SPI bus is active. How active that bus is depends on the code that's using the bus. I would imagine the ENC28J60 is being polled for data on a regular basis, so the SPI bus is being used a huge amount (i.e., pretty much constantly).
majenko:
… I would imagine the ENC28J60 is being polled for data on a regular basis, so the SPI bus is being used a huge amount (i.e., pretty much constantly).
or if it’s hanged ?
what would be a cause for the code to hang <here> ?
Serial.println("\n[backSoon]");
[color=teal]<here>[/color]
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
Serial.println( "Failed to access Ethernet controller");
full code as follows;
// ##############################
// copy direct from backSoon-ino #
// ################################
// Present a "Will be back soon web page", as stand-in webserver.
// 2011-01-30 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php
#include <EtherCard.h>
#define STATIC 0 // set to 1 to disable DHCP (adjust myip/gwip values below)
#if STATIC
// ethernet interface ip address
static byte myip[] = { 192,168,1,7 };
// NOT showing in DCHP Active IP table ?
// just pick one NOT currently in use
// gateway ip address
static byte gwip[] = { 192,168,1,1 };
#endif
// ethernet mac address - must be unique on your network
static byte mymac[] = { 0x02,0xDD,0xDD,0x00,0x00,0x01 };
byte Ethernet::buffer[500]; // tcp/ip send and receive buffer
char page[] PROGMEM =
"HTTP/1.0 503 Service Unavailable\r\n"
"Content-Type: text/html\r\n"
"Retry-After: 600\r\n"
"\r\n"
"<html>"
"<head><title>"
"Service Temporarily Unavailable"
"</title></head>"
"<body>"
"<h3>This service is currently unavailable</h3>"
"<p><em>"
"The main server is currently off-line.
"
"Please try again later."
"</em></p>"
"</body>"
"</html>"
;
void setup(){
Serial.begin(9600);
Serial.println("\n[backSoon]");
<here>
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
Serial.println( "Failed to access Ethernet controller");
#if STATIC
ether.staticSetup(myip, gwip);
#else
if (!ether.dhcpSetup())
Serial.println("DHCP failed");
#endif
ether.printIp("IP: ", ether.myip);
ether.printIp("GW: ", ether.gwip);
ether.printIp("DNS: ", ether.dnsip);
}
void loop(){
// wait for an incoming TCP packet, but ignore its contents
if (ether.packetLoop(ether.packetReceive())) {
memcpy_P(ether.tcpOffset(), page, sizeof page);
ether.httpServerReply(sizeof page - 1);
}
}
hmm, now that's a thought !
i haven't yet tried disabling it.
there's no timeout (i think) in the code - so it just hangs there and not even entering the "error-trap"(?)
that's a possible "What" but it doesn't cover the "Why" which is the main problem i'm having.
could an insufficient power supply issue be a possible cause for the "no response" - from the router back to the module ?
(i've just been reading these cables carry about 2.5 V which should be covered by the 3.3V of the module ?)