Thats part of it. The rest is that a machine gun is generally a weapon that fires a non explosive round, exclusviely. Anything that fires an explosive round is a cannon. The 25mm chain gun is a cannon, as are the 20, 25 and 30 mm Galting types that are used on aircraft and for ground based anti air. Those two are electrically powered (more generally they are externally powered. However there are cannon that are not externally powered. The common 20 mm cannon used before the advent of the 20 mm Vulcan family was a rotary self powered cannon (we stole the basic design from the Germans, IIRC). By the same token there are machine guns, for want of a better term that are externally powered. The GE Mini-gun (a gatling type) comes in both 7.62NATO and 5.56NATO. I don't know of a 50 cal Galting, but it would be something to behold.
BTW, listening to the live feed from Baghdad, I heard the unmistakeable sound of a heavy Gatling type weapon. Ours or theirs I can't say. I don't know if they have any, although the Russians do have an anti-aircraft gun (30mm?) that has a Gatling mechanism. To me it sounded like the Avenger cannon on an A-10, because of its deep tone, but could have a 20mm on another fighter or an AC-130. Whatever it was, it was pretty close.