I’d like to have 4 midi ports on my SEQV4L and have wired up the interfaces but I’ve hit a snag.
MIDI IN/OUT4 is straight forward as J4B.SC and J4B.SD are unused in the SEQV4L.
MIDI IN/OUT3 However, requires J5B.A6 and J5B.A7 which are currently used to drive LED matrix columns.
It looks like it should be straight forward to use 2*I/O lines from either J8/9 or J19 for the last two LED column drivers and free up the MIDI IN/OUT3 pins.
I’m having trouble finding my way around the source and would really appreciate some hints.
O.K, I think I’ve tracked down to where the column drivers are written:
/////////////////////////////////////////////////////////////////////////////
//! This function services the row selection lines at J15 and the
//! LED output lines at J5A/B
//! It should be called from the APP_SRIO_ServicePrepare()
//! \return < 0 on errors
/////////////////////////////////////////////////////////////////////////////
s32 BLM_CHEAPO_PrepareCol(void)
{
if( ++selected_row >= 8 )
selected_row = 0;
// selection lines at J15
u8 selection_mask = (1 << selected_row);
MIOS32_BOARD_J15_DataSet(selection_mask);
// LED columns at J5A/B
MIOS32_BOARD_J5_Set(led_row[selected_row]);
return 0; // no error
}
So it would appear that if I copy the bit states of bits 6 and 7 of led_row[selected_row] to the new I/O lines from say J19 then it will work as I need.
Does selecting UART functionality mean that bits 6,7 of J5 are no longer affected by MIOS32_BOARD_J5_Set(led_row[selected_row]) ?
Actually, J28 is free and also supported by the mios32_board.c functions so I’ll try this.
I guess that you’ve to skip the initialisation of these pins in BLM_CHEAPO_Init:
// initialize all pins of J5A and J5B as outputs in Push-Pull Mode
for(pin=0; pin<8; ++pin)
MIOS32_BOARD_J5_PinInit(pin, MIOS32_BOARD_PIN_MODE_OUTPUT_PP);
[/code]
changed to:
[code]
// initialize all pins of J5A and J5B as outputs in Push-Pull Mode
for(pin=0; pin\<6; ++pin)
MIOS32\_BOARD\_J5\_PinInit(pin, MIOS32\_BOARD\_PIN\_MODE\_OUTPUT\_PP);
No modification is required when calling MIOS32_BOARD_J5_Set in this case, since A6/A7 are configured for alternate mode (and not GPIO mode), and therefore won’t be overwritten.
I’ve chosen J28.0 and J28.1 to drive the columns that were driven by J15.6 and J15.7
// LED columns at J5A/B
MIOS32_BOARD_J5_Set(led_row[selected_row]);
// ***dug*** bits 6 and 7 are not initialised for GPIO so have no effect
MIOS32_BOARD_J28_Set(led_row[selected_row]>>6);//put 6,7 into 0,1
Is working but there is another (unused) peripheral accessing J28 when the sequencer is running causing an additional flicker to two of the led columns.
It turns out there are calls involving J28 in seq_cv.c
How do I disable the other function (Aout, I think) from the app build?
PS: at the moment to make the affected led matrix columns work (at all) I call
I’ve now got the LEDs working correctly by switching out any code with MIOS32_BOARD_J28_PinInit() or MIOS32_BOARD_J28_PinSet() involving pin 0, or 1.
I’ll provide the details when all the midi ports are working.
If I now include #define MIOS32_UART_NUM 4 in mios32_config.h I get the following build error:
c:/mios32_toolchain/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: project_build/project.elf section `.bss_ahb' will not fit in region `RAMAHB'
c:/mios32_toolchain/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: region `RAMAHB' overflowed by 40 bytes
collect2: ld returned 1 exit status
make: *** [project_build/project.elf] Error 1
Any suggestion on how to resolve this?
Thanks.
(edit)
I can now confirm that with #define MIOS32_UART_NUM 3 I’m not getting the build error and MIDI Port 3 is working!
There is a warning generated which I haven’t looked into yet but here is:
Creating object file for osc_server.c
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c: In function 'OSC_SE
RVER_AppCall':
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:273:7: warning: pass
ing argument 3 of 'MIOS32_OSC_ParsePacket' discards qualifiers from pointer targ
et type
w:/sw/tempmios/trunk/include/mios32/mios32_osc.h:106:12: note: expected 'struct
mios32_osc_search_tree_t *' but argument is of type 'const struct mios32_osc_sea
rch_tree_t *'
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c: At top level:
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:765:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:766:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:767:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:768:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:769:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:770:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:801:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:803:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:804:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:805:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:806:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:807:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:808:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:809:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:810:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:811:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:812:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:813:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:814:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:815:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:816:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:817:3: warning: init
ialization discards qualifiers from pointer target type
w:/sw/tempmios/trunk/modules/uip_task_standard/osc_server.c:818:3: warning: init
ialization discards qualifiers from pointer target type
I’ve documented the hardware and software changes in this blog article: <___base_url___>/blog/17/entry-128-4-midi-inout-ports-for-seqv4l-adding-2-more-midi-io/?do=embed