Jump to content

AINSER sampling rate


Zam
 Share

Recommended Posts

Hi All

I working since few weeks on a new project that involve midibox (to make it short a quad stereo VCA compressor with digital/midi remote)

I have most of things shorted out, and just have a new idea for it...

Using AINSER to read my DC sidechain that initially feed an analogue meter (for gain reduction monitoring)

Timing is not that critical in this area but now I'm thinking I can do some other processing depending of this input (VCA have parallels  controls from AOUT modules across the analogue time constant processing)

The question is simple what is the AINSER sapling rate if I want to proceed fast DC or rectified AC, also what is the round trip from AIN to AOUT if I want to process something in between (like midi or NG conditional)

Best

Zam

 

Link to comment
Share on other sites

23 minutes ago, Zam said:

what is the AINSER sapling rate

The AINSER is usually called every ms, but! if you are using the 64 version, it's one multiplexed line every ms then scanning the 64 inputs takes 8ms.

 

27 minutes ago, Zam said:

also what is the round trip from AIN to AOUT if I want to process something in between (like midi or NG conditional)

This is something easy to do in a regular App, using the AINSER_Handler, but in NG I don't know.

Best
Bruno

Link to comment
Share on other sites

21 minutes ago, Antichambre said:

The AINSER is usually called every ms, but! if you are using the 64 version, it's one multiplexed line every ms then scanning the 64 inputs takes 8ms.

meaning mios can handle at least 125uS scan (8kHz sampling rate) "if" I speed up the AINSER8 scan (like a AINSER64 but with only 8 input)

this should be enough as my fastest time constant rise is 300us

39 minutes ago, Antichambre said:

This is something easy to do in a regular App, using the AINSER_Handler, but in NG I don't know.

Ok, I'll see

Best

Zam

 

Link to comment
Share on other sites

1 minute ago, Zam said:

meaning mios can handle at least 125uS scan

You can try to call the AINSER_Handler with a Timer set at the desired rate,but usually a freertos task is used to call it, and its minimum period is 1ms( 1 / portTICK_RATE_MS )

Check tutorial#012b_ainser_muxed:

/////////////////////////////////////////////////////////////////////////////
// This hook is called when an AINSER pot has been moved
/////////////////////////////////////////////////////////////////////////////
static void APP_AINSER_NotifyChange(u32 module, u32 pin, u32 pin_value)
{
  // toggle Status LED on each AIN value change
  MIOS32_BOARD_LED_Set(0x0001, ~MIOS32_BOARD_LED_Get());

  // convert 12bit value to 7bit value
  u8 value_7bit = pin_value >> 5;

  // send MIDI event
  MIOS32_MIDI_SendCC(DEFAULT, Chn1, pin + 0x10, value_7bit);
}


/////////////////////////////////////////////////////////////////////////////
// This task scans AINSER pins and checks for updates
/////////////////////////////////////////////////////////////////////////////
static void TASK_AINSER_Scan(void *pvParameters)
{
  portTickType xLastExecutionTime;

  // Initialise the xLastExecutionTime variable on task entry
  xLastExecutionTime = xTaskGetTickCount();

  while( 1 ) {
    vTaskDelayUntil(&xLastExecutionTime, 1 / portTICK_RATE_MS);

    // scan pins
    AINSER_Handler(APP_AINSER_NotifyChange);
  }
}

 

Link to comment
Share on other sites

Thank's Bruno

I'll look at soft when it's time, for the moment I'm at the schematic, pcb not designed yet.

But this definitely make me decide to implement AINSER to scan the time constant CV, whatever happen next.

At worst it will avoid me to design an extra analogue bargraph meter driver, and I can light leds with this (I don't need any fancy scaling it's strait V<=>dB reading), 1ms lag is OK for gain reduction meter. I have to add a buffer anyway so again even if I don't populate the MCP I'll can drive an analogue meter.

At best I'll be able to manage special time constant/condition depending on actual gain reduction... like compression amount limiting, or automatic ratio change depending of reduction amount (all time constant RC network and ratio have analogue switches/multiplexer drived by 595...)

Best

Zam

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...