The referendum was needed imho to end the neverending draging of he negotiations while situation in greece deteriorates. It will also force troika and greek gov to find common ground in a time bounded process. Both parties are (in reality) interested in campaining for a Yes (provided an updated deal). However a No will mark the point of no retreat for *any* Greek Gov, then it will be up to Troika to either cave in or expel Greece from EZ.
Troikas response was breaking greak banks.
In any way the moment Troika scare itself at the lenght they will go to enforce their terms, they are done