Pic18f252,dacmax518 And I2c?


Results 1 to 4 of 4

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Another version to try
    Code:
        '   Hardware setting
        '   ================
            '
            '
            SDA var PORTC.4 
            SCL var PORTC.3
     
        '   Variable definition
        '   ===================
            '
            '
            Loop VAR Byte
    
        '   Constant definition
        '   ===================
            '
            '
            DACAddressByte con %01011000 ' DAC Address byte
            DACCommandByte con 0         ' DAC command byte
    
        '   Main Loop
        '   =========
            ' this loop will generate simple ramp-up and 
            ' ramp-down on the DAC output
            ' 
            '
    start: 
     
        For Loop = 0 To 255
            I2CWRITE sda,scl,DACAddressByte,DACCommandByte,[Loop]
            Pause 10
            Next
    
        For Loop = 255 To 0 Step -1
            I2CWRITE sda, scl,DACAddressByte,DACCommandByte,[Loop]
            pause 10
            Next
        
        GoTo start
    Last edited by mister_e; - 27th July 2005 at 06:35.
    Steve

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

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. PIC16F877 I2C programme
    By cooqo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 21st April 2008, 10:02
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55

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