Called the Basilic Cannon, it could fire only seven shots a day. But fixed defenders couldn't run away... and eventually, the walls come a tumblin' down.
Castles changed in design after 1453, became more cannon-proof, but there's only so much you can do, if the hits keep coming, and you have a fixed defense.