Jump to content

Recommended Posts

Posted (edited)

Might be really obvious but it's not clicking for me.

// bit mask to enable channels

//

// Pin mapping on MBHP_CORE_STM32 module:

//   15       14      13     12     11     10      9      8   

// J16.SO  J16.SI  J16.SC J16.RC J5C.A11 J5C.A10 J5C.A9 J5C.A8

//   7        6       5      4      3      2      1       0

// J5B.A7  J5B.A6  J5B.A5 J5B.A4 J5A.A3 J5A.A2 J5A.A1  J5A.A0

//

// Examples:

//   mask 0x000f will enable all J5A channels

//   mask 0x00f0 will enable all J5B channels

//   mask 0x0f00 will enable all J5C channels

//   mask 0x0fff will enable all J5A/B/C channels

// (all channels are disabled by default)

		#define MIOS32_AIN_CHANNEL_MASK 0x0000

If 0x000f is 15, how does that relate to J5A.A0..A3?

Thanks in advance,

Tom

Edited by Underskor
Posted (edited)

0x000f in decimal/base10 is 15. The reason I ask is because I'd like to disable all but the first mux (J5A.A0) so I only need to ground 7 inputs while troubleshooting/configuring.

Edited by Underskor
Posted

It should be like this for A3...A0:


only enable A0: 1

only enable A1: 2

only enable A2: 4

only enable A3: 8


only enable A0 and A1: 3

...

only enable A1 and A3: a

...

enable all A0 to A3: f

Best, ilmenator

Posted

Ah my mistake, I was reading the pin numbers in place of the binary columns (for lack of better words).

J5A.A0 - 1

J5A.A1 - 2

J5A.A2 - 3

J5A.A3 - 4

J5B.A4 - 5

etc
instead of
J5A.A0 - 1

J5A.A1 - 2

J5A.A2 - 4

J5A.A3 - 8

J5B.A4 - 16

etc

Thanks for both of your replies. :) Obvious after all!

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...
×
×
  • Create New...