News:

Let's find out together what makes a PIC Tick!

Main Menu

some issue with I2Cout

Started by Yves, Today at 07:35 AM

Previous topic - Next topic

Yves

hello all,
I'm getting an error: "Item is missing (MCP_3422.inc" when I compile the program
this is for:
I2COut PORTA.0, PORTA.1, cMCP34_SlaveAddress, [bConfig]
and
I2CIn PORTA.0, PORTA.1, cMCP34_SlaveAddress, [Result.Byte2,_      ' Read the high byte of the 24-bit ADC value
                                                Result.Byte1,_      ' Read the mid byte of the 24-Bit ADC value
                                                Result.Byte0,_      ' Read the low byte of the 24-Bit ADC value
                                                bConfig]
I know the protocol should be:
I2Cout SDA_Pin, SCL_Pin, Control, { Address }, [ OutputData ]
and
I2Cin SDA_Pin, SCL_Pin, Control, { Address }, [ Variable {, Variable...} ]

Obiously Control is missing. I have not yet grasp what Control should be?

what is strange I'm not getting this error in the original code but only when i place the MCP_3422.inc driver. Can you please help in this matter.

cheers

Yves

Yves

flosigud

Control is device addrees + r/w bit. It is the number any scanner will show you.

Yves

Well it is getting weirder, the routine was in an include file but when I moved the routine to the main .bas code the problem went away.

cheers
Yves
Yves

RGV250

Hi,
Where was the INC file, if you modified it and then changed directory you might have that issue. If it is not one supplied with PDS I always keep them in the same directory as the project.

Bob

Yves

All my included files always reside in the same folder than the main .bas file I checked it my temporary removed it to see what happens. Frankly is the first time it happens. Now the Include routine code was copied and pasted in the main program and by magic  there are no more errors.
Yves