Sponsors of Wiimoteproject.com
IR Pens for Wiimote Whiteboard
Wiimote Project » Forum » General Wiimote and Technology » General Hardware Talk » always 255 output on the sensor (pixart ir camera)
Pages: [1]
  Print  
Author Topic: always 255 output on the sensor (pixart ir camera)  (Read 361 times)
0 Members and 1 Guest are viewing this topic.
*
Karma: +0/-0
Posts: 1
Offline Offline
View Profile Email
« on: June 12, 2009, 11:53:30 AM »

hi its my first post here, i've recently been working with the pixart sensor inside the wii remote however i can't seem to produce the appropriate results..

I'm using a pic18f4455 to interface with the wii sensor directly. The problem is the mcu is always returning 255 even with the sensor not attached.

Is there a way to test if the sensor is acknowledging the signal? or is it possible to test if the sensor itself is working? because it might also be a problem that the sensor itself is broken.

btw im using pullup resistors to the 3.3v and i2c buses.

im using the ff codes for initialization:

Code:
int8 p0,p1,p2,p3;
int8 SLAVE_DEVICE_ADDRESS = 0xB0
// Setup IR Sensivity
//00 00 00 00 00 00 90 00 41     40 00 //max
// p0=0x72; p1=0x20; p2=0x1F; p3=0x03; // Sensitivity 1
   p0=0xC8; p1=0x36; p2=0x35; p3=0x03; // 2
// p0=0xAA; p1=0x64; p2=0x63; p3=0x03; // 3
// p0=0x96; p1=0xB4; p2=0xB3; p3=0x04; // 4
// p0=0x96; p1=0xFE; p3=0xFE; p3=0x05; // 5
i2c_start();
i2c_write(SLAVE_DEVICE_ADDRESS); i2c_write(0x30); i2c_write(0x01);
i2c_stop();
delay_ms(100);

i2c_start();
i2c_write(SLAVE_DEVICE_ADDRESS);
i2c_write(0x00); i2c_write(0x02);
i2c_write(0x00); i2c_write(0x00);
i2c_write(0x71); i2c_write(0x01);
i2c_write(0x00); i2c_write(p0);
i2c_stop();
delay_ms(100);

i2c_start();
i2c_write(SLAVE_DEVICE_ADDRESS);
i2c_write(0x07); i2c_write(0x00);i2c_write(p1);
i2c_stop();
delay_ms(100);


i2c_start();
i2c_write(SLAVE_DEVICE_ADDRESS);
i2c_write(0x1A); i2c_write(p2);i2c_write(p3);
i2c_stop();
delay_ms(100);


i2c_start();
i2c_write(SLAVE_DEVICE_ADDRESS);
i2c_write(0x33); i2c_write(0x03);
i2c_stop();
delay_ms(100);

i2c_start();
i2c_write(SLAVE_DEVICE_ADDRESS); i2c_write(0x30); i2c_write(0x08);
i2c_stop();
delay_ms(100);

i hope some of you guys who have worked with PIC mcu's can help me..

thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v.1.0.6 beta 2 © Bloc
Clicky Web Analytics