Many thanks Jean-Yves and Björn for your replay. I appreciate your help!
I usually program the PICs (18Fxxx family) in C, then I looked for a library for my compiler for the ADS1115 and together with the ADC Datasheet I performed reverse engineering.
The result has been positive and I now have a method to be able to read any of the 4 Analog inputs of the IC. From the tests I have carried out it works well, then I leave the code here in case it is of interest to someone who has to access this ADC.
Rgrds, Pablo EA4TX
Var FileHandle As Integer
Var Data As Integer
Var MyADC1 As UInt16
Var Reg0 As UInt8
Var Reg1 As UInt8
Var Reg2 As UInt8
Var mb As New MemoryBlock(4)
Var buf As New MemoryBlock(3)
Const HEX48 = &b1001000 //Hex 48
Const HEX49 = &b1001001 //Hex 49
Const HEX4A = &b1001010 //Hex 4A
Const HEX4B = &b1001011 //Hex 4B
Const ONESHOT_ON = &b10000001
Const ONESHOT_OFF = 0
Const AI0 = &b01000000
Const AI1 = &b01010000
Const AI2 = &b01100000
Const AI3 = &b01110000
Const GAIN1 = &b00000000 //Full Scale Voltage is: 6.144 + or -
Const GAIN2 = &b00000010 //FS 4.096
Const GAIN3 = &b00000100 //FS 2.048 (defecto)
Const GAIN4 = &b00000110 //FS 1.024
Const GAIN5 = &b00001000 //FS .512
Const GAIN6 = &b00001010 //FS .256
Const GAIN7 = &b00001100 //FS .256
Const GAIN8 = &b00001110 //FS .256
pi = New pigpio
Call pi.gpioInitialise()
pi.Handle = pi.pigpio_start(Nil, Nil)
FileHandle = pi.i2c_open(1, HEX48,0)
’ Set OneShot + AN1 + Gain3
Reg0 = 1
Reg1 = ONESHOT_OFF + AI1 + GAIN3
Reg2 = &h85
’ Load 3 Registers
buf.Int8Value(0) = Reg0
buf.Int8Value(1) = Reg1
buf.Int8Value(2) = Reg2
Data = pi.i2c_write_device(FileHandle,buf, 3)
’ Read ADC1
MyADC1 = pi.i2c_read_word_data(FileHandle,0)
’ Swap the bytes around
mb.UInt16Value(0) = MyADC1
mb.LittleEndian = Not mb.LittleEndian
MyADC1 = mb.UInt16Value(0)
’ output the digital value (ADC1)
Print "ADC = " + CStr(MyADC1)