I know some people who found one in downtown Fredericksburg in an area that could have taken fire from either side during the Battle of Fredericksburg. Were there differences in the kind of artillery they were using in the battle?
Theoretically, yes, but highly unlikely. Location in this particular case could matter, but if, as you say, its in a place that direction cannot be determined, all we'd have to go by was the type of shell, caliber, and weight. These can tell us quite a bit, however. I would assume when you say "cannonball" you are basically describing it as a round shot, made of cast iron, and likely solid. In other words, it looks like we think of a cannonball looking. These were widely used, but were among lots of other types that included exploding shells, called "shells," that were hollow cast iron rounds fill with explosives and a fuse attached. These could be rounded balls, but were also made in a typical "bullet" shape. The navy sometimes employed chain shot, which was two balls held together by a chain, that was designed to tear through ships' rigging. There was also canister, which was a metal can filled with iron or lead balls, essentially converting a cannon into a giant shotgun. This was primarily used against attacking infantry.
As to your question, both sides used basically the same or similar cannons of varying calibers and weights. Units in the Civil War were organized as a battery which might contain anywhere from 1-6 guns, depending on if they had any captured or disabled, or in the Confederates' case, availability. But 4-6 was pretty standard. These guns could be smoothbores, or rifled ones, firing 3" shells (smallest caliber) up to 10 and 12lbers (shell weighs that much). There were literally dozens of different cannon types used, but two common types were the 12lb Napoleon, and 3" Ordinance Rifles. Although the Confederates had only one location to produce cannons, they readily utilized captured Federal guns. For this reason, it is very difficult to determine the origin of any single shot with any degree of accuracy (no pun intended).
Having said that, if the shot was unique in size or weight, it is possible you could find a specific battery employing that piece. Outside of that, even if we looked at the order of battle of both sides (which I did), and search various artillery units and their pieces (which I also did), we see a variety on both sides of 10 lbers, 12 lbers, 3" rifles, and others. And since these cannons had very long ranges, it would be near impossible to figure out exactly where it came from. Plus, during the battle of Chancellorsville, both Union and Confederate fought each other over Fredericksburg again, which the Union attempting to keep the Confederate Army in place there. So it could have even come from a few moths after the initial battle.
If you can weigh it, and measure it, and tell me where exactly it was found, I might be able to dig more.
There's not awfully much to go on here. A good start would be identifying the cannon ball. Is it perfectly round and solid, or hollow, or is it shaped like a cylinder with one end flattened? How much does it weigh and what is its diameter?
If it's round, solid, and roughly twelve pounds, it could be anyone's; everybody used twelve pound Napoleon cannon. If it's a long bolt, it's more likely to be from a Union ordnance rifle or Parrott gun; the Confederates had some rifled guns, but they were always inferior in this category to the Union.