Ethernet SS Pin 10

Greetings. This is my debut post.

I have read numerous posts about people using Ethernet shield who needed access to pin 10. Based on the reading of those posts, I understand that after the Ethernet library initizliation in my sketch, I am free to use pin 10 (which is used for “Slave Select” on Ethernet), so long as it is enabled as an output.

My question is:

Am I free to use Timer1, which uses pins 9 and 10, after initializing Ethernet? I don’t actually need pin 10, as I can use pin 9. But I need the Timer1 to function fully.

Hardware: Nano 3.0/328p with Wiznet WIZ811MJ.

This test code shows what I need to do. It triggers the native timer pin #9 when an incoming serial byte is received:

#include <TimerOne.h>

int inByte = 0; 
void setup()
{
Timer1.initialize();
Timer1.pwm(9, 1,500000);
Timer1.attachInterrupt(callback);
Serial.begin(9600); 
}

void callback()
{
   Timer1.stop();
}

void loop()
{

if (Serial.available() > 0) 
{
    // get incoming byte:
    inByte = Serial.read(); 
    //Start Timer
   Timer1.resume();
}


}

Thank much,
Rennie

Am I free to use Timer1, which uses pins 9 and 10, after initializing Ethernet? I don't actually need pin 10, as I can use pin 9. But I need the Timer1 to function fully.

The timer is related to the PWM functionality on pin 10. Since you are not doing PWM on pin 10, you can use the Timer for whatever you want, including PWM on pin 9.

It triggers the native timer pin #9 when an incoming serial byte is received:

For what purpose? You need to poll to see if there is data, to trigger an interrupt to interrupt the program to tell you that you have serial data.

For what purpose? You need to poll to see if there is data, to trigger an interrupt to interrupt the program to tell you that you have serial data.

I have previously done this operation with a Tern controller, which uses a 186 chip. I'm moving to Arduino for smaller footprint and affordability. The Tern controller used RS-232. I'm moving to Ethernet with the Arduino, but the communication should work the same.

The application is to trigger an LED lamp circuit board for a camera exposure. Both the camera and lamp exposured are timed by Timer1, acting as the master integration time control.

The sketch loop is alway looking for commands from the serial port. When a command is received, the loop will call any number of board functions, depending on command received. One of these functions will be the single character "X", which will indicate an exposure. Upon receiving this command, the loop will enable Timer1, which will execute a single exposure on pin 9, and then disable itself (very rude to ask a timer to kill itself!). When another "X" command is received, it will repeat the process.

Please let me know if you see any problem.

Thanks.

It triggers the native timer pin #9 when an incoming serial byte is received:

So, you meant that it is triggered when a specific serial byte is received, not when any serial data arrives. That makes a lot more sense.

Thanks so much for you advice. I'm starting my Ethernet post now.