It is accepted practice (isn't it?) to split two 110-volt circuits from a three-conductor (red-white-black) into two 110-volt circuits.

What about the reverse?
I needed a 220-volt circuit to power a water pump in my shed. Running through the shed are two independent 110-volt lines. I tapped each "hot" wire to yield the 220 volts. (I installed a 2-pole breaker in the main panel to protect this arrangement). It works OK.

The question is: Am I violating the electrical code?

Thanks,

Vince Rosati