With the rapid development of the electronic information and the computer technology, ships are turning to the intelligent, automated and digital direction. The digital magnetic compass has higher system integration and navigation accuracy than the traditional magnetic compass. This paper describes how to design hardware and software of the digital magnetic compass navigation system. The magnetic sensor (HMR3300 three-dimensional solid-state digital compass) feels the local magnetic field and transmits it to the MCU through the data transfer, then the MCU computes the data after receiving them, then the MCU extracts three parameters: the direction, the pitching angle and the rolling angle, which are displayed on the LCD and PC at last.