I have an Frigidaire Affinity washer that runs perfectly fine, (all the way through wash & rinse cycles), when empty, but as soon as you put even a small load of clothes in it, it stops working halfway through the wash cycle, leaving a tub half full of water and very wet clothes. I noticed that when this happens the timer resets to the start of the wash cycle, and then will shut off after about 15 minutes. What could be causing this sort of behavior? The machine is only 4 years old and is all digital.
The machine is not emptying properly for some reason. All washing machines are designed never to spin whilst full of water. The default is either to pause indefinitely or reset the program. It's odd that the machine is fine when empty though.
I would still do the following before calling out a repair company.
Check that it isn't blocked or partially blocked. If the machine has a service panel at the base then it might have a round filter dial that when turned comes out of the machine (plus old baby socks, coins etc). Make sure to grab loads of old towels and put them around the base of the machine before doing this. The machine might have several litres of water or more still in it. If you can see water inside the machine then you will need a lot of towels when unblocking the filter... you have been warned ;) Get a well insured friend to do it otherwise :D
Make sure that the grey waste hose at the back of the machine is not trapped.
Make sure that the grey waste hose is not higher than the machine or pushed too far into the drain pipe. This can cause water to back up into the machine and complicate matters.
The machine might have a coin lodged in the pump or something similar. Listen for any rattles when it is emptying. You should at least hear a churning sound coming from the pump.
Give the door a push in case the lock is faulty and the clothing is pushing outward causing the lock to break a circuit.
Check that both Hot and Cold water are actually going into the machine. If you have turned the Hot off at the wall and the machine has an economy mode then it is waiting for hot water.
The most common cause is a failed timer. Most machines use an electromechanical unit that is prone to breaking. Hard to fix and is almost always just replaced.
You say that the machine is "all digital" but the valves are mechanical, and many digital machines operate physical relays.
Even if it is out of warranty, it may be worth a call to service since total failure should not occur on a four year old machine (and your problem is effectively total failure). Occasionally they will cover the cost of the part if not the service call.