Maker Pro
Maker Pro

program pic16f877a for ds1307

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
I would advise you to read the datasheet for the ds1307, if you haven't already: http://datasheets.maximintegrated.com/en/ds/DS1307.pdf

The ds1307 uses the Synchronous Serial Port (SSP) Module. It operates in I²C mode and is connected too the PIC using the SDA and SCL pins.



Assuming your using a PIC..

The SSP Module has five registers for I²C mode, which need to be setup to interface correctly. An overview on how to do this can be found on pages 15-17 here: http://ww1.microchip.com/downloads/en/DeviceDoc/33023a.pdf

If your PIC supports SSP, you can find more detailed information about each register in the datasheet.


Reading things isn't fun, but it helps..
 

ElectronicsR

Mar 23, 2016
72
Joined
Mar 23, 2016
Messages
72
I don't have CRO oscilloscope can i write code without it?
how to earn complete data sheet
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
You wont need an oscilloscope to help you write code.

What do you mean by earning complete datasheet?
 

ElectronicsR

Mar 23, 2016
72
Joined
Mar 23, 2016
Messages
72
ok,
i will try to search it
and how understand complete data sheet of pic or avr embedded system
 

ElectronicsR

Mar 23, 2016
72
Joined
Mar 23, 2016
Messages
72
ok,
i will try to search it
and how understand complete data sheet of pic or avr embedded system
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
You do not need to learn the entire datasheet, but just familiarize yourself with the basics and how the relevant registers tie in with each other. I would learn about the relevant registers first and which commands to use to set each register. I've listed the relevant ones below.


The Synchronous Serial Port (SSP) module has five registers for I2C operation. They are:
• SSP Control Register (SSPCON)
• SSP Status Register (SSPSTAT)
• Serial Receive/Transmit Buffer (SSPBUF)
• SSP Shift Register (SSPSR) - Not directly accessible
• SSP Address Register (SSPADD)



Also, familiarize yourself with the SDA and SCL pins and how to set up the ports.

Sorry its around page 237.
http://ww1.microchip.com/downloads/en/DeviceDoc/33023a.pdf
 

Amar Dhore

Dec 2, 2015
129
Joined
Dec 2, 2015
Messages
129
As Sadlercomfort said, First you should know how the SPI communication works, then its easy to implement it in the Micro. You should go through some sample examples source code just to understand it.
 
Top