Firmware Design for a Detector Array - OUWECAD/MOWE GitHub Wiki

The following guide highlights required steps to develop firmware for a detector array of a particular shape based on one of the available detector array projects. Available projects include:

  • 37-module flat hexagonal array (here).
  • 20-module spherical hexagonal array (truncated icosahedron) (here).

These are the recommended steps to create a new detector array design easily:

  1. Design the array electrical backbone as shown in the example designs. The max array depth should be kept as low as possible by devising more parallel routes. Also, care should be taken in order to balance the delay of different routes as much as possible and to arrange the modules so that no unuseful bytes are transferred.

  2. Copy existing firmware to a new folder and rename the project name and other related files in the MDK-ARM folder.

  3. Design a topology file.

  4. Modify the following streaming definitions in aos.h:

  • Array size.
  • Module inport: The port receiving synchronization codes in the upload process.
  1. Modify the data array dataBuffer in main.c (variables section).

  2. Modify master upload (sync) section in main.c:FrontEndTask function.

  3. Adjust synchronization delays for master (main.c:FrontEndTask) and slaves (main.c:SampleAndForward).

  4. Modify Uplink DMAs (slaves) and port status (master and slaves) in main.c:StreamSetup. Note: Even the last module in the branch must enable its upload DMA because that triggers the DMA interrupt that runs the streaming code.

  5. Modify data transmit commands in main.c:SampleAndForward:

  • Data location (data array index)
  • Number of bytes to transmit.
  • Estimated delay (transmission time + guard time). Also estimate master's transmission delay in main.c:FrontEndTask.
  1. Setup Downlink DMAs (master and slaves) in main.c:StreamSetup.

  2. Calculate downlink delays for master (main.c:FrontEndTask) and slaves (main.c:SampleAndForward). Downlink delay for a module is the sum of the downlink delay of the previous module plus transmission delay for that module. In case the module considered receives data from more than one route, the route with the longest delay is chosen.

  3. Define required modules/configurations and compile the firmware for all

Note: the master downlink delay and transmission delay can be used to estimate the array's maximum scan rate. The rate can also be measured by calling the stream command without a rate parameter, which will start streaming at the maximum possible rate. The output can then be recorded for a specific time to calculate the maximum scan rate.