Minecraft wiki entry for TNT_cannons, associated text: First build the base of the cannon
Then fill it with water on one side
Build two blocks like on the picture
Place the button
Place the redstone wires on one side
On the other side, place a redstone torch and four repeaters on highest delay
At the front place another block with a torch on the side
load the cannon like this...
...and finish.