NAU7802 load cell i2c code

hax

New Member
Hi all,

I have purchased a sparkfun NAU7802 board and wish to use an 08M2 to communicate with it.

Has anyone here used this chip before? There are no forum search results, so I'm guessing not.

Just thought I'd ask before I go reinvent the wheel. In any case, I'll post working code here once I figure it out.
 

hax

New Member
25654

Can't seem to get past step one......

Here is my code:

hi2cSetup i2cmaster, $2A, i2cslow, i2cbyte
main:
hi2cout $00,($06)
hi2cin $00,(b1,b2)
debug
goto main


The datasheet says to send hex 06 into the 00 register so that it powers up the internal analog and digital circuits. Then to check bit 3 of address 00 to make sure it is received.

When I run this code, I get all binary 1's, that is 11111111,11111111.


I have pullup resistors installed.... and I tried a few other commands, but I'm just getting 1's wherever I read.

Any ideas?
 

inglewoodpete

Senior Member
It looks like the NAU is not responding to the message that you are sending it. To me, this suggests that $2A is not correct. Try $54 as the address for the chip in the SetUp command. The NAU datasheet has expressed its slave address in 7-bit format, while PICAXE uses 8-bit addressing, so you need to shift the address 1 bit to the left.
 
Last edited:
Top