Jump to content

AINSER Channel Scan order


lichtuberstromt
 Share

Recommended Posts

Have been working on adding physical controls to the Goom synth (so thrilled this is ported to MIOS!), and noticed that the AINSER64 module appears to scan each MUX in reverse order.  I built a small version of the AINSER module (3 mux's) using channel 0-2 of the ADC, and realized I should have used 5-7.  Looking through the code for AINSER.c and mios32_spi.c and I can't figure out why it's scanning channel seven first and assigning it pins 1-8 and so on.  It's not a huge deal for this project (I can just offset my pin values), but was wondering if anyone could shed any light into what's happening here.  From looking at the schematics for the AINSER64 module, this appears to be the planned mode of operation as J6 connects to channel 7, J7 to channel 6, etc.  Thanks for any help anyone might be able to provide.  

Jeff

Link to comment
Share on other sites

Hi,

In ainser.c line 334:
 

      // store conversion value if difference to old value is outside the deadband
      u16 pin = muxed ? (mux_pin_map[mux_ctr] + 8*(7-chn)) : (7-chn); // the mux/chn -> pin mapping is layout dependend

Try this:
 

      // store conversion value if difference to old value is outside the deadband
      u16 pin = muxed ? (mux_pin_map[mux_ctr] + 8*chn) : chn; // the mux/chn -> pin mapping is layout dependend

Yep Next time, better check the ainser64 diagram before reducing it ;)


Best regards
Bruno

Edited by Antichambre
Link to comment
Share on other sites

That's it!  Thank you so much!  Not sure how I missed it since the comment explains it, but I'm very appreciative for your assistance.

Yeah, this was my first time creating a PCB - definitely a learning experience.  I've been surprised at how well everything has actually worked given my lack of experience - the documentation and tutorials for MIDIbox have been amazing.

Thanks

Jeff

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...