Jump to content
  • 0

MCC 172 HELP - Can't change recording to start with script and remove EXTTRIGGER


lockecaps

Question

Hi, I'm trying to acquire data with multiple MCC 172 Hats, using the first one as a "master".

I'm following the example "multi_hat_synchronous_scan.py". The problem is it sets the triggers as:

    options = [
        OptionFlags.EXTTRIGGER,
        OptionFlags.EXTTRIGGER
    ]
    samples_per_channel = 10000
    sample_rate = 10240.0  # Samples per second
    trigger_mode = TriggerModes.RISING_EDGE

...

        for i, hat in enumerate(hats):
            chan_mask = chan_list_to_mask(chans[i])
            hat.a_in_scan_start(chan_mask, samples_per_channel, options[i])

 

But I can't figure out how I change it to start recording as soon as I start the script. I tried looking in the documentation, but changing it to  "options = OptionFlags.CONTINUOUS" doesn't work, and I'm running out of ideas. The documentation for the MCC is very lacking.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello,

To collect data when you start the script, change the OptionFlags to CONTINUOUS and the trigger configuration to LOCAL for both boards. However, they won't be synchronized. The external TTL trigger ensures they both start at the same time, and the clock synchronization makes sure they run at the same rate. If you can control GPIO lines on your Raspberry PI, set the master trigger source to slave and then set GPIO 5 high to initiate the trigger. 

Best regards,
John

Link to comment
Share on other sites

  • 0
42 minutes ago, JRys said:

If you can control GPIO lines on your Raspberry PI, set the master trigger source to slave and then set GPIO 5 high to initiate the trigger. 

Hi John,

Thanks for the response. I'm interested in start the recording with the script and having them synchronized without the need for external cables and/or external triggers. From your response, I think this is what you described.

Can you expand a bit on how that would work?

- I should set trigger_config() as a MASTER on my first hat, as SLAVE on the subsequent hats

- I should send GPIO.setup(PIN=5, GPIO.HIGH)

And that will initiate the data collection trigger without the need to physically affix a cable from the pin GPIO 5 to the trigger pin?

Link to comment
Share on other sites

  • 0

Hello,

Set the trigger configuration for both boards to SourceType.SLAVE. Then after calling the a_in_scan_start function, set GPIO 5 to start the data collection. If you want the data collection to run continuously, change the a_in_scan_start options to use OptionFlags.EXTTRIGGER | OptionFlags.CONTINUOUS for both boards.

Best regards,
John

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...