皆既日食2015撮像自動化プロジェクト -III-2"- D7100制御用ファームウェアの調整2

 更新の勘所は、シーケンサによるシャッターレリーズ後の遅延時間をさらに最適化し、多段階露光が17セット撮像できるようになりました。第二接触の4'50"前にシーケンス・コマンダーを起動したらあとは指定時間後に勝手にダイヤモンドリング~皆既食中~ダイヤモンドリングを撮像してくれるは筈です。コマンダーのタイマーを仕掛けたらD600の操作をするために、D7100の太陽フィルターは外した方がいいのかもしれません。

  1 /*
  2  * File:   D7100_Ctrl.c
  3  * Author: shin
  4  *
  5  * Created on 2014/10/13, 12:34
  6  */
  7 
  8 #include <stdio.h>
  9 #include <stdlib.h>
 10 #include <xc.h>
 11 #define _XTAL_FREQ 1000000;
 12 
 13 
 14 /*****Configuration********/
 15 #pragma config FOSC=INTOSCIO, WDTE=OFF, PWRTE=ON, BOREN=ON, MCLRE=OFF, CP=OFF, IESO=OFF//, FCMEN=OFF;
 16 
 17 int i,j,k;
 18 
 19 
 20 
 21 int main(void){
 22 
 23     //OSCCON = 0x40;  //set1MHz
 24     ANSEL=0x00;     //alldigital
 25     CMCON0=0x07;    //Comperlator off
 26     WPU=0x14;       //set pull up bit on
 27     nGPPU=0;        //pull up activate
 28     TRISIO0=0;  //GP0 output
 29     TRISIO1=0;  //GP1 output
 30     TRISIO2=0;  //GP2 output
 31     TRISIO3=1;  //GP3 input
 32     TRISIO4=0;  //GP4 output
 33     TRISIO5=0;  //GP5 output
 34 
 35         GP0 = 1;    //Speed down
 36         GP1 = 1;    //Shutter
 37         GP2 = 1;    //Speed up
 38         GP4 = 1;    //Focus
 39         GP3 = 1;    //Start Swich
 40 
 41     while(1){
 42         if(GP3 == 0){
 43             goto Start1;
 44         }
 45         else
 46         {
 47             GP0 = 1;
 48             GP1 = 1;
 49             GP2 = 1;
 50             GP4 = 1;
 51         }
 52     }
 53         Start1:
 54                 _delay(25000);      //wait 25ms
 55             GP4 = 0;                //Focus on
 56                 _delay(25000);       //wait 25ms
 57             GP1 = 0;                //Shutter release
 58                 _delay(13000000);   //wait 13sec
 59             GP1 = 1;                //Shutter off
 60                 _delay(25000);      //wait 25ms
 61             GP4 = 1;                 //Focus off
 62                 _delay(25000);       //wait 25ms
 63 
 64         GP2 = 0;            //Preconfig
 65         _delay(25000);      //wait 25ms
 66         for(j=1;j<=7;j++){  //Speed up from 1/2000 to 1/8000+alpha
 67                 GP0 = 0;
 68                 _delay(25000);
 69                 GP0 = 1;
 70                 _delay(25000);
 71             }
 72         GP2 = 1;
 73         _delay(25000);
 74 
 75         while(1){
 76             for(i=1; i<=7; i++){    //1/8000-1/60sec
 77                 GP4 = 0;            //Focus on
 78                     _delay(25000);     //wait 25ms
 79                 GP1 = 0;            //Shutter release
 80                     _delay(25000);     //wait 25ms
 81                 GP1 = 1;            //Shutter off
 82                     _delay(25000);     //wait 25ms
 83                 GP4 = 1;            //Focus off
 84                     _delay(25000);     //wait 250ms
 85                 GP0 = 0;            //Preconfig.
 86                     _delay(300000);     //wait 300ms
 87                 for(j=1; j<=2; j++){  //Speed Down
 88                     GP2 = 0;
 89                     _delay(25000);
 90                     GP2 = 1;
 91                     _delay(25000);
 92                 }
 93                 GP0 = 1;
 94                     _delay(55000);
 95             }
 96                     _delay(50000);
 97             for(i=1; i<=3; i++){    //1/30-1/8sec
 98                 GP4 = 0;            //Focus on
 99                     _delay(25000);     //wait 25ms
100                 GP1 = 0;            //Shutter release
101                     _delay(25000);     //wait 25ms
102                 GP1 = 1;            //Shutter off
103                     _delay(25000);     //wait 25ms
104                 GP4 = 1;            //Focus off
105                     _delay(25000);     //wait 25ms
106                 GP0 = 0;            //Preconfig.
107                     _delay(700000);     //wait 700ms
108                 for(j=1; j<=2; j++){  //Speed Down
109                     GP2 = 0;
110                     _delay(25000);
111                     GP2 = 1;
112                     _delay(25000);
113                 }
114                 GP0 = 1;            //Preconfig.
115                    _delay(25000);     //wait 25ms
116             }
117 
118                      _delay(25000);
119                 GP4 = 0;            //Focus on
120                     _delay(25000);     //wait 25ms
121                 GP1 = 0;            //Shutter release
122                     _delay(25000);     //wait 25ms
123                 GP1 = 1;            //Shutter off
124                     _delay(25000);     //wait 25ms
125                 GP4 = 1;            //Focus off
126                     _delay(700000);     //wait 700ms
127 
128                 k++ ;
129                 if (k >= 10)           //10回目だったら連写モードに 
130                 {
131                     goto Multi ;
132                 }
133 
134             for(i=1; i<=3; i++){    //1/8-1/30sec
135                 GP4 = 0;            //Focus on
136                     _delay(25000);     //wait 25ms
137                 GP1 = 0;            //Shutter release
138                     _delay(25000);     //wait 25ms
139                 GP1 = 1;            //Shutter off
140                     _delay(25000);     //wait 25ms
141                 GP4 = 1;            //Focus off
142                     _delay(25000);     //wait 25ms
143                 GP2 = 0;
144                     _delay(700000);    //wait 700ms
145                 for(j=1; j<=2; j++){  //Speed Up
146                     GP0 = 0;
147                     _delay(25000);
148                     GP0 = 1;
149                     _delay(25000);
150                 }
151                 GP2 = 1;
152                     _delay(25000);
153             }
154 
155             for(i=1; i<=7; i++){    //1/60-1/8000sec
156                 //GP2=1;
157                     _delay(50000);
158                 GP4 = 0;            //Focus on
159                     _delay(25000);     //wait 25ms
160                 GP1 = 0;            //Shutter release
161                     _delay(25000);     //wait 25sec
162                 GP1 = 1;            //Shutter off
163                     _delay(25000);     //wait 25ms
164                 GP4 = 1;            //Focus off
165                     _delay(300000);     //wait 300ms
166                 GP2 = 0;
167                     _delay(25000);
168                  for(j=1; j<=2; j++){  //Speed Up
169                     GP0 = 0;
170                     _delay(25000);
171                     GP0 = 1;
172                     _delay(25000);
173                 }
174                 GP2 = 1;
175                     _delay(25000);
176             }
177 
178                     _delay(50000);
179                 GP4 = 0;            //Focus on
180                     _delay(25000);     //wait 25ms
181                 GP1 = 0;            //Shutter release
182                     _delay(25000);     //wait 25ms
183                 GP1 = 1;            //Shutter off
184                     _delay(25000);     //wait 25ms
185                 GP4 = 1;            //Focus off
186                     _delay(50000);     //wait 50ms
187 
188                  GP2 = 0;
189                     _delay(25000);
190                  for(j=1; j<=3; j++){  //Speed Up 半端なSSが出た時の対策
191                     GP0 = 0;
192                     _delay(25000);
193                     GP0 = 1;
194                     _delay(25000);
195                 }
196                 GP2 = 1;
197                     _delay(55000);
198 
199 
200         }
201 
202     Multi:
203     GP2 = 0;                //Preconfig.
204         _delay(25000);      //wait 25ms
205     for(j=1; j<=16; j++){    //Speed up 1/8->1/2000
206         GP0 = 0;
207         _delay(25000);
208         GP0 = 1;
209         _delay(25000);
210     }
211     GP2 = 1;
212         _delay(25000);
213 
214         GP4 = 0;                //Focus on
215             _delay(25000);      //wait 100ms
216         GP1 = 0;                //Shutter release
217             _delay(13000000);   //wait 13sec
218         GP1 = 1;                //Shutter off
219             _delay(25000);      //wait 25ms
220         GP4 = 1;                //Focus off
221             _delay(25000);      //wait 25ms
222 
223 }
inserted by FC2 system