I2C NACK

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
stafvg
Posts: 9
Joined: Tue Jul 10, 2007 9:37 pm

I2C NACK

Post by stafvg »

When you want to use de maxim DS1632 (thermometer) you need a NACK. But in Flowcode I see a start a stop an ack ... but not a NACK. So how can I generate a NACK in flowcode ?
Staf Van Gestel

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: I2C NACK

Post by Sean »

An I2C device only generates an ACK or NACK signal when it has received data. In flowcode the MI2C_Receive_Byte function uses the 'Last(BYTE)' parameter to control the ACK/NACK signal.

If 'Last' is set to zero, an ACK signal is transmitted (data line low) for the clock cycle after a data byte is received.
If 'Last' is not zero, a NACK signal is transmitted (data line high) for the clock cycle after a data byte is received.

The ACK or NACK signal received from the slave device after writing to it using the MI2C_Transmit_Byte function is available as the 'Return Value:(BYTE)'

stafvg
Posts: 9
Joined: Tue Jul 10, 2007 9:37 pm

Re: I2C NACK

Post by stafvg »

Thank you for this anwer.
But I was asking myself, where can I find a help on these macro ? I mean, I find in the help how I can make my own macro, but I can't find any helpinformation concerning this I2C macro's. Is it me or is this information not in the help ?
Staf Van Gestel

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C NACK

Post by Benj »

Hello

Click on the drop down on the I2C component. Then click on properties. Then click on Help.

Or you can browse to the Flowcode V3 folder and open the I2C.hlp file.

stafvg
Posts: 9
Joined: Tue Jul 10, 2007 9:37 pm

Re: I2C NACK

Post by stafvg »

Thanks, I'm finding my way now trough the helpfunction !
Staf Van Gestel

Post Reply