Has anyone tried AI with PICBASIC


+ Reply to Thread
Results 1 to 40 of 97

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,935

    Default Re: Has anyone tried AI with PICBASIC

    What is the purpose of this line?

    i2cwrite i2dta, i2clk, $48,$0 'convert

    Ioannis

  2. #2
    Join Date
    Feb 2013
    Posts
    1,096

    Default Re: Has anyone tried AI with PICBASIC

    I understand this as "start conversion(measurement)"

    As said in 2. of quote from the datasheet.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,455

    Default Re: Has anyone tried AI with PICBASIC

    are we still talking about a ds3231 ?

    if so then if chat gpt leads you to this there something terribly wrong


    DO
    i2cwrite i2dta, i2clk, $48,$01,[132,131] 'write config
    pause 10
    i2cwrite i2dta, i2clk, $48,$0 'convert
    pause 10
    i2cread i2dta, i2clk, $48,[data1,data2] 'read data
    serout2 portc.5,90, ["adc=",dec data1, dec data2,13,10]
    LOOP
    this is incorrect on so many levels starting with device address, conversion time and virtually every thing from there on
    Warning I'm not a teacher

  4. #4
    Join Date
    Feb 2013
    Posts
    1,096

    Default Re: Has anyone tried AI with PICBASIC

    No, this is ADS1115, as mentioned in comments in above post.

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,455

    Default Re: Has anyone tried AI with PICBASIC

    No, this is ADS1115
    ok that changes things a little.
    its now incorrect on so many levels starting with device address and virtually everything from there on
    i2cwrite i2dta, i2clk, $48,$0 'convert is not a legitimate i2c command either
    Warning I'm not a teacher

  6. #6
    Join Date
    Feb 2013
    Posts
    1,096

    Default Re: Has anyone tried AI with PICBASIC

    Yes I know it is not legitimate, but compiler does not give any errors or warning, so it is not a bug, it is a feature?
    and I don't see any issues with IC address - it is done according to datasheet.

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,455

    Default Re: Has anyone tried AI with PICBASIC

    I don't see any issues with IC address - it is done according to datasheet.

    1. Write to Config register:
    – First byte: 0b10010000 (first 7-bit I2C address followed by a low R/W bit)
    – Second byte: 0b00000001 (points to Config register)
    – Third byte: 0b10000100 (MSB of the Config register to be written)
    – Fourth byte: 0b10000011 (LSB of the Config register to be written

    when has a 7 bit i2c slave address ever worked in pbp?
    Warning I'm not a teacher

Similar Threads

  1. conversion from picbasic to picbasic pro
    By winjohan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st November 2011, 18:00
  2. Proton PICBASIC vs MeLabs PICBASIC
    By Fredrick in forum General
    Replies: 22
    Last Post: - 11th January 2008, 21:51
  3. PICBasic Pro vs Proton PICBasic
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd November 2006, 16:11
  4. picbasic 2.46
    By jojokatada in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th April 2005, 03:34
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 21:19

Posting Permissions

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