l7805 regulator circuit
My friend, I think you missed the point!
The driving voltage of the MOSFET and the power supply of the F86 are two different things.
Note the following: The L7805 is a constant power supply to your PIC, therefore regardless the PIC operation it will continue output to the PIC. These devices are disipating a lot of power and a good approach on designing such circuits is to put an aluminum heat sink.
But you can also follow this configuration: Moving down from 24V DC to 5V DC is a 19V drop that can make your IC capable to cook eggs! Try designing a three stage voltage stepper. First step will drop voltage from 24V to 15V. Second step from 15V to 9V and third one from 9V to 5V. By using this configuraion you will have less power disipation. You will ofcource need to use aluminum heat sink to all three ICs, but now the heat will be much less. I guess that there are devices like L7815, L7809 or similar values.
Trust me, it will work.
And always remember: Your motor is drived by the MOSFET that is drived ( open/closed) by the PIC. There is no way that the voltage through the PIC is ending in the motor!
D.