nlate Posted January 23, 2015 Report Share Posted January 23, 2015 (edited) 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 ? On the old STM32F0x based PCB On my current LPC17 based PCB 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 ? for the LPC17 core for the STM32F4 core What are the Port and Pin Names ? on the LPC17 core based PCB on the STM32F4 core based PCB Thanks in advance for your advice & support and best regards, Jo Edited January 23, 2015 by nlate Quote Link to comment Share on other sites More sharing options...
TK. Posted January 25, 2015 Report Share Posted January 25, 2015 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. Quote Link to comment Share on other sites More sharing options...
nlate Posted January 26, 2015 Author Report Share Posted January 26, 2015 (edited) 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 January 26, 2015 by nlate Quote Link to comment Share on other sites More sharing options...
TK. Posted January 26, 2015 Report Share Posted January 26, 2015 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.