Comment Just in case you read down this far (Score 1) 601
I don't believe anyone ever reads all of the replies to a posting like this, but just in case....
I work from home & like to build little models as a hobby. When I get to the point that I just don't want to code any more, I go into the hobby room & spend a bit of time building or painting something. While I'm doing that, I try to think of something appealing that needs coding as part of the overall progress required, and how I need to unit test that new piece. After an overnight (or two) break, I can generally get the oomph to start coding again.
If the motivation doesn't come back in a day or two, it's time for a serious break - do something else for a month. A river cruise up the Nile is a good holiday.
If you are working in an office, look for another job, nothing is worth the burnout. I made the mistake of continuing in a project for 18 months after I knew it was time to leave, and 2 years later I am still recovering my motivation (and sanity).