lichtuberstromt

AINSER Channel Scan order

4 posts in this topic

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

Share this post


Link to post
Share on other sites

If I recall, the pin order was determined by PCB layout (might have something to do with the AINSER64 too? So backwards scanning it is if you use the MIOS routine.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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