Software Description photographic unit

Dolzhenkov AP

Southwestern State University, Kursk

published in the proceedings of the II International Scientific Conference "Information-measuring diagnostic and control systems diagnostics - 2011", Southwest State University, Kursk - 2011, S. 25-30.

Appearance debug the sample block photographic (BF) Student MCA "Radioskaf-3" scheme [1], is shown in Fig. 1.


Fig. Debug a sample block photodetection.

main functions of the block, performed at the request of the central unit:

  • Getting the picture with the camera module, store them in nonvolatile memory;
  • Formation of SSTV pictures;
  • Issuing the list of saved images:
  • Issuance of JPG images.

Table 1 shows the protocol for information exchange between BF and the central control unit.

Table 1. Protocol for information exchange between BF and the central control unit

total of 8 major commands:

0_Reset - reboot BF

After receiving a reset command, BF sends a response byte ACK / STATUS center unit. Then there is a soft reset and program execution begins from start (Fig. 2)

Structure byte ACK / STATUS: 0-2 bits: the status of PV modules 3: 0-ok; 1-Error; 3 bits: Title card: 0-ok; 1-Error; 4 bits: Status of the block as a whole: 0-Idle; 1 - Busy; 6.5 Bits: ACK / END / NOT / reserve; 7bit: always 1.

1_Get Status - Becoming BF

BF sends only byte ACK / STATUS center unit.

2, 3_Make JPG foto / Make SSTV foto - Make a photo

command contains information about the moment of time in the following format: yymmddhhmmss, where yy Last 2 digits of the year; mm-month; dd-day; hh-hour; mm-min; ss-seconds. This is necessary because BF in the block is not independent real-time clock. Foundation uses this information to create the names of photos, as well as to generate the date and time on SSTV pictures.

After receiving this command, BF provides ACK / STATUS, confirming the adoption team. In which bit is "Status of the block as a whole" has the value 1 - Busy. Since photographing operation may be delayed due to the likely need for heating PV modules, writing the file to an SD memory card, the central unit does not wait for the completion of the operation. After a while he interrogates the status of WP (which is given to an interrupt) as soon as photography is completed bit "status block as a whole" will return its value to 0-Idle and photo can be pick up.

4, 5, 8_Get JPG foto / Get SSTV foto / Get random SSTV child pics - pick up a picture

team includes data point in time when the photo was taken, in other words is the name of the file on your SD card. If the file is on your SD card, then the byte ACK / STATUS contains the value of ACK, otherwise NOT. Then sent the length of the file in bytes, and sent a continuous stream of data. After the transfer of images sent ACK / STATUS byte value END.

6,7 _Get list of JPG files / Get list of SSTV files - Request a list of saved files. After receiving this command, the CF sends the ACK / STATUS byte with a value of ACK, then the number of stored images. Then follows a list of names, separated by a special unprintable byte \ n. After completion of the transfer is sent ACK / STATUS to the value END Format parcels, the presence of a signature (for identification devices), as well as the length specified in the design phase.

program for the microcontroller ATmega32A4 written in C language in an environment with AVR Studio installed GCC compiler.


Figure 2. Software Structure Foundation.

Fig. 2 illustrates a block diagram of the software Foundation. After power is initialized, the configuration of the microcontroller. A regime of IO ports. Enables and configures digital-analog converter (DAC), used to generate the SSTV signal. Configurable hardware transceiver interface SPI (required for use with SD memory card, as well as for information exchange with the central unit). For working with SD card memory in the microcontroller uses a hardware SPI mode "mode 0" (Positive Pulse Latch, then Shift). Selects the clock source: crystal oscillator frequency of the resonator. Enabled and configured timers, and interrupt timer (to set the signal frequency SSTV). Initializes an SD memory card in the mode SPI mode, this mode of communication is secondary to work with memory cards SD (primary «SD mode»). The mode is selected after power-up reset of the initial team (CMD0). Selected protocol SDC V1. Dale is testing a file system card (to the signs of FAT32). Configured interfaces UART, in a mode 115200,8, N, 1. Initialized modules cameras: the microcontroller is connected in series to each camera and converts it into power save mode (Sleep Mode).

program operates in three streams. The main thread Main Loop contains a self-test module, and handler commands received from the central unit. When getting to the line SPI interrupt is triggered, determines the type of team, and a flag "command is received" for the main thread. The third stream Timer Loop. Here you can set the frequency to generate a sinusoidal signal for SSTV.

work was supported by the Federal Program "Research and scientific-pedagogical personnel of innovative Russia" for 2009, 2013.

________

1. Dolzhenkov, AP The device is a remote automated photography [Text] / Dolzhenkov AP Rybochkin AF , Atakischev OI / / The use of innovative technologies in scientific research. South-West. Gos. Univ. Kursk, S. 268 - 272.