tago

Assign J5a/b core ports in .NGC

6 posts in this topic

I want to connect some switches and leds directly to the CORE_STM32F4 via J5a/b ports.

The NG manual shows an example using them as AINs, but not DIN/DOUT. Then i found the tutorial applications (eg polling_j5_pins) which show how to use them on app level.

What i dont get, is there a way to setup these ports and its indivdual pins directly in a .NGC file?

Share this post


Link to post
Share on other sites

Hello Tago

Yes J5 ports are available at .NGC, as analogue input, EVENT_AIN

with "ain_mode=switch" flag you can hook a button on it

You have to enable the input pins with:

Example:

# AIN hardware
AIN enable_mask=110000

will enable the J5A.A0 and J5A.A1 inputs. 

To connect LED I suppose you have to go deeper in mios32.

If you use toggle switch (and not tact switch) you can solve this with a dual pole version, one for the AIN and one for a LED directly powered by the switch.

Best

Zam

Share this post


Link to post
Share on other sites

Hi Zam,

they're tact switches.

I'd like to avoid additional modules for just 2 switches and 2 LEDs. A pity there is no easy way for LEDs.

It means i have to add code in terms of the 'j5_outputs' example to NG app, right?

Share this post


Link to post
Share on other sites

Hey

I can't help for J5 handle at lower level.

Side question, did you already use J10 ?

Best

Zam

Share this post


Link to post
Share on other sites

Posted (edited)

Currently no J10 in use for now. I wanted to keep J10a clear if i later want to add an SCS. Therefor J10b would be available.

But the issue i found was, that you can't have mixed DIN/DOUT on a J10 port. That lead me to the J5 ports. The wiring to core would be a mess for a little board with 2 switches and 2 LEDs.

 

ps. i want to setup two octave up/down buttons with indication LEDs

Edited by tago

Share this post


Link to post
Share on other sites

You can mix IN/OUT at J10, but have to choose for a full row, a and b

So if you want to keep spare for future SCS (at J10a) it's not an option...

I'm sure someone can help you better than me for software side and J5 implementation

Best

Zam

 

 

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