The most important factor in motivating students is understanding that motivation is individual. By first learning the students' names and background, and then their learning styles, I can tailor my communication so that all students are motivated per their preferences.
Enthusiasm as an instructor is also key. And always seeking to connect the course material (semantic memory) with real-life experiences of students (episodic memory).
Oh, and positive reinforcement!