Karma: +1/-1
Posts: 9
Offline
|
 |
« Reply #15 on: April 13, 2008, 12:38:11 PM » |
|
Here the initialization code i've used:
void initWiiCam(void) { u08 buf[16]; u08 p0,p1,p2,p3; // Setup IR Sensivity // 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 buf[0]=0x30; buf[1]=0x01; // ?? i2cMasterSend(TARGET_ADDR, 2, buf);//if (== I2C_ERROR_NODEV) buf[0]=0x00; buf[1]=0x02; buf[2]=0x00; buf[3]=0x00; buf[4]=0x71; buf[5]=0x01; buf[6]=0x00; buf[7]=p0; i2cMasterSend(TARGET_ADDR, 8, buf); timerPause(100); buf[0]=0x07; buf[1]=0x00; buf[2]=p1; i2cMasterSend(TARGET_ADDR, 3, buf); timerPause(100); buf[0]=0x1A; buf[1]=p2; buf[2]=p3; i2cMasterSend(TARGET_ADDR, 3, buf); timerPause(100); buf[0]=0x33; buf[1]=0x03; i2cMasterSend(TARGET_ADDR, 2, buf); timerPause(100); buf[0]=0x30; buf[1]=0x08; // ?? i2cMasterSend(TARGET_ADDR, 2, buf); }
If you have to work with Slave Registers try to use buf[0] as Register Address and buf[1]... as Data Bytes.(I think you have done this already) did you wait a view ms between the initialization steps?
If there is no point recognized by the cam all 12 Bytes received are 0xFF. If there's a Point the first 3 Bytes change. Without initialization i get random values too. I think this results from a much to high sensitivity. I try to find some time next week to check out the data format.
|
|
|
|
|
Logged
|
|
|
|
Karma: +1/-0
Posts: 3
Offline
|
 |
« Reply #16 on: April 14, 2008, 08:09:44 AM » |
|
Thanks a lot for your help!
Finally I found the problem! I used always 0xB0 as device address but my I2C controller needs the 7 bit address and automatically shifts it. So by using 0x58 instead of 0xB0 everything works as expected.
Hopefully this will prevent somebody else investing several days of work trying to figure out the error :-)
|
|
|
|
|
Logged
|
|
|
|
|
|
Karma: +0/-0
Posts: 2
Offline
|
 |
« Reply #18 on: August 08, 2008, 11:26:25 AM » |
|
If you look at the schematic on the kako.com website for wiring the 25mhz crystal, there are two crystal capacitors as well as a 0.1uF capacitor. However, if you look closely at the photo of the soldered board, you can see the two crystal caps as well as another two blue caps. I am wondering what the purpose of the second blue cap is since it is not accounted for in the schematic? Does anyone know if it was left out of the schematic or if it is even necessary?
mobes
|
|
|
|
|
Logged
|
|
|
|
Karma: +1/-1
Posts: 9
Offline
|
 |
« Reply #19 on: January 18, 2009, 08:48:48 AM » |
|
|
|
|
|
|
Logged
|
|
|
|
Karma: +0/-0
Posts: 11
Offline
|
 |
« Reply #20 on: January 22, 2009, 06:07:20 PM » |
|
i'm trying to do this using PIC18f4550 could anyone help me i'm a bit confused in the i2c and initialization of the pixart camera.
johnny lee also used the same PIC but i'm using a 40 pin instead of 44 pin PIC.
the 1st step is to initialize the camera right? but how??? via I2C?
|
|
|
|
|
Logged
|
|
|
|
|
|
Karma: +0/-0
Posts: 11
Offline
|
 |
« Reply #22 on: January 29, 2009, 09:16:11 PM » |
|
thanks jojo we had successfully loaded our PIC18f4550 with the bootloader and we would be continuing our experiment with the pixart camera i would post my progress or queries here. thanks again Ü here's a picture of our pixart camera
|
|
|
|
|
Logged
|
|
|
|
Support Admin
Karma: +48/-0
Posts: 1146
Offline
|
 |
« Reply #23 on: January 29, 2009, 10:15:49 PM » |
|
salamat Have you found a source to purchase just the camera? If you have please post here for others. benpaddlejones 
|
|
|
|
|
Logged
|
|
|
|
Karma: +0/-0
Posts: 11
Offline
|
 |
« Reply #24 on: January 31, 2009, 06:24:40 AM » |
|
no sorry but i just removed the camera from an existing wiimote
|
|
|
|
|
Logged
|
|
|
|
Karma: +0/-0
Posts: 11
Offline
|
 |
« Reply #25 on: January 31, 2009, 09:38:51 AM » |
|
hey another problem here Ü can anyone clarify to me if your connecting the pic (micro controller) to the camera via i2c would the voltage in the i2c affect the communication? because in kako's intefacing using arduino kako used a I2C voltage conversion circuit using LTC4301L while in JCL's blog he just said to give the camera 3.3 volts and directly connect it to the SDA and SLA lines + the pull up resistors. or to simplify my question is the camera 5volts tolerant? thanks .. 
|
|
|
|
|
Logged
|
|
|
|
Karma: +1/-1
Posts: 9
Offline
|
 |
« Reply #26 on: February 01, 2009, 06:26:24 AM » |
|
Because there's no datasheet I think knowbody can answer that question. But PIC18F4550 has 3,3 V tolerant inputs. So if you use 3,3V regulator for cam VDD just connect the sda + scl pullups to 3,3V (instead 5V) and it should work without voltage conversion circuit.
|
|
|
|
|
Logged
|
|
|
|
Karma: +0/-0
Posts: 11
Offline
|
 |
« Reply #27 on: February 07, 2009, 08:23:50 PM » |
|
hey were starting to connect the pic and the microcontroller to the pc the problem now is programming the pic. since most of you guys used arduino Micro's the initialization codes we would be using is different from your coding right?
JCL posted a sample initialization code in his blog but we think he left some parts out cause we suspect there are some missing lines.
anyone here knows PIC programming?
|
|
|
|
|
Logged
|
|
|
|
|