ATiny85 doesn't impliment code.

I make solar kinetic outdoor sculptures. the set up is simple. An Atiny 85 uses pin 0 and 1 to control an H bridge that drives a motor. The motor is controlled with an analogWrite() to the pins to speed the motor up and slow it down or change direction.

The problem is that some how the ATiny doesn't seem to impliment the code. I measured the voltage on the chip and it is 5 volts but the two pins 0 and 1 remain at 0 volts. This seems to have something to do with the fact that the initial voltage/current to the circuit starts out low and works its way up as the sun gets higher.

If I short out the solar leads when the sun is full on the solar panels, then it starts working. I tried different Atiny 85 chips but that makes no difference. All these chips work fine in a breadboard setting but once it fails in the morning, more voltage/current during the day doesn't seem to help.

The nutty thing is that I have made several other similar solar kinetics and they work using the same code and hardware setup... most of the time... but Intermittently one will either fail to start in the morning or just keep turning in one direction with the pin locked HIGH. If I re-insert the chip it then works fine.

Any ideas?

Almost all motors have a stall point below which there is simply not enough current / voltage to turn it.
As they are solar you are also subject to the vagaries of lighting conditions which are probably not a major factor on the bench.

Depending on which way your solar panel faces you may have to change the minimum point at which the motors operate to something slightly higher.

Also no sketch ?
No schematic ?

Really !

There is plenty of current to drive the motor. It only pulls about 60 ma and the six cells provide well over 200 ma. The problem seems to be in the chip. the code consists of a bunch of analogWrite() with delays in between. As I said the code works fine with a power supply or if i restart under full sun. The outputs of pin 0 and 1 are fed into the inputs of a L298N DC Stepper Motor Driver. Very straight forward.

I have not tried this with any other Arduino board but I thought maybe the internal clock of the ATiny may be hanging on startup because of the low initial voltage/current supplied to the chip.

RPCoyle:
There is plenty of current to drive the motor. It only pulls about 60 ma and the six cells provide well over 200 ma. The problem seems to be in the chip. the code consists of a bunch of analogWrite() with delays in between. As I said the code works fine with a power supply or if i restart under full sun. The outputs of pin 0 and 1 are fed into the inputs of a L298N DC Stepper Motor Driver. Very straight forward.

I have not tried this with any other Arduino board but I thought maybe the internal clock of the ATiny may be hanging on startup because of the low initial voltage/current supplied to the chip.

One or the other so recommendation still stands.

Found this in the specs.... might be the problem.

5.3.6Preventing EEPROM Corruption During periods of low VCC,

the EEPROM data can be corrupted because the supply voltage is too low for the CPUand the EEPROM to operate properly. These issues are the same as for board level systems using EEPROM, and the same design solutions should be applied.An EEPROM data corruption can be caused by two situations when the voltage is too low. First, a regular write sequence to the EEPROM requires a minimum voltage to operate correctly. Secondly, the CPU itself can execute instructions incorrectly, if the supply voltage is too low. EEPROM data corruption can easily be avoided by following this design recommendation:Keep the AVR RESET active (low) during periods of insufficient power supply voltage. This can be done by enabling the internal Brown-out Detector (BOD). If the detection level of the internal BOD does not match the needed detection level, an external low VCC reset protection circuit can be used. If a reset occurs while a write operation is in progress, the write operation will be completed provided that the power supply voltage is sufficient.