The noun canon can refer to a few things, including (1) a code of laws, (2) an established principle, (3) a group of exemplary literary works, and (4) the works of a writer that are accepted as authentic. Cannon mainly refers to a large weapon that fires heavy projectiles. It has a few senses unrelated to ordnance, but they are rare. Unlike canon, it works as a verb, meaning, chiefly, to bombard with cannon.
Incidentally, the plural of cannon can be either cannon or cannons. Both forms are used regularly. The plural of canon is always canons.
The Blue Hill Troupe has produced the entire canon of works by W.S. Gilbert and Arthur Sullivan. [Wall Street Journal]
The boys clearly noticed the big 76mm cannon on the ship’s deck. [Wired]
Can you sincerely ask a religion, a canon of ethics, to apologize? [Globe and Mail]
Senegal’s riot police have fired tear gas and water cannon at thousands of protesters outside parliament. [BBC]
Shakespeare ought to be the godfather of the double act, and certainly there are numerous examples in the canon. [Telegraph]
Police used water cannons outside the stadium immediately after the match. [AP]