real time clock - PCF8583


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    maria's Avatar
    maria Guest

    Default real time clock - PCF8583

    Hi there,

    Does anyone out there have PIC BASIC code to interface a PIC (I'm using the PIC16F877) to a PCF8583 real time clock IC?

    Thanks!

    Maria.

  2. #2
    lupuccio's Avatar
    lupuccio Guest


    Did you find this post helpful? Yes | No

    Default Pcf 8583

    Anyone can help me ?
    I'm looking for 8583 routines to read and write data in i2c.
    How can i increase minutes and then rewrite to 8583 ?
    Thanks to all.....

  3. #3
    angelika's Avatar
    angelika Guest


    Did you find this post helpful? Yes | No

    Default

    The pins: sda and scl as inputs or outputs to microcontoller?

    If As outputs:

    sda=1 'high the portx.y, x is the port of micr.,y is the bit of portx.
    scl=1 'high the same as previous

    DECLARE HBUS_BITRATE 100 ' and other values

    TRISC=%00000000 'as outputs

    after you try with:hbstart,hbusout,hbstop (in pic basic functions)

    if you have other problem you ask me.

    regards

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    DECLARE HBUS_BITRATE 100 ' and other values

    TRISC=%00000000 'as outputs

    after you try with:hbstart,hbusout,hbstop (in pic basic functions)
    this will never work with Melabs. In case it's working... you should have a look on that forum
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Mar 2005
    Location
    Novi Sad, Vojvodina
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Hi Maria, Lupuccio and PCF8583 users.

    Code:
    '************************************************* ***************
    ' Ime programa: RTC.BAS
    ' Opis: program ilustruje primenu sata realnog vremena PCF8583.
    ' Za povezivanje sa mikrokontrolerom se koristi I2CREAD
    ' naredba.
    '************************************************* ***************

    DEFINE LCD_DREG PORTD ' I/O port na kome se nalazi LCD
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTD
    DEFINE LCD_RSBIT 2 ' Register select pin
    DEFINE LCD_EREG PORTD
    DEFINE LCD_EBIT 3 ' Enable pin
    DEFINE LCD_BITS 4 ' 4-bitni data bus
    DEFINE LCD_LINES 2 ' LCD ima dva reda karaktera

    symbol SCL = PORTC.3 ' I2C data pin
    symbol SDA = PORTC.5 ' I2C clock pin

    Sec var bit
    B0 var byte
    S var byte ' Sekunde
    M var byte ' Minuti
    H var byte ' Sati
    D var byte ' Dan
    Mn var byte ' Mesec
    Y var byte ' Godina

    OPTION_REG = $7f ' Omoguci PORTB pullup otpornike
    lcdout $fe,1 ' Obrisi ekran displeja
    Main:

    I2CREAD SDA,SCL,%10100001,2,[S]
    I2CREAD SDA,SCL,%10100001,3,[M]
    I2CREAD SDA,SCL,%10100001,4,[H]
    I2CREAD SDA,SCL,%10100001,5,[D]
    I2CREAD SDA,SCL,%10100001,6,[Mn]
    I2CREAD SDA,SCL,%10100001,6,[Y]



    lcdout $fe,1 ' Obrisi displej
    lcdout $fe,2 ' Prvi red prvi karakter
    lcdout "Time: ", hex(H),":", hex(M)," ", hex(S)
    lcdout $fe,$c0 ' Drugi red, prvi karakter
    lcdout "Date: ", hex(D),".", hex(Mn),".20",hex(Y)

    Pause 500
    goto Main ' Ponovi sve

    End ' Kraj programa

  6. #6
    lupuccio's Avatar
    lupuccio Guest


    Did you find this post helpful? Yes | No

    Default 8583

    Thanks to all for the answers.....
    The only problem that i have... ( a big problem ) is set hour and minutes with buttons.
    Unfortunely i haven't the code here.
    Next week i will post my code.
    and then i hope that someone can help me.
    Thanks again to all.

  7. #7
    Join Date
    Apr 2010
    Posts
    2


    Did you find this post helpful? Yes | No

    Default can you help my?

    I'm trying to make a propeller clock with 22 LEDs and was wondering if I can help with handcuffs programming ...... in part to pass the information that the PCF8583 fornesi my PIC (16F877) and passes it to the LEDs ... was shackled to help me say something ... thanks

    ps.: I'm working with miKroC
    Last edited by EAST___; - 14th April 2010 at 10:49.

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Better hit the dedicated door ...

    Hi, East

    You could find much better help on the ... MikroC Forum.

    Here: http://www.mikroe.com/forum/viewforum.php?f=13

    Don't you think ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by EAST___ View Post

    ps.: I'm working with miKroC
    So why post on a forum that deals with picBASIC

  10. #10
    Join Date
    Feb 2006
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Dear EAST

    a "propeller clock with 22 LEDs" is a diferent project.
    It´s not similar than LCD clock, like my code was describe.

    I am sorry, but it's very dferent.

  11. #11
    Join Date
    Apr 2010
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Thanks

    Thanks to all...

Similar Threads

  1. real time clock
    By maria in forum Code Examples
    Replies: 44
    Last Post: - 1st March 2022, 12:13
  2. Real Time Clock
    By in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd June 2012, 04:52
  3. Real time clock ICs
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 66
    Last Post: - 20th October 2008, 16:05
  4. Real Time Clock
    By savnik in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th December 2006, 02:02
  5. Real time clock... what a headache!
    By Eng4444 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 8th June 2006, 21:56

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts