hi i have query is how can i generat 400hz, 9v, square wave
Easy. About the same way you would create a 399Hz 8.7V square wave. Unless, of course, you want to form your 400Hz by frequency-scaling from 50Hz mains.