You will need to stretch a lot to make this a cohesive book. The ability to make a nuclear bomb is sufficiently far from the technology of swords and shields that they really don't fit. It's going to be a monster of a stretch.
The creation of a nuclear bomb requires an astonishing dynamic range of skills. King-Ink pointed out the subtle task: enrichment. He mentions gas centrifuges are out of the question due to aluminum not being available, but it goes even deeper than that. The spinning parts of a gas centrifuge are spinning so fast that they are approaching the tensile strength capabilities of single crystal titanium. Zippie type centrifuges spin so fast that the only way to keep the friction from turning the entire device into slag is magnetic bearings! Why all of this? The art of enriching is subtle: you have to separate two groups of atoms whose only distinguishing factor is that one is 1.2% heavier than the other. And, of course, you have to do this at the atomic scale, so lots of easy mass based techniques fall through.
However, there is another side, which is the opposite of subtle: the creation of the bomb. Obviously much of this is classified for good reason, but some details about the bombs are known. If I may cite information from this page on the Fat Man bomb dropped on Nagasaki. While enrichment is a very subtle art, the bomb is a precision work worthy of the finest watchmakers ever.
First off, a bit of information on how a nuclear bomb works. To make a bomb like the Fat Man, you need a perfectly spherical shock wave, from conventional explosives, crushing two or three pieces of uranium into one critical mass. The perfectly spherical requirement is not an overstatement: if the shock wave is not spherical, the implosion event is not symmetrical enough, and will "blow out" like a baby's diaper before the real power of the bomb ever comes to bear. To manage this, Fat Man had several layers of different high explosives wrapped around it (did I mention you need high explosives, not just gunpowder?). They were shaped carefully to have a lensing effect, focusing the shockwave down to a spherical shape. Fat man had 3 layers: Composition B, Baritol, and Composition B. The Baritol is slower burning, so careful shaping of the layers could create a lensing effect.
There were 32 of these lenses on Fat Man. Why? Because they put 32 initiators around the body. The more initiators you have, the more spherical the explosion, and the less creative lensing is required. It is known that more advanced nuclear bombs have upwards to at least 96 initiators, trying to get as much yield as possible. These initators are typically connected with thick, high current wires. I don't know the particulars for the Fat Man, but I know there is a type of initiator called "exploding bridgewire initiator," which is only used in nuclear weapons... nowhere else. While normal initiators can give you millisecond precision in your timing, a nuclear bomb calls for microsecond precision!
I could go on and on, but the point is, building these bombs requires a vast dynamic range of capability, from the subtle enrichment to the immaculately precise application of high explosives. All of this, of course, is based on reams of paperwork defining the theory behind everything they did.
If you want a great book on the management side of the bomb, I highly recommend Retired General Grover's book, Now It Can Be Told. Grover was in charge of the logical side of the Manhattan Project, so his point of view is refreshingly absent of technical details and shows just how much of a logistical marvel the effort was.
So that's how hard it is to make an atomic bomb. How could you do it with swords and shields? It won't be easy. My advice would be to design the entire book and the entire world around accomplishing the goal. Without a writer crafting the entire universe to create this bomb, it wont happen.
You'll need to have a large number of factions, each with its own particular strengths. You'll need several factions which, when combined, have the intellectual ability to crunch through those numbers. Most medieval tech worlds don't have the math, so they'll have to invent a lot of it as well. You'll need several factions in tune enough with nature to work with nature to manage the subtle art of coaxing U-235 out of the ore. I doubt you'll be able to build gas centrifuges, but a slightly magical group may be able to pull it off. Nature has accomplished more subtle things.
You'll need to make them hate each other so much that they refuse to learn from eachother. Each group needs to have enough shortcomings that they can't really apply their amazing talents without crushing their own civilization. Remember, someone is going to know enough about high explosives to do shockwave shaping -- this group can't take over the world until the right moment, or the bmob will never come to fruition. Some extraordinarily hard edged stubbornness is going to be needed to make sure none of the groups with these marvelous capabilities can ever rise out of the sword and shield world. Religion might be enough, but you may need more. Religion, politics, culture, geography, and a little luck might suffice.
Finally, you need something epic to force them all together. Something needs to make them all decide to overcome their differences and unite. Why? Well, first off, because its the only way you can have that limited of technology and yet have the united body of the world be anywhere close to a nuclear weapon. Second, because such a story line would truly mimic the process of setting an atomic bomb off, and the parallels there would be very helpful for assisting the readers in understanding what has happened.
As an alternative, consider magic approaches. Magic is beautiful for these sort of circumstances because it can be just as violent and magnificent as an atomic bomb if you portray it so. You could still use the exact same parallels, because the messages are still the same, you just remove all of those pesky technical hurdles. You can even craft the magic such that it doesn't affect the world. Perhaps there was magic several hundred years ago, but the acts of man wounded magic itself, and it retreated from the forefront. Hundreds of years later, with man unaware of the existence of magic, its hateful energies finally come to the surface with the fury of an atomic bomb.
Beyond that, I leave you with lyrics from The Manhattan Project, by Rush. It really does help to imagine the time when all of this came to be.
Imagine a time when it all began
In the dying days of a war,
A weapon that would settle the score
Whoever found it first
would be sure to do their worst
They always had before...
Imagine a man where it all began
A scientist pacing the floor
In each nation, always eager to explore
To build the best big stick
To turn the winning trick
But this was something more...
The big bang took and shook the world
Shot down the rising sun
The end was begun and it hit everyone
When the chain reaction was done
The big shots tried to hold it back
Fools tried to wish it away
The hopeful depend on a world without end
Whatever the hopeless may say
Imagine a place where it all began
Gathered from across the land
To> work in the secrecy of the desert sand
All of the brightest boys
To play with the biggest toys
More than they bargained for...
Imagine a man when it all began
The pilot of 'Enola Gay'
Flying out of the shockwave on that August day
All the powers that be,
and the course of history
Would be changed forevermore...