View previous topic :: View next topic |
Author |
Message |
kd5uzz
Joined: 28 May 2006 Posts: 56
|
|
Posted: Mon Nov 26, 2007 11:36 am |
|
|
It works! Thanks PCM Programmer. I had in fact swapped the SCL and SDA lines just before break (and before you posted your code). Thanks again!
-Daniel |
|
|
sodb
Joined: 30 Nov 2007 Posts: 1
|
|
Posted: Fri Nov 30, 2007 5:27 pm |
|
|
Thank guys. I was trying the same thing for a few weeks and just got all 0xff back from the nunchuck. I use a 18f242 running on 3V. Using the correct address 0xA4 it works like a dream. This is just an intermediate step in connecting the nunchuck g-sensor to a Lego Mindstorm NXT (internally using also i2c). Using the PIC I at least know that the nunchuck & I2C is working as it should. |
|
|
joven
Joined: 30 Jan 2007 Posts: 56 Location: Viana do Castelo - Portugal
|
|
Posted: Mon Dec 22, 2008 10:13 am |
|
|
Did you need to decode the data received or not?
|
|
|
Kova
Joined: 06 May 2007 Posts: 35
|
|
Posted: Fri May 29, 2009 11:58 pm |
|
|
PCM programmer wrote: | You've already gone through two units. I suggest you cut off the
connector and get it running. |
Hi,
I have resumed this thread for a question.
I want to emulate the nunchuck or the classic wii controller.
I'm explaining better.
This is my goal:
I want to connect a interface with a PIC to Wiimote:
Wiimote <--> PIC interface (for example it emulates only the A key).
This interface will be able to emulate, for example, the A wii classic controller key.
I have readed all documentation about the protocol, but I don't understand very well how can I do that.
Many articles explain how to connect the wii-controllers (nunchuck-classic controll) to a PC or a MCU (for example arduino).
Somebody can help me?
What is the initial handshaking?
My interface will be a slave in the I2C communication, right?
After this:
The communication between the Wiimote and the Extension Controllers is 400kHz "fast" I2C, with the slave address 0x52.
What are the other packets/reports that I have to send?
A pseudo-code also will be great.
Thanks a lot for all.
Bye guys . |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat May 30, 2009 1:25 am |
|
|
You have dreamed up a project, but then you propose that we should
research the protocol and write an outline of the code for you.
Shouldn't you be the one to do this ?
|
|
|
Kova
Joined: 06 May 2007 Posts: 35
|
|
Posted: Sat May 30, 2009 2:14 am |
|
|
PCM programmer wrote: | Shouldn't you be the one to do this ?
|
Naaa, It's not so.
I want only to know what are the "packets" that wiimote <--> interface have to send/receive.
The code is not a problem.
If you say me these:
Wiimote send 0xff at 0xA4 address
Interface send 0x01 at 0xA4.. etc.
for me will be enough
I have readed the documentation but many docs say only the packet that wiimote sends when a controller is plugged, but I haven't readed nothing about the response given by the nunchuck/wii classic (the handshaking)
Am I blind?
;)
Bye |
|
|
ricard0g0mes
Joined: 19 May 2009 Posts: 6
|
|
Posted: Tue Jul 21, 2009 1:57 am |
|
|
hello,
I'm trying to use this code but my project works at 20Mhz.
Do I need to change it to a lower value to work with i2c?
How can I define the speed of the i2c communication?
My pic is a 18f4550.
thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jul 21, 2009 11:00 am |
|
|
Just set the oscillator #fuses statement to HS (instead of XT) and set
the #use delay() statement to 20 MHz.
If you do that, CCS will automatically use the same speed for the i2c
clock (or as close as possible). |
|
|
btklister
Joined: 16 Jul 2009 Posts: 14
|
|
Posted: Sat Jun 26, 2010 7:28 pm |
|
|
The code posted in the previous page works for a Chinese wireless nunchuk? The addresses are the same? |
|
|
|