The diode you made mention is acting as a free wheeling diode (read about it).
You know most microcontroller operate on 5V supply ans since they are operating on 5V, they can not source more than 5V.
Check the datasheet of the MOSFET and get back to me. Most MOSFET need to be triggered by a voltage >8V before they can be turned ON.
- - - Updated - - -
I don't know whether what I seeing is actually what you did? If it is then change it (I mean the 12V I am seeing on the 8051). The thumb nail can not be opened by my browser because of network problem.