Burnout is always a tough thing to deal with, and I've definitely suffered from it in the past. By no means have I solved the issue for myself - I'm still constantly trying new ways to prevent it - but one that has certainly helped is having a variety of things to do.
If you're someone who specializes in one programming language and have issues with burnout, I suggest trying to pickup something new. That doesn't mean learn Java if you're a C++ programmer - both are backend - try something on the opposite end of the spectrum like some HTML and CSS. If you're strictly a frontend developer, try familiarizing yourself with Bash-Scripting to make tools that will speed up your development process.
It's not just varying programming languages that helps; some days I'll just sit back and read/learn about technical stuff (whether it be programming languages, unix, databases, etc) which I still find productive. Others I will focus more on the entrepreneurial side of things and work on planning out the company's future, taking in advice, or reaching out to others. Lately I've spent a good chunk of time reading questions and answers from successful entrepreneurs on Quora. One more option of productivity that I've been using lately, is writing my thoughts on this blog, which I enjoy.
I know many of my readers aren't programmers, but I'd argue this applies to everything in life that one can be burnt out on. A little bit of variance and changing things up can go a long way. For example, my girlfriend and I were having salmon and shrimp 4 or 5 days a week when we started the Paleo diet. The result of this was after a few weeks we started to despise fish and subsequently haven't had it in over a month. Had we just been eaten it once or twice a week, I'm sure that would still be a meal in our repertoire. Routines can be good, but with certain things routines need to be switched up every so often to stay fresh and prevent burnout.