Imaging solutions with Free Software & Open Hardware

Who's online

There are currently 0 users online.

Tensorflow with gpu

Wiki Recent Changes - Thu, 04/26/2018 - 12:42

← Older revision Revision as of 18:42, 26 April 2018 (3 intermediate revisions by the same user not shown)Line 5: Line 5:    81:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)   81:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)  * check driver version * check driver version −  ~$ modinfo nv[TAB]+  ~$ cat /proc/driver/nvidia/version  + NVRM version: NVIDIA UNIX x86_64 Kernel Module  387.26  Thu Nov  2 21:20:16 PDT 2017  + GCC version:  gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)  * install cuda 9.0 with patches * install cuda 9.0 with patches    https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal   https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal Line 15: Line 17:    ~$ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}   ~$ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}    ~$ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}   ~$ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}  +*  + ~$ nvidia-smi  + Thu Apr 26 12:39:25 2018       + +-----------------------------------------------------------------------------+  + | NVIDIA-SMI 387.26                Driver Version: 387.26                    |  + |-------------------------------+----------------------+----------------------+  + | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |  + | Fan  Temp  Perf  Pwr:Usage/Cap|        Memory-Usage | GPU-Util  Compute M. |  + |===============================+======================+======================|  + |  0  GeForce GT 610      Off  | 00000000:81:00.0 N/A |                  N/A |  + | N/A  31C    P8    N/A /  N/A |    148MiB /  956MiB |    N/A      Default |  + +-------------------------------+----------------------+----------------------+  +                                                                                 + +-----------------------------------------------------------------------------+  + | Processes:                                                      GPU Memory |  + |  GPU      PID  Type  Process name                            Usage      |  + |=============================================================================|  + |    0                    Not Supported                                      |  + +-----------------------------------------------------------------------------+ Oleg

Tensorflow with gpu

Wiki Recent Changes - Thu, 04/26/2018 - 12:27

Created page with "==Pre== * check device ~$ lspci | grep NVIDIA 81:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1) 81:00.1 Audio device: NVIDIA Corporation..."

New page

==Pre==
* check device
~$ lspci | grep NVIDIA
81:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1)
81:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)
* check driver version
~$ modinfo nv[TAB]
* install cuda 9.0 with patches
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
* then
sudo apt-get install cuda-9-0

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions
*
~$ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
~$ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} Oleg

04/25/18 [meta-elphel393][master-next] by Oleg Dzhimiev: added cron

Elphel GIT logs - Wed, 04/25/2018 - 17:25
Oleg Dzhimiev committed changes to the Elphel git project :
added cron

04/24/18 [linux-elphel][rocko] by Oleg Dzhimiev: read rtc even if OF flag is set, report

Elphel GIT logs - Tue, 04/24/2018 - 13:19
Oleg Dzhimiev committed changes to the Elphel git project :
read rtc even if OF flag is set, report

04/24/18 [elphel-web-393][] by Oleg Dzhimiev: auto exposure on/off

Elphel GIT logs - Tue, 04/24/2018 - 13:14
Oleg Dzhimiev committed changes to the Elphel git project :
auto exposure on/off

04/21/18 [imagej-elphel][master] by AndreyFilippov: Debugging LMA for correlation maximums

Elphel GIT logs - Sat, 04/21/2018 - 17:08
AndreyFilippov committed changes to the Elphel git project :
Debugging LMA for correlation maximums

04/21/18 [imagej-elphel][master] by AndreyFilippov: fitting correlation maximum with LMA

Elphel GIT logs - Sat, 04/21/2018 - 17:03
AndreyFilippov committed changes to the Elphel git project :
fitting correlation maximum with LMA

Implementing a linux driver for an image sensor for NC393

Elphel Development Blog - Fri, 04/20/2018 - 12:48

Fig.1 MT9F002

MT9F002

This post briefly covers implementation of a driver for On Semi’s MT9F002 14MPx image sensor for 10393 system boards – the steps are more or less general. The driver is included in the latest software/firmware image (20180416). The implemented features are programmable:

  • window size
  • horizontal & vertical mirror
  • color gains
  • exposure
  • fps and trigger-synced ports
  • frame-based commands sequence allowing to change settings of any image up to 16 frames ahead (didn’t need to be implemented as it’s the common part of the driver for all sensors)
  • auto cable phase adjustment during init for cables of various lengths


 

Setup
  • Get the register reference document for MT9F002
  • Setup the Eclipse IDE for linux kernel development – see instructions

 

Capturing images without the driver

There is a set of scripts used for verification in software (on PC) and hardware (on the target board). Among other things they can be used to establish initial communication with a sensor, run registers initialization and acquire the first images. The process for MT9F002 is described on our wiki.
 

Driver implementation

In general the driver can be split into 2 parts:

  • common for all sensors – sets up working with fpga frame-based command sequencers (see NC393 development progress and the future plans).
  • sensor specific – commands that do actual communication with a sensor. This is the part needs to be implemented.

For a sensor there are a few tables and a few functions, the most important ones are:

tables:

  • mt9f002_pages – a ‘page’ is the upper byte of a 16-bit register address of the sensor (for 8-bit reg addresses the page number is 0x00), the table should list all available pages in the sensor – or at least the most important ones – they are used to program fpga’s 256-max records per port tables used to write commands and at least one record is used to read from port – so in general for a setup w/o a MUX board the limit of allowed pages per sensor is 256-1 = 255 (with a MUX + 3x sensors on a single port it is 256-2(mux write & read)-4(3x sensor read + 1x broadcast read))/4 = 62)
  • mt9f002_par2addr – used convert 256 8-bit parameters available as P_SENSOR_REGSxxx to 16-bit register address
  • mt9f002_ahead_tab – sequencer commands latencies – leave default, they are needed on the final stages of development

functions (they are registered on top of the common ones):

  • mt9f002_pgm_detectsensor – remove reset read sensor id
  • mt9f002_pgm_initsensor – init registers that select interface, sensor’s PLL multipliers/dividers and other required settings
  • mt9f002_pgm_exposure – program exposure
  • mt9f002_pgm_window – program image width and height
  • mt9f002_pgm_limitfps – limit fps based on compressor capabilities and trigger period settings
  • mt9f002_pgm_gains – program color gains
  • mt9f002_pgm_triggermode – set sensor in triggered mode
  • mt9f002_pgm_sensorregs – write sensor registers directly

See this article for more details.

 

Tmp manual

Wiki Recent Changes - Thu, 04/19/2018 - 17:55

‎Changelog

← Older revision Revision as of 23:55, 19 April 2018 Line 287: Line 287:  ===Changelog=== ===Changelog===    <font size='1'>'''==20180416=='''   <font size='1'>'''==20180416=='''  + * 20180419 - mt9f002: fixed changing window size    * mt9f002: added triggered mode   * mt9f002: added triggered mode    * mt9f002: added vertical and horizontal flips (mirror)   * mt9f002: added vertical and horizontal flips (mirror) Oleg

04/19/18 [linux-elphel][rocko] by Oleg Dzhimiev: fixed bad frames for mt9f002 when changing window size

Elphel GIT logs - Thu, 04/19/2018 - 17:41
Oleg Dzhimiev committed changes to the Elphel git project :
fixed bad frames for mt9f002 when changing window size

04/18/18 [imagej-elphel][master] by AndreyFilippov: Rewriting correlation processing to handle diagonal and multi-baseline pairs

Elphel GIT logs - Wed, 04/18/2018 - 13:41
AndreyFilippov committed changes to the Elphel git project :
Rewriting correlation processing to handle diagonal and multi-baseline pairs

04/17/18 [linux-elphel][rocko] by Oleg Dzhimiev: typo-error

Elphel GIT logs - Tue, 04/17/2018 - 18:43
Oleg Dzhimiev committed changes to the Elphel git project :
typo-error

04/17/18 [linux-elphel][rocko] by Oleg Dzhimiev: clean up

Elphel GIT logs - Tue, 04/17/2018 - 18:35
Oleg Dzhimiev committed changes to the Elphel git project :
clean up

04/17/18 [linux-elphel][rocko] by Oleg Dzhimiev: typos

Elphel GIT logs - Tue, 04/17/2018 - 18:35
Oleg Dzhimiev committed changes to the Elphel git project :
typos

04/17/18 [elphel-web-camvc][master] by Oleg Dzhimiev: fixed magnifier and preview window frame lagging

Elphel GIT logs - Tue, 04/17/2018 - 16:05
Oleg Dzhimiev committed changes to the Elphel git project :
fixed magnifier and preview window frame lagging

10398

Wiki Recent Changes - Mon, 04/16/2018 - 19:32

‎MT9F002 Application Notes

← Older revision Revision as of 01:32, 17 April 2018 Line 26: Line 26:  |[[File:Mt9f002 slave mode.jpeg|700px|thumb|Fig.3 Slave mode]] |[[File:Mt9f002 slave mode.jpeg|700px|thumb|Fig.3 Slave mode]]  |} |}  +  +====I2C commands via sysfs====  + root@elphel393:~# cd /sys/devices/soc0/elphel393-sensor-i2c\@0/  +* read (port 0):  + echo "mt9f002 0x0 0x3000" > i2c0  + cat i2c0  +* write:  + echo "mt9f002 0x0 0x301a 0x011c" > i2c0     ====Measure frame timing==== ====Measure frame timing==== Oleg

New image sensors for 10393

Wiki Recent Changes - Mon, 04/16/2018 - 19:07

‎in device tree

← Older revision Revision as of 01:07, 17 April 2018 (5 intermediate revisions by the same user not shown)Line 6: Line 6:  * Read [[Driverless_mode_393|this article]] * Read [[Driverless_mode_393|this article]]  ===Developing a driver=== ===Developing a driver=== −{|+[[File:10393 sensor driver structure.png|thumb|700px|Fig.1 Sensor driver]] −|[[File:10393 sensor driver structure.png|thumb|700px|Fig.1 Sensor driver]]+[[File:10393_cpu_fpga_i2c_records_table.png|thumb|700px|Fig.2 FPGA has a certain 256-line table (for all ports)]] −|}  −{|  −|[[File:10393_cpu_fpga_i2c_records_table.png|thumb|700px|Fig.2 FPGA has a certain 256-line table (for all ports)]]  −|}     −* In device tree:+====Device tree==== −** record for sensor, like:+* record for sensor, like: −    elphel393_mt9f002: elphel393-mt9f002@0 {+ <font size=1>elphel393_mt9f002: elphel393-mt9f002@0 { −        compatible = "elphel,elphel393-mt9f002-1.00";+    compatible = "elphel,elphel393-mt9f002-1.00"; −    };+ };</font> −** record for sensor i2c address, like:+* record for sensor i2c address, like: −    elphel393_sensor_i2c: elphel393-sensor-i2c@0 {+ <font size=1>elphel393_sensor_i2c: elphel393-sensor-i2c@0 { −                compatible = "elphel,elphel393-sensor-i2c-1.00";+    compatible = "elphel,elphel393-sensor-i2c-1.00"; −                /* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */+    /* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */ −                elphel393-sensor-i2c,i2c_devices = "mt9f002        0x10 2 2 500",+    elphel393-sensor-i2c,i2c_devices = "mt9f002        0x10 2 2 500", −                                                  "mt9p006        0x48 1 2 500",+                                        "mt9p006        0x48 1 2 500", −                                                  "el10359        0x08 1 2 500",+                                        "el10359        0x08 1 2 500", −                                                  "el10359_32    0x08 1 4 500",+                                        "el10359_32    0x08 1 4 500", −                                                  "pca9500_eeprom 0x50 1 1 100",+                                        "pca9500_eeprom 0x50 1 1 100", −                                                  "sensor_eeprom  0x50 1 1 100",+                                        "sensor_eeprom  0x50 1 1 100", −                                                  "sensor_temp    0x18 1 2 100",+                                        "sensor_temp    0x18 1 2 100", −                                                  "cy22393        0x69 1 1 100";+                                        "cy22393        0x69 1 1 100"; −    } ;+ };</font>  +* edit detected sensors:  + <font size=1>elphel393_detect_sensors: elphel393-detect_sensors@0 {  +    compatible = "elphel,elphel393-detect_sensors-1.00";  +    elphel393-detect_sensors,port-mux = "none none none none"; /* "none", "detect" or "mux10359" */  +    elphel393-detect_sensors,sensors =  "mt9f002", // Line per port, may contain up to 4 sensors (3 with 10359)  +                                        "mt9f002",  +                                        "mt9f002",  +                                        "mt9f002";  + };</font>    −** edit detected sensors:+====Add a proper application==== −    elphel393_detect_sensors: elphel393-detect_sensors@0 {+* In '''autocampars.php''' −        compatible = "elphel,elphel393-detect_sensors-1.00";+* Set application through 10389's serial or more preferably through /etc/elphel393/default_10389.xml in a 10389-less setup −        elphel393-detect_sensors,port-mux = "none none none none"; /* "none", "detect" or "mux10359" */  −        elphel393-detect_sensors,sensors = "mt9f002", // Line per port, may contain up to 4 sensors (3 with 10359)  −                                            "mt9f002",  −                                            "mt9f002",  −                                            "mt9f002";  −    };  −   −* edit '''autocampars.php''' - add a proper application  −* set application through 10389's serial or more preferably through /etc/elphel393/default_10389.xml in a 10389-less setup      +====Driver code====  * In ''linux-elphel/src/drivers/elphel/''   * In ''linux-elphel/src/drivers/elphel/''    ** Create mt9f002.h and mt9f002.c ** Create mt9f002.h and mt9f002.c  ** Add to Makefile: ** Add to Makefile: −  obj-$(CONFIG_ELPHEL393)           += mt9f002.o+  <font size=1>obj-$(CONFIG_ELPHEL393) += mt9f002.o</font>  ** Edit pgm_functions.c ** Edit pgm_functions.c  ** mt9f002.h - fill with registers addresses (from sensor's datasheet) and other constants ** mt9f002.h - fill with registers addresses (from sensor's datasheet) and other constants  ** mt9f002.c: ** mt9f002.c: −  mt9f002_par2addr table+  <font size=1>mt9f002_par2addr table    mt9f002_pages table   mt9f002_pages table    mt9f002_ahead_tab - no need to edit in the beginning   mt9f002_ahead_tab - no need to edit in the beginning Line 66: Line 63:    mt9f002_pgm_limitfps func   mt9f002_pgm_limitfps func    mt9f002_pgm_exposure func   mt9f002_pgm_exposure func −  mt9f002_pgm_triggermode func+  mt9f002_pgm_triggermode func</font>           [[Category:393]] [[Category:393]] Oleg

New image sensors for 10393

Wiki Recent Changes - Mon, 04/16/2018 - 19:03

‎Driver

← Older revision Revision as of 01:03, 17 April 2018 (4 intermediate revisions by the same user not shown)Line 6: Line 6:  * Read [[Driverless_mode_393|this article]] * Read [[Driverless_mode_393|this article]]  ===Developing a driver=== ===Developing a driver=== −{|+[[File:10393 sensor driver structure.png|thumb|700px|Fig.1 Sensor driver]] −|[[File:10393 sensor driver structure.png|thumb|700px|Fig.1 Sensor driver]]+[[File:10393_cpu_fpga_i2c_records_table.png|thumb|700px|Fig.2 FPGA has a certain 256-line table (for all ports)]] −|}  −{|  −|[[File:10393_cpu_fpga_i2c_records_table.png|thumb|700px|Fig.2 FPGA has a certain 256-line table (for all ports)]]  −|}     −* In device tree:+====in device tree==== −** record for sensor, like:+* record for sensor, like: −    elphel393_mt9f002: elphel393-mt9f002@0 {+ <font size=1>elphel393_mt9f002: elphel393-mt9f002@0 { −        compatible = "elphel,elphel393-mt9f002-1.00";+    compatible = "elphel,elphel393-mt9f002-1.00"; −    };+ };</font> −** record for sensor i2c address, like:+* record for sensor i2c address, like: −    elphel393_sensor_i2c: elphel393-sensor-i2c@0 {+ <font size=1>elphel393_sensor_i2c: elphel393-sensor-i2c@0 { −                compatible = "elphel,elphel393-sensor-i2c-1.00";+    compatible = "elphel,elphel393-sensor-i2c-1.00"; −                /* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */+    /* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */ −                elphel393-sensor-i2c,i2c_devices = "mt9f002        0x10 2 2 500",+    elphel393-sensor-i2c,i2c_devices = "mt9f002        0x10 2 2 500", −                                                  "mt9p006        0x48 1 2 500",+                                        "mt9p006        0x48 1 2 500", −                                                  "el10359        0x08 1 2 500",+                                        "el10359        0x08 1 2 500", −                                                  "el10359_32    0x08 1 4 500",+                                        "el10359_32    0x08 1 4 500", −                                                  "pca9500_eeprom 0x50 1 1 100",+                                        "pca9500_eeprom 0x50 1 1 100", −                                                  "sensor_eeprom  0x50 1 1 100",+                                        "sensor_eeprom  0x50 1 1 100", −                                                  "sensor_temp    0x18 1 2 100",+                                        "sensor_temp    0x18 1 2 100", −                                                  "cy22393        0x69 1 1 100";+                                        "cy22393        0x69 1 1 100"; −    } ;+ };</font>  +* edit detected sensors:  + <font size=1>elphel393_detect_sensors: elphel393-detect_sensors@0 {  +    compatible = "elphel,elphel393-detect_sensors-1.00";  +    elphel393-detect_sensors,port-mux = "none none none none"; /* "none", "detect" or "mux10359" */  +    elphel393-detect_sensors,sensors =  "mt9f002", // Line per port, may contain up to 4 sensors (3 with 10359)  +                                        "mt9f002",  +                                        "mt9f002",  +                                        "mt9f002";  + };</font>    −** edit detected sensors:+====Add a proper application==== −    elphel393_detect_sensors: elphel393-detect_sensors@0 {+* In '''autocampars.php''' −        compatible = "elphel,elphel393-detect_sensors-1.00";+* Set application through 10389's serial or more preferably through /etc/elphel393/default_10389.xml in a 10389-less setup −        elphel393-detect_sensors,port-mux = "none none none none"; /* "none", "detect" or "mux10359" */  −        elphel393-detect_sensors,sensors = "mt9f002", // Line per port, may contain up to 4 sensors (3 with 10359)  −                                            "mt9f002",  −                                            "mt9f002",  −                                            "mt9f002";  −    };  −   −* edit '''autocampars.php''' - add a proper application  −* set application through 10389's serial or more preferably through /etc/elphel393/default_10389.xml in a 10389-less setup      +====Driver code====  * In ''linux-elphel/src/drivers/elphel/''   * In ''linux-elphel/src/drivers/elphel/''    ** Create mt9f002.h and mt9f002.c ** Create mt9f002.h and mt9f002.c  ** Add to Makefile: ** Add to Makefile: −  obj-$(CONFIG_ELPHEL393)           += mt9f002.o+  <font size=1>obj-$(CONFIG_ELPHEL393) += mt9f002.o</font>  ** Edit pgm_functions.c ** Edit pgm_functions.c  ** mt9f002.h - fill with registers addresses (from sensor's datasheet) and other constants ** mt9f002.h - fill with registers addresses (from sensor's datasheet) and other constants  ** mt9f002.c: ** mt9f002.c: −  mt9f002_par2addr table+  <font size=1>mt9f002_par2addr table    mt9f002_pages table   mt9f002_pages table    mt9f002_ahead_tab - no need to edit in the beginning   mt9f002_ahead_tab - no need to edit in the beginning Line 66: Line 63:    mt9f002_pgm_limitfps func   mt9f002_pgm_limitfps func    mt9f002_pgm_exposure func   mt9f002_pgm_exposure func −  mt9f002_pgm_triggermode func+  mt9f002_pgm_triggermode func</font>           [[Category:393]] [[Category:393]] Oleg

10398

Wiki Recent Changes - Mon, 04/16/2018 - 18:42

‎Measure frame timing

← Older revision Revision as of 00:42, 17 April 2018 (3 intermediate revisions by the same user not shown)Line 26: Line 26:  |[[File:Mt9f002 slave mode.jpeg|700px|thumb|Fig.3 Slave mode]] |[[File:Mt9f002 slave mode.jpeg|700px|thumb|Fig.3 Slave mode]]  |} |}  +  +====Measure frame timing====  + root@elphel393:~# cd /usr/local/verilog/; test_mcntrl.py @hargs-after  +  + //0x21  + //      x393_status_sens_io_t - [22] time_busy  + //0x40  + //      x393_status_sensor_timing_t - [23:0] quad_cycles  + //0x40a  + //      x393_sensio_jtag_t  + //          0s are ok for other bits  + //          timing_to  : 2; // [11:10] (0) Measuring sensor time to: 0 - sof, 1 - eof, 2 - sol, 3 eol  + //          timing_from : 2; // [13:12] (0) Measuring sensor time from: 0 - sof, 1 - eof, 2 - sol, 3 eol  + //          lane_num    : 2; // [15:14] (0) Measuring sensor time on lane 0..3  + //          timing_start: 1; // [  16] (0) Start sensor timing measurement  +  +  + // measure time from sof to sol, lane 0  + write_control_register 0x40a 0x10800  + // sof to eof  + write_control_register 0x40a 0x10400  + // sol to eol  + write_control_register 0x40a 0x12c00  + // eof to sof  + write_control_register 0x40a 0x11000  + // eol to sol  + write_control_register 0x40a 0x13800  +  + // sol to sol  + write_control_register 0x40a 0x12800  +  + // sof to sof  + '''write_control_register 0x40a 0x10000'''  +  + // eof to eof  + write_control_register 0x40a 0x11800  +  +  + // sof to sol  + write_control_register 0x40a 0x10800  +  + // eol to eof  + write_control_register 0x40a 0x13400  +   + read_status 0x21  +  + read_status 0x40 Oleg

New image sensors for 10393

Wiki Recent Changes - Mon, 04/16/2018 - 18:32

Created page with "==Description== This page describes development and testing of any new sensors for 10393 system boards. It covers a driver-less mode where python scripts are used to get the f..."

New page

==Description==
This page describes development and testing of any new sensors for 10393 system boards. It covers a driver-less mode where python scripts are used to get the first images and the sensor driver structure.

==Application notes==
===Driverless mode===
* Read [[Driverless_mode_393|this article]]
===Developing a driver===
{|
|[[File:10393 sensor driver structure.png|thumb|700px|Fig.1 Sensor driver]]
|}
{|
|[[File:10393_cpu_fpga_i2c_records_table.png|thumb|700px|Fig.2 FPGA has a certain 256-line table (for all ports)]]
|}

* In device tree:
** record for sensor, like:
elphel393_mt9f002: elphel393-mt9f002@0 {
compatible = "elphel,elphel393-mt9f002-1.00";
};
** record for sensor i2c address, like:
elphel393_sensor_i2c: elphel393-sensor-i2c@0 {
compatible = "elphel,elphel393-sensor-i2c-1.00";
/* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */
elphel393-sensor-i2c,i2c_devices = "mt9f002 0x10 2 2 500",
"mt9p006 0x48 1 2 500",
"el10359 0x08 1 2 500",
"el10359_32 0x08 1 4 500",
"pca9500_eeprom 0x50 1 1 100",
"sensor_eeprom 0x50 1 1 100",
"sensor_temp 0x18 1 2 100",
"cy22393 0x69 1 1 100";
} ;

** edit detected sensors:
elphel393_detect_sensors: elphel393-detect_sensors@0 {
compatible = "elphel,elphel393-detect_sensors-1.00";
elphel393-detect_sensors,port-mux = "none none none none"; /* "none", "detect" or "mux10359" */
elphel393-detect_sensors,sensors = "mt9f002", // Line per port, may contain up to 4 sensors (3 with 10359)
"mt9f002",
"mt9f002",
"mt9f002";
};

* edit '''autocampars.php''' - add a proper application
* set application through 10389's serial or more preferably through /etc/elphel393/default_10389.xml in a 10389-less setup

* In ''linux-elphel/src/drivers/elphel/''
** Create mt9f002.h and mt9f002.c
** Add to Makefile:
obj-$(CONFIG_ELPHEL393) += mt9f002.o
** Edit pgm_functions.c
** mt9f002.h - fill with registers addresses (from sensor's datasheet) and other constants
** mt9f002.c:
mt9f002_par2addr table
mt9f002_pages table
mt9f002_ahead_tab - no need to edit in the beginning
sensor_t structure - some fields are used, some - not
mt9f002_inits - registers that must be initialized
mt9f002_pgm_detectsensor func - remove mrst and read id via i2c, register other functions
mt9f002_pgm_initsensor func - applies init i2c commands, cable phase adjustment, gain table and shadow regs
mt9f002_pgm_sensorin func - this just set MT9F002_VACT_DELAY because of sensor's specifics
mt9f002_pgm_window func - uses mt9f002_pgm_window_common
mt9f002_pgm_window_safe func - uses mt9f002_pgm_window_common
mt9f002_pgm_window_common func - change window, also sets horizontal blanking
mt9f002_pgm_gains func
mt9f002_pgm_limitfps func
mt9f002_pgm_exposure func
mt9f002_pgm_triggermode func



[[Category:393]] Oleg

Pages

Subscribe to www3.elphel.com aggregator