How much can 328p handle?

int32_t freq = frequency * 4294967295/125000000;

I doubt that that will work. It would have a better chance if you force the size of the integers and get 2^32 right:

int32_t freq = frequency * 4294967296LL/125000000L;

Pete