An update
I have been able to get the nunchuck interfaced to a Picaxe 28x2 chip. ( based on the PIC18F2520 ) Though I clock this chip with a 16 mz res, the clock speed must be slowed in the program by using a command modifier (_16) This gives the chip a speed of 8 mhz. According to the Picaxe data sheet on I2C, I2C devices come in 2 basic speeds, slow - 100,000 HZ and fast - 400,000 HZ. Both fast and slow can be used at slower speeds. (there is a third standard over 400K, but that is rarely used) The nunchucks run at the slower speed of 100k.
The basic code with the Picaxe is:
Code:
hi2csetup i2cmaster, $A4, i2cslow_16, i2cbyte
i2cwrite ($40,$00)
pause 1
Loop
writei2c (0)
pause 1
readi2c (b1,b2,b3,b4,b5,b6)
Goto Loop
A little explanation; In the hi2csetup line,i2cmaster sets the processor as the master, $A4 is the nunchucks address, I2cslow_16 tells the processor what the device speed is and i2cbyte tells the processor that the device recieves data in bytes as opposed to words (2 bytes).
Note that here, my circuitry is being powered by 5 volts and not the 3.3V I used with the Basic Micro.
Soooo, there are a few differences here as opposed to what I did with the Basic Micro. Next step is to try and reconcile these with the Basic Micro chip.
I'll post my results as soon as I can. If any one has suggestions, please chime in.
As always, thanks
Jim