nlate

IIC_MIDI how to access the RI_N_PINs

4 posts in this topic

Dear MIDIBOXers,

During integration of my IIC_MIDI hardware module I run into an issue of using the RI_N_PINs.
Just some simple questions:
To which PORT and PINs are this inputs assigned ?

  1. On the old STM32F0x based PCB
  2. On my current LPC17 based PCB
  3. On the new STM32F4 based PCB

In the mios32_config.h there only seems to be mentioned the old STM32F0x scheme,

which uses the J5C for RI0..RI3 and J5A for RI4..7.
If these Port Pins would actually used as Inputs for signalling in case a MIDI Message was received the _ENABLED flag should be set to:

3 = interface enabled, check RI_N pin instead of polling receive status

Right?

#define MIOS32_IIC_MIDI0_ENABLED    2
#define MIOS32_IIC_MIDI0_RI_N_PORT  GPIOC
#define MIOS32_IIC_MIDI0_RI_N_PIN   GPIO_Pin_0
....
....
#define MIOS32_IIC_MIDI7_ENABLED    2
#define MIOS32_IIC_MIDI7_RI_N_PORT  GPIOA
#define MIOS32_IIC_MIDI7_RI_N_PIN   GPIO_Pin_3

How has this mios32_config.h file to be modified ?

  1. for the LPC17 core
  2. for the STM32F4 core

What are the Port and Pin Names ?

  1. on the LPC17 core based PCB
  2. on the STM32F4 core based PCB

Thanks in advance for your advice & support and best regards,
Jo

Edited by nlate

Share this post


Link to post
Share on other sites

The RI_N support for IIC_MIDI is in a bad state - actually I never adapted to LPC17 because the way how the port & pin is specified doesn't work for a LPC17, and I haven't adapted for STM32F4 because I knew that this configuration needs to be changed.

 

I think that some generic MIOS32_* functions are required to configure IO pins, so that the IIC_MIDI driver could just pass the port "number" and pin number

 

 

What are the Port and Pin Names ?

 

The intention was to make this free configurable.

It's a very app specific configuration, because there are no dedicated pins for the RI_N signals, so that the app developer has to decide which spare pins could be used for that purpose.

 

Best Regards, Thorsten.

Share this post


Link to post
Share on other sites

Dear Thorsten

Thanks for your reply.

During further investigation related to the RI_N topic I found the following issue in mios32\common\mios32_iic_midi.c:

....
#elif defined(MIOS32_FAMILY_LPC17xx)
#if MIOS32_IIC_MIDI0_ENABLED == 3
  MIOS32_SYS_LPC_PINSEL(MIOS32_IIC_MIDI0_RI_N_PORT, MIOS32_IIC_MIDI0_RI_N_PIN, 0);
  MIOS32_SYS_LPC_FIODIR(MIOS32_IIC_MIDI0_RI_N_PORT, MIOS32_IIC_MIDI0_RI_N_PIN, 0); // <-- This function/macro doesn´t excist !!
....
....
#if MIOS32_IIC_MIDI7_ENABLED == 3
  MIOS32_SYS_LPC_PINSEL(MIOS32_IIC_MIDI7_RI_N_PORT, MIOS32_IIC_MIDI7_RI_N_PIN, 0);
  MIOS32_SYS_LPC_FIODIR(MIOS32_IIC_MIDI7_RI_N_PORT, MIOS32_IIC_MIDI7_RI_N_PIN, 0);
.....

 

also at
 

.....
# elif defined(MIOS32_FAMILY_LPC17xx)
    case 0: return MIOS32_SYS_LPC_FIOGET(MIOS32_IIC_MIDI0_RI_N_PORT, MIOS32_IIC_MIDI0_RI_N_PIN) ? 0 : 1; // <-- This function/macro doesn´t excist !!
....
....
# elif defined(MIOS32_FAMILY_LPC17xx)
    case 6: return MIOS32_SYS_LPC_FIOGET(MIOS32_IIC_MIDI6_RI_N_PORT, MIOS32_IIC_MIDI6_RI_N_PIN) ? 0 : 1;
....

 


I replaced

MIOS32_SYS_LPC_FIODIR() with the MIOS32_SYS_LPC_PINDIR() macro

 

 

and replaced

MIOS32_SYS_LPC_FIOGET() with the MIOS32_SYS_LPC_PINGET() macro

 


The app at Mios32\apps\troubleshooting\iic_midi compiled and linked successfully afterwards!

The related Port (J10 on the LPC17 booard) was also found. It is defined in:
Mios32\include\mios32\mios32_iic_midi.h, where Port J10 D0..7 relates to RI_N ICC 1..8

I Modified the Mios32\apps\troubleshooting\iic_midi\mios32_config.h:

....
#define MIOS32_IIC_MIDI0_ENABLED 3

 


and connected the IIC_MIDI Module with your firmware and RI PIN connected and it behaves correctly as with simple IIC Port polling!

could you agree that my assumptions are correct?

Best regards,
Jo
 

Edited by nlate

Share this post


Link to post
Share on other sites

Yes, right

 

I corrected this, and also enabled the same pin configuration for STM31F4 like for STM31F1

 

But as mentioned before: actually I would like to overwork the configuration... sooner or later... to make it more generic.

 

Best Regards, Thorsten.

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