Ed, sadly I am not well enough versed in all of the actions that saw cavalry pitted against infantry. I can refer you however the drill manuals employed at the time. Caseys of 1861 for infantry and Poinsetts for cavalry. Both are available online.

I can also add that on the first days fight at Gettysburg, a portion on Pettigrews division formed squares multiple times to defend against perceived mounted attacks by Bufords men. Also the US regulars formed squares to repel Stuarts charges at 1st Bull Run. I know there are other instances of it occurring Im just not as well versed in the specifics.

Dave