PBP3 and DS1307


Closed Thread
Results 1 to 3 of 3

Thread: PBP3 and DS1307

  1. #1
    Join Date
    Feb 2014
    Posts
    2

    Default PBP3 and DS1307

    Hello
    I have a problem with PBP3 compiler.
    I make a little program on PIC12F1840 with intern oscillator at 16MHz.
    I connect a DS1307 and I use only internal I2C Ram.
    I made a first test :

    test_ram:
    'Writing RAM $08 -> $3F
    ram_erreur=0
    for l=0 to 255
    for k=08 to $3F 'writing ram
    i2cwrite sda,scl,$D0,k,[l]
    next k
    for k=08 to $3F 'reading ram
    i2cread sda,scl,$D0,k,[m]
    if m<>l then
    ram_erreur=1
    endif
    led2=!ram_erreur
    next k
    next l
    goto test_ram

    For values of "L" between $00 to $7F, Iam reading the value writen befor but for values of "L" between $80 to $FF, I am reading the value with the 7's bit=0 so, 80 ->00, $81 ->$01, ... $FF -> $0F.
    I dont see error in my little code.
    Could you help me ??
    Best regards

    Marc

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: PBP3 and DS1307

    The part is only 64 bytes. According to the data sheet:

    The RTC registers are located in address locations 00h to 07h. The RAM registers are located in address locations 08h to 3Fh. During a multibyte access, when the address pointer reaches 3Fh, the end of RAM space, it wraps around to location 00h, the beginning of the clock space.

    Which is why you see what you see when you try to access data greater that 64 bytes (0x3F).
    Tim Barr

  3. #3
    Join Date
    Feb 2014
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: PBP3 and DS1307

    Hello

    Yes of course but it's correct for my device.
    I found my error.
    The adress pointer was a word but not a byte and the compiler accept and the DS1307 works bad.

    Best regards

    Marc

Similar Threads

  1. I really need some help with PBP3
    By Ramius in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th February 2012, 16:05
  2. Pbp3
    By rcbandwidth in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 18th September 2011, 14:13
  3. What's with PBP3?
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th August 2011, 17:09
  4. ds1307
    By jonas2 in forum Code Examples
    Replies: 0
    Last Post: - 2nd November 2009, 09:50
  5. DS1307 help
    By Orlando in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th March 2005, 15:17

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