I can testify to this, actually. I had gotten burned out after years of hard grind, and left to go work on a ranch in central California.
It only took a few months being away before I couldn't contain it anymore, and would catch myself building solutions for things in my head, excited to get back to my apartment and code it all out.
It's not always practical, but a break from it all can be really healthy.
Just find another creative outlet. When I can't come up with a solution to a design I'm working on, I just pick up my guitar and play for a bit. Generally the excitement from that exercise gets me back in the mindset to work on the design I'd left. Of course your thing doesn't have to be music. Just explore different topics of interest and see what sticks.
I do the dishes. Since I can go into automatic mode, the hot water loosens me up and I get to daydream. More often than not these dreams can turn into future features for my project. Any chance I can take to daydream I take.
It's a lucid dream that you can get to work immediately after. Letting y imagination run has pushed me to build many things I wouldn't have rationally considered. The dishes are the most sure fire quotidian way to get there.
Have you seen the book "Imagine: How Creativity Works" by Jonah Lehrer? It explains how the above process works in a general way, and it's really interesting. It's a pop-science book, to be sure, but still a really good read.
I think if you're burned out and try to force fun, it won't happen. The fun comes from following inspiration. Like recognizing a pattern in life and thinking 'I know how that works' and playing with some code as a reaction to that inspiration. Not because you think you should or associate yourself with being a programmer or whatever else, but because it just seems like the most natural way to carry on approaching the thing that sparked your interest.
That sounds like an impossible question to answer, without a deeper understanding of who you are, your life experiences and what you've noticed has driven you.
The thing that excites me is when I come to something I don't know how to do, and don't think I could ever know how to do, and then I teach myself it.
I don't know what kind of software you write, but if it were me, and I got tired of writing software for the web, I'd try to pick up writing graphics, or writing native mobile.
Try shifting focus from programming to purpose. It's far easier to "burn out" on code than it is on the ends that programming serves: success of a company, entertainment of users/players, advancement of science, ...
from amazon
"Twyla Tharp, one of America's greatest choreographers, began her career in 1965, and has created more than 130 dances for her company as well as for the Joffrey Ballet, The New York City Ballet, Paris Opera Ballet, London's Royal Ballet, and American Ballet Theatre. "
Well, if you're approaching a senior age, and you've been recognized for your fundamental breakthrough scientific research in computer science - that you made while having fun writing software - maybe you should think also about writing a book, besides perhaps taking that academic position you rightly were offered.