ds 1307


Closed Thread
Results 1 to 15 of 15

Thread: ds 1307

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Question ds 1307

    great program must have taken a lot of work

    any way to get a schematic diagram or hook up sheet??

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


    Did you find this post helpful? Yes | No

    Default

    Euh... i don't see why as almost everything is really well explained in the hardware assignment section of the code.
    Steve

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

  3. #3


    Did you find this post helpful? Yes | No

    Default hookup

    ok will try that
    one more question trying to use with a 16f877a
    get error messag but compiles

    102 crosses boundry at @800h
    already got protype board for this setup for this chip

    any ideas?

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


    Did you find this post helpful? Yes | No

    Default

    http://www.picbasic.co.uk/forum/show...osses+boundary

    It's just a warning, nothing important. If you're using MPASM to compile your code, just add
    Code:
    @    errorlevel -306
    and this will remove this stupid warning.

    And, here's another endorsement
    http://www.picbasic.co.uk/forum/show...02&postcount=1

    At least, i don't feel alone
    Last edited by mister_e; - 3rd February 2007 at 19:23.
    Steve

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

  5. #5


    Did you find this post helpful? Yes | No

    Default error

    ok howeve i am not using mpsam
    get lot more errors in program with this

    thanks
    for your help

  6. #6
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi jcleaver,

    You could save everyone alot of time and sanity if you would just post, for example, the errors you ARE getting and what compiler and assembler and version levels you are using. Perhaps even a screenshot of the list of errors from your program.

    The program Mister-E referred you to was written for a 16F628. You are using a 16F877A. I apologize if I assume something here but you will have to make a number of setting changes to port over to the 877A. Analog ports on the 877A not on the 628, config fuse settings, etc.

    We can help but give us the data we need!

    BobK

  7. #7


    Did you find this post helpful? Yes | No

    Default more info

    did finally get something to work attached program but for some reason i am unable to duplicate this again seems to be the clock wont start
    using pbp and mcs tried using mpspam with this but too many errors to count if someone could look over this listing and explain why the clock is not starting once itruns which i dont know how i got there it does what i want


    thanks

    ' PicBasic Pro program to display result of
    ' 8-bit A/D conversion on LCD
    '
    ' Connect analog input to channel-0 (RA0)
    @ DEVICE pic16f877a, HS_OSC, WDT_ON, PWRT_ON, LVP_OFF, PROTECT_OFF

    ' Define LCD registers and bits
    Define LCD_DREG PORTB ' Port for LCD Data
    Define LCD_DBIT 4 ' Use upper 4 bits of Port
    Define LCD_RSREG PORTB ' Port for RegisterSelect (RS) bit
    Define LCD_RSBIT 3 ' Port Pin for RS bit
    Define LCD_EREG PORTB ' Port for Enable (E) bit
    Define LCD_EBIT 2 ' Port Pin for E bit
    Define LCB_BITS 4 ' Using 4-bit bus
    Define LCD_LINES 2 ' Using 2 line Display
    Define LCD_COMMANDUS 2000 ' Command Delay (uS)
    Define LCD_DATAUS 50 ' Data Delay (uS)




    DEFINE OSC 20
    ' Define ADCIN parameters
    Define ADC_BITS 8 ' Set number of bits in result
    Define ADC_CLOCK 3 ' Set clock source (3=rc)
    Define ADC_SAMPLEUS 50 ' Set sampling time in uS
    define loader_used 1
    adval var byte ' Create adval to store result
    AD33 VAR BYTE
    W1 VAR WORD 'PUSHBUTTON
    I VAR WORD
    TRISA = %11111111 ' Set PORTA to all input
    TRISD = %11111111 ' SET PORTD TO INPUT
    ADCON1 = %00000010 ' Set PORTA analog
    ' Low PORTE.2 ' LCD R/W line low (W)
    ' Define I2C bus ports
    B0 VAR BYTE
    B1 VAR BYTE
    B2 VAR BYTE
    SDA VAR PORTC.4 'DS1307 SDA pin
    SCL VAR PORTC.3 'DS1307 SCL pin
    DEFINE I2C_SLOW 1
    DEFINE I2C_HOLD 1
    DEFINE I2C_SCLOUT 1
    Pause 500 ' Wait .5 second
    ADDR VAR BYTE
    ADDR = 0
    PAUSE 1000
    CONT CON %11010000

    secs var byte
    mins var byte
    hrs var byte
    day var byte
    date var byte
    month var byte
    year var byte
    ctrl var byte



    I2CWRITE SDA,SCL,CONT,ADDR,[$00,$59,$11,$03,$25, $12 ,$03, $10]
    PAUSE 5000
    I2CREAD SDA,SCL,CONT,ADDR ,[b2]
    loop:

    COUNT portd.1,750,w1
    lcdout $fe,1
    pause 1000

    lcdout $fe,$80+4 ,"count: ", dec w1
    pause 500
    I2CREAD SDA,SCL,CONT,ADDR ,[secs,mins,hrs,day,date,month,year,ctrl]
    pause 500
    ADCIN 0, adval ' Read channel 0 to adval
    ADCIN 1, AD33
    Lcdout $fe, 1 ' Clear LCD
    Lcdout "Value: ", # adval ' Display the decimal value
    LCDOUT $FE,$C0, "VALUE : ", DEC AD33
    Pause 500 ' Delay for .5 seconds
    lcdout $fe,1 ' clear display
    lcdout "min: ", hex mins
    lcdout $FE,$C0,"secs: ",hex secs
    pause 1000



    Goto loop ' Do it forever
    End

Similar Threads

  1. 1307 RTC accuracy?
    By amgen in forum General
    Replies: 16
    Last Post: - 6th October 2008, 18:03
  2. Need help PIC 18F2550 with DS 1302
    By christina86 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 28th December 2007, 01:05
  3. ds 1307
    By jcleaver in forum mel PIC BASIC
    Replies: 2
    Last Post: - 30th June 2007, 12:28
  4. ds 1307 revisted
    By jcleaver in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 17th February 2007, 14:10
  5. DS 1620 Code example?
    By G-R-C in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th September 2006, 02:45

Members who have read this thread : 0

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