Thanks for the query.
After undergoing miscarriage
it will take some time for regrowth of the endometrium.
The time of onset of periods after miscarriage differ from person to person.
Usually it will take around 2 weeks for the resumption of Ovulation.
So if you had unprotected intercourse
around that period, there is possibility of pregnancy
The spotting you had could be:
-Post ovulatory Spotting
-Spotting in the early pregnancy etc.
So, once consult gynecologist, get examined and go for ultrasound
By this the possible cause for your problem can be identified and treated.
Better to have 2 to 3 months gap after miscarriage for better recovery.