D flip flop unwanted reset when driven by microcontroller
You really need to provide a schematic of what the heck you are trying to do with the flip-flop. 

Some things to think about:


Does the power stay active to the flip-flop when the MCU is reset?
When the MCU goes into reset have you looked at what the CLK pin is doing?
What have you done with the PRE or SET pin of the flip-flop?
What have you done with the CLR or RST pin of the flip-flop?


These questions should make you aware that a schematic is essential. 

Also be aware that the GPIO pins on the MCU may not stay in nice clean states when the MCU goes into reset unless you have made some careful design decisions on how to handle the connections to the flip-flop correctly. Once again little direct help can be offered without seeing how you have everything hooked up.