Connect with us

program pic16f877a for ds1307

Discussion in 'Microcontrollers, Programming and IoT' started by ElectronicsR, Apr 1, 2016.

  1. ElectronicsR

    ElectronicsR

    72
    1
    Mar 23, 2016
    Hello,
    How to write code for ds1307??
     
  2. Sadlercomfort

    Sadlercomfort Ash

    424
    53
    Feb 9, 2013
    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..
     
  3. ElectronicsR

    ElectronicsR

    72
    1
    Mar 23, 2016
    I don't have CRO oscilloscope can i write code without it?
     
  4. ElectronicsR

    ElectronicsR

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

    Sadlercomfort Ash

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

    What do you mean by earning complete datasheet?
     
  6. ElectronicsR

    ElectronicsR

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

    ElectronicsR

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

    Sadlercomfort Ash

    424
    53
    Feb 9, 2013
    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
     
    ElectronicsR likes this.
  9. Amar Dhore

    Amar Dhore

    129
    12
    Dec 2, 2015
    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.
     
    Sadlercomfort likes this.
  10. ElectronicsR

    ElectronicsR

    72
    1
    Mar 23, 2016
    thanks man people for sorting help.
    i will buy cro then i will go forward
     
  11. ElectronicsR

    ElectronicsR

    72
    1
    Mar 23, 2016
    thanks man people for sorting help.
    i will buy cro then i will go forward
     
    Sadlercomfort likes this.
  12. ElectronicsR

    ElectronicsR

    72
    1
    Mar 23, 2016
    thanks man people for sorting help.
    i will buy cro then i will go forward
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-