A cannon is a weapon that uses a chemical explosive to propel a massive projectile out of a tube at high velocity. A cannon is distinguished from a firearm by being too large for a single person to move and wield.
In modern militaries, the usual distinction between small arms and cannons is that cannons fire projectiles with 20mm or greater diameter. Many modern combat vehicles carry fully-automatic cannons firing 20mm or 30mm ammunition.
Cannons in Science Fiction
Large directed-energy weapons used by advanced civilizations are often called cannons, such as phaser cannons or blaster cannons. As with real weapons, the distinction between a small arm and a cannon is mostly size.