Attiny85 Problem! Stay Alive capacitor on 5v Power supply causes ATTiny to stop

Please can someone please put me out of my misery (metaphorically)!
I have been trying to use an ATTiny 85 USB to switch on and off lighting in a Model railway carriage.
This has been well documented elsewhere. (DCC Function Decoder for Arduino and ATtiny | rudysmodelrailway)
The dcc system has a 15v ac supply which has a power and digital component. The optocoupler circuit syphons off the dcc signal which goes to Pin 2 of the Attiny85.
From the same ac supply I have a simple circuit of a bridge rectifier to a capacitor to 5v voltage regulator to supply a regulated 5v supply to the GND and 5v of the Attiny85. Since the ac supply may be interrupted by the passage of the coach over the track the capacitor provides a "stay alive" function for the regulator so the lights do not flicker.
I connect up the power supply and the optocoupler circuits and everything works using several variations of the Arduino code supplied by Rudys initial post. EVERYTHING WORKS, lights go on and off as they should as long as there is no Capacitor in the power supply circuit. As soon as the Capacitor is added there appears to be no dcc control.
I have tried supplying 12v to Vin same result. The value and voltage of the capcitor make no difference. I have seen a post on this forum with a similar problem but I cannot see any reason why the power supply circuit should interfere with the dcc component unless there is some sort of noise being generated somewhere.
Does anyone have any potential work-arounds.
Thanks for taking the time to look at this

5v supply to digispark3G_pcb.pdf (1010 KB)

Your schematic doesn't show 1) the power supply, and 2) the capacitor. It is unclear from your description how they are connected.

How to post an image

According to the data sheet it is essential to have a 0μ1 capacitor between pin 8 and pin 5, which is missing from your schematic. Whether that has anything to do with you problem I do not know.