PIC16F628 SPI接口應用Application Note 2361
Interfacing an SPI-Interface RTC with a PIC Microcontroller
www.maxim-ic.com
PIN CONFIGURATION
TOP VIEW VCC2 VBAT X1 X2 N.C. INT0 INT1 GND 1 2 3 4 4 5 6 7 8 16 VCC1
Dallas Semiconductor
DS1305
15 PF 14 13 VCCIF SDO
12 SDI 11 SCLK 10 CE 9 SERMODE
DESCRIPTION
The DS1305 real-time clock (RTC) can be interfaced with a microcontroller (mC) using a 3-wire or an SPI interface. This application note shows how to connect a DS1305 to a PIC16F628mC. The DS1306 could also be used in this application. The circuit uses a serial interface for communications. A terminal program with user control of the RS232 DTR control line is required. DTR is used to reset the mC and start code execution. A DS232 is used to perform TTL/RS232 level translation. A schematic of the circuit is sho……