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

 更新の勘所は、シーケンサによるシャッターレリーズ後の遅延時間を最適化し、多段階露光が13セット撮像できるようになりました。使い方はIII-2の3.使い方と同じです。ただ第3接触の連続撮像が少しきついです。11秒前にシーケンス開始のレリーズを行うのが吉かもしれません。

E:\M_shi\MPLABXProjects\D7100_Ctrl.X\D7100_Ctrl.c
  1 /* 
  2  * File:   D7100_Ctrl.c
  3  * Author: M_shi
  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;
 40     while(1){       //All out off
 41         if(GP3 == 0){
 42             goto Start1;
 43         }
 44         else
 45         {
 46             GP1 = 1;
 47         }
 48     }
 49         Start1:
 50                 _delay(25000);     //wait 25ms
 51         for (i=1; i<=26; i++){
 52             GP4 = 0;            //Focus on
 53                 _delay(120000);     //wait 120ms
 54             GP1 = 0;            //Shutter release
 55                 _delay(25000);     //wait 25ms
 56             GP1 = 1;            //Shutter off
 57                 _delay(25000);     //wait 25ms
 58             GP4 = 1;            //Focus off
 59                 _delay(320000);     //wait 320ms
 60         }
 61 
 62         GP2 = 0;            //Preconfig
 63         _delay(25000);     //wait 25ms
 64         for(j=1;j<=7;j++){  //Speed up from 1/1000 to 1/8000+alpha
 65                 GP0 = 0;
 66                 _delay(25000);
 67                 GP0 = 1;
 68                 _delay(25000);
 69             }
 70         GP2 = 1;
 71         _delay(25000);
 72 
 73         while(1){
 74             for(i=1; i<=7; i++){    //1/8000-1/60sec
 75                 GP4 = 0;            //Focus on
 76                     _delay(25000);     //wait 25ms
 77                 GP1 = 0;            //Shutter release
 78                     _delay(25000);     //wait 25ms
 79                 GP1 = 1;            //Shutter off
 80                     _delay(25000);     //wait 25ms
 81                 GP4 = 1;            //Focus off
 82                     _delay(250000);     //wait 250ms
 83                 GP0 = 0;            //Preconfig.
 84                     _delay(25000);     //wait 25ms
 85                 for(j=1; j<=2; j++){  //Speed Down
 86                     GP2 = 0;
 87                     _delay(25000);
 88                     GP2 = 1;
 89                     _delay(25000);
 90                 }
 91                 GP0 = 1;
 92                     _delay(250000);
 93             }
 94             for(i=1; i<=3; i++){    //1/30-1/8sec
 95                 GP4 = 0;            //Focus on
 96                     _delay(25000);     //wait 25ms
 97                 GP1 = 0;            //Shutter release
 98                     _delay(25000);     //wait 25ms
 99                 GP1 = 1;            //Shutter off
100                     _delay(25000);     //wait 25ms
101                 GP4 = 1;            //Focus off
102                     _delay(750000);     //wait 750ms
103                 GP0 = 0;            //Preconfig.
104                     _delay(25000);     //wait 25ms
105                 for(j=1; j<=2; j++){  //Speed Down
106                     GP2 = 0;
107                     _delay(25000);
108                     GP2 = 1;
109                     _delay(25000);
110                 }
111                 GP0 = 1;            //Preconfig.
112                    _delay(125000);     //wait 125ms
113             }
114 
115                      _delay(25000);
116                 GP4 = 0;            //Focus on
117                     _delay(25000);     //wait 25ms
118                 GP1 = 0;            //Shutter release
119                     _delay(25000);     //wait 25ms
120                 GP1 = 1;            //Shutter off
121                     _delay(25000);     //wait 25ms
122                 GP4 = 1;            //Focus off
123                     _delay(750000);     //wait 750ms
124 
125                 k++ ;
126                 if (k >= 8)
127                 {
128                     goto Multi ;
129                 }
130 
131             for(i=1; i<=3; i++){    //1/8-1/30sec
132                 GP4 = 0;            //Focus on
133                     _delay(25000);     //wait 25ms
134                 GP1 = 0;            //Shutter release
135                     _delay(25000);     //wait 25ms
136                 GP1 = 1;            //Shutter off
137                     _delay(25000);     //wait 25ms
138                 GP4 = 1;            //Focus off
139                     _delay(750000);     //wait 750ms
140                 GP2 = 0;
141                     _delay(25000);
142                 for(j=1; j<=2; j++){  //Speed Up
143                     GP0 = 0;
144                     _delay(25000);
145                     GP0 = 1;
146                     _delay(25000);
147                 }
148                 GP2 = 1;
149                     _delay(125000);
150             }
151 
152             for(i=1; i<=7; i++){    //1/60-1/8000sec
153                 GP2=1;
154                     _delay(25000);
155                 GP4 = 0;            //Focus on
156                     _delay(25000);     //wait 25ms
157                 GP1 = 0;            //Shutter release
158                     _delay(25000);     //wait 25sec
159                 GP1 = 1;            //Shutter off
160                     _delay(25000);     //wait 25ms
161                 GP4 = 1;            //Focus off
162                     _delay(400000);     //wait 400ms
163                 GP2 = 0;
164                     _delay(25000);
165                  for(j=1; j<=2; j++){  //Speed Up
166                     GP0 = 0;
167                     _delay(25000);
168                     GP0 = 1;
169                     _delay(25000);
170                 }
171                 GP2 = 1;
172                     _delay(125000);
173             }
174 
175                     _delay(25000);
176                 GP4 = 0;            //Focus on
177                     _delay(25000);     //wait 25ms
178                 GP1 = 0;            //Shutter release
179                     _delay(25000);     //wait 25ms
180                 GP1 = 1;            //Shutter off
181                     _delay(25000);     //wait 25ms
182                 GP4 = 1;            //Focus off
183                     _delay(25000);     //wait 25ms
184 
185             for(i=1; i<=3; i++){
186                  GP2 = 0;
187                     _delay(25000);
188                  for(j=1; j<=4; j++){  //シャッター速度を最高速に
189                     GP0 = 0;
190                     _delay(25000);
191                     GP0 = 1;
192                     _delay(25000);
193                 }
194                 GP2 = 1;
195                     _delay(25000);
196             }
197         }
198 
199     Multi:              //第3接触に備えてシャッター速度を1/2000に
200     GP2 = 0;            //Preconfig.
201         _delay(25000);     //wait 25ms
202     for(j=1; j<=16; j++){  //Speed Down
203         GP0 = 0;
204         _delay(25000);
205         GP0 = 1;
206         _delay(25000);
207     }
208     GP2 = 1;
209         _delay(25000);
210         
211     while(1){               //連続撮像
212         GP4 = 0;            //Focus on
213             _delay(125000);     //wait 100ms
214         GP1 = 0;            //Shutter release
215             _delay(25000);     //wait 15sec
216         GP1 = 1;            //Shutter off
217             _delay(25000);     //wait 100ms
218         GP4 = 1;            //Focus off
219             _delay(320000);     //wait 100ms
220     }
221 }
222 
223 
224 
inserted by FC2 system