Arduino Uno and SSC-32 Serial Connection breaks after 1h

hello,

sorry for my english - hope you understand it.

To my problem:

I have an Arduino Uno connected via the serial interface with the SSC-32.
The VS-2 is powered by a 5V power supply and the VL of a 9 volt power supply.
VS1 is also fed volt power supply from a 5. Starting point is the Paper Clock Digital / Analog Hoempage:

instructables.com/id/Digital … aperCraft/

I have done everything like the instructable and so it will work quite well so far but unfortunately after about 1 hour,
the LED D1 of the SSC-32 boards turned off, and no servo it moves more. In various forums i could read a problem can be the
power Supply or the programming. Cause is probably a memory problem on the overloading to the serial interface.
Unfortunately, I’m not as fit in the programming I find the reason and hope for the Forum.
Have already made several changes to the program but all to no avail. I noticed that the LED then turns off
when a new time should be displayed - so if the servos should move to a new position. It does not matter
how many servos hang on the SSC-32 - two or all 28! After a reset on the board everything works again fine.
Could the RTC be the Problem? He sent a lot of Serial Data in Serial Monitor!

Would be nice if someone here would have a solution as to get the parts was not exactly easy and cheap.

Oh - on the SSC-32 board I have nothing TX infected (jumper) and
RX pin used adjacent GND (the only way to go too)

Here is the Arduino Programm :

[code]#include <Wire.h>
#include “RTClib.h”

RTC_DS1307 RTC;

int segA = 0;
int segB = 1;
int segC = 2;
int segD = 3;
int segE = 4;
int segF = 5;
int segG = 6;

unsigned long segA_OUT = 1300;
unsigned long segB_OUT = 1300;
unsigned long segC_OUT = 1300;
unsigned long segD_OUT = 1300;
unsigned long segE_OUT = 1300;
unsigned long segF_OUT = 1300;
unsigned long segG_OUT = 1300;

unsigned long segA_IN = 1600;
unsigned long segB_IN = 1600;
unsigned long segC_IN = 1600;
unsigned long segD_IN = 1600;
unsigned long segE_IN = 1600;
unsigned long segF_IN = 1600;
unsigned long segG_IN = 1600;

int TIME = 2000;

DateTime datePast;
DateTime dateNow;

//house keeping
void setup() {
Serial.begin(9600);
Wire.begin();
RTC.begin();
RTC.adjust(DateTime(DATE, TIME));
datePast = RTC.now();
}

//main loop
void loop() {
dateNow = RTC.now();
if(!(datePast.hour() == dateNow.hour() && datePast.minute() == dateNow.hour() ))
{
displayNumber(dateNow.hour()*100+dateNow.minute());
datePast = dateNow;
}
}

//Given a number, we display 10:22
//After running through the 4 numbers, the display is left turned off
void displayNumber(int toDisplay) {
for(int digit = 4 ; digit > 0 ; digit–) {
lightNumber(toDisplay % 10, digit);
toDisplay /= 10;
}

//start movement
Serial.print(" T");Serial.println(TIME);
}

void move(int servo, int position) {
Serial.print("#");
Serial.print(servo);
Serial.print(" P");
Serial.print(position);
}

//Given a number, turns on those segments
//If number == 10, then turn off number
void lightNumber(int numberToDisplay, int segment) {

int offset = (segment - 1)*7;
switch (numberToDisplay){

case 0:
move(segA + offset, segA_OUT);
move(segB + offset , segB_OUT);
move(segC + offset , segC_OUT);
move(segD + offset , segD_OUT);
move(segE + offset , segE_OUT);
move(segF + offset , segF_OUT);
move(segG + offset , segG_IN);
break;

case 1:
move(segA + offset , segA_IN);
move(segB + offset , segB_OUT);
move(segC + offset , segC_OUT);
move(segD + offset , segD_IN);
move(segE + offset , segE_IN);
move(segF + offset , segF_IN);
move(segG + offset , segG_IN);
break;

case 2:
move(segA + offset , segA_OUT);
move(segB + offset , segB_OUT);
move(segC + offset , segC_IN);
move(segD + offset , segD_OUT);
move(segE + offset , segE_OUT);
move(segF + offset , segF_IN);
move(segG + offset , segG_OUT);
break;

case 3:
move(segA + offset , segA_OUT);
move(segB + offset , segB_OUT);
move(segC + offset , segC_OUT);
move(segD + offset , segD_OUT);
move(segE + offset , segE_IN);
move(segF + offset , segF_IN);
move(segG + offset , segG_OUT);
break;

case 4:
move(segA + offset , segA_IN);
move(segB + offset , segB_OUT);
move(segC + offset , segC_OUT);
move(segD + offset , segD_IN);
move(segE + offset , segE_IN);
move(segF + offset , segF_OUT);
move(segG + offset , segG_OUT);
break;

case 5:
move(segA + offset , segA_OUT);
move(segB + offset , segB_IN);
move(segC + offset , segC_OUT);
move(segD + offset , segD_OUT);
move(segE + offset , segE_IN);
move(segF + offset , segF_OUT);
move(segG + offset , segG_OUT);
break;

case 6:
move(segA + offset , segA_OUT);
move(segB + offset , segB_IN);
move(segC + offset , segC_OUT);
move(segD + offset , segD_OUT);
move(segE + offset , segE_OUT);
move(segF + offset , segF_OUT);
move(segG + offset , segG_OUT);
break;

case 7:
move(segA + offset , segA_OUT);
move(segB + offset , segB_OUT);
move(segC + offset , segC_OUT);
move(segD + offset , segD_IN);
move(segE + offset , segE_IN);
move(segF + offset , segF_IN);
move(segG + offset , segG_IN);
break;

case 8:
move(segA + offset , segA_OUT);
move(segB + offset , segB_OUT);
move(segC + offset , segC_OUT);
move(segD + offset , segD_OUT);
move(segE + offset , segE_OUT);
move(segF + offset , segF_OUT);
move(segG + offset , segG_OUT);
break;

case 9:
move(segA + offset , segA_OUT);
move(segB + offset , segB_OUT);
move(segC + offset , segC_OUT);
move(segD + offset , segD_OUT);
move(segE + offset , segE_IN);
move(segF + offset , segF_OUT);
move(segG + offset , segG_OUT);
break;

case 10:
move(segA + offset , segA_IN);
move(segB + offset , segB_IN);
move(segC + offset , segC_IN);
move(segD + offset , segD_IN);
move(segE + offset , segE_IN);
move(segF + offset , segF_IN);
move(segG + offset , segG_IN);
break;
}
}[/code]

I am not sure how much I can help here. Hopefully someone from Robotshop can help.

Note: the LED on the SSC-32 is not a power LED, except when first powered up. After startup it flashes as it receives data (any data regardless if valid or even the right baud). So if you no longer see any led activity, then the SSC-32 is not receiving data.

Power is always one of the first things I would check. If you have a volt meter, when it gets into the freeze state I would check the voltages going into the SSC-32 as well as Arduino UNO. Not sure what you have powering the UNO?

So my guess is you have a hang in your program.

So if it were me I would try to instrument the program to see where things are. If I were doing it, I would setup several IO pins doing toggling of the lines and the like and hook up my Logic Analyzer and see what is going on… But that is cheating.

On Other setups I would suggest Serial.prints to debug terminal to watch what is going on, but your Serial port is taken up by SSC-32. Couple options for that, would be move the SSC-32 connection to a different pin and control it using SoftwareSerial library. Use different processor like Arduino Leonardo which has separate USB from the Serial on pins 0,1…

But in the mean time I would play a couple of hunches. like is the code hanging trying to read the real time clock?
You can use the LED on the UNO for this. In the Setup() function, set pin 13 as an output pin.
pinMode(13, OUTPUT);

Then in your main loop, Turn the LED on when in the RTC read. Something like:

void loop() { digitalWrite(13, HIGH); dateNow = RTC.now(); digitalwrite(13, LOW); ...
Then when it hangs, if the LED on the UNO is on, it is in the RTC code… If not guess again…

good Luck
Kurt

Hello Kurt,
thanks for your help: By your note i am kinda stumbled on the solution.

i tried what you tell me and in that way i looked into the program lines and suddenly i see:

if(!(datePast.hour() == dateNow.hour() && datePast.minute() == dateNow.hour() )) change in

if(!(datePast.hour() == dateNow.hour() && datePast.minute() == dateNow.minute() )) Look at the last dateNow.xxxxx

Now the LED only lightning when data are send. Before the LED is flashing 3-4 times per second

I will let it run now until to sunday morning ( it is nearly one o`clock in morning at my country and i have to go to bed now :confused: to see if it still works.

But I will report again if it worked!!!