Phatline

Midi-in-Core > DMX-out Converter

11 posts in this topic

I want to convert

Midi-In-Core (not USB-midi)> DMX-Out Core (MAX 485 Circuit)

but in the DMX-Examples i read:

// For now disable UART as we will be using DMX
#define MIOS32_DONT_USE_UART

suggest that i cant use Midi-Input then?

What do i have to do to get it working?

Share this post


Link to post
Share on other sites

This a mios32 app not a midibox ng configuration.

It doesn't use midi UART but analog ins (faders) to control DMX channels.

The DMX module seems to use uart1 for dmx.

So basically get your DMX channel data from midi events on another midi UART(instead of analog Ins) and transmit via the DMX module just like the example.

Share this post


Link to post
Share on other sites

ok

The UART assigment is done in "DMX.h" as default:

#define DMX_TX_PORT     GPIOA
#define DMX_TX_PIN      GPIO_Pin_9
#define DMX_RX_PORT     GPIOA
#define DMX_RX_PIN      GPIO_Pin_10
#define DMX             USART1
#define DMX_IRQ_CHANNEL USART1_IRQn
#define DMX_IRQHANDLER_FUNC void USART1_IRQHandler(void)

i will not change any on this, because i dont get the pin-out since i dont see any paralles to the Core32 Shematic: (where you have for example "PA3" instead of "GPIO Pin 10"....)

I Think "MI1/PA3" is GPIOA Pin 10   & "MO1/PA2" is GPIOA PIN 9 - and on this Pins i connect my MAX485

fetch.php?media=phatline:j11e.png

 

so what i have to change is: miox32_config.h:

i guess i have to set MIOS32_UART0_Assignment to "2" which is "COM" ?

and UART1 is set to "1" which is Midi

// For now disable UART as we will be using DMX 
#define MIOS32_DONT_USE_UART

#define MIOS32_USE_MIDI
#define MIOS32_USE_UART_MIDI
#define MIOS32_UART_NUM 2
#define MIOS32_UART0_ASSIGNMENT 2 //1=Midi, 0= Disabled, 2= COM
#define MIOS32_UART1_ASSIGNMENT 1
//#define MIOS32_UART2_ASSIGNMENT 1
//#define MIOS32_UART3_ASSIGNMENT 1

thats the plan, i hope i dont destroy anything when i simply try-out that setup :hmm:

Edited by Phatline

Share this post


Link to post
Share on other sites

Please bear in mind that in 2009 there was only one "core32" which was the STM32F10x. (I can see from the image of J11E above that you are looking at an F4).

This implementation uses low level library routines to access a uart for the DMX port. In your case this would have to be adapted (presumably to F4 that you want to use).  Unfortunately I don't think  STM32F10x midibox core PCBs are available anymore. If you are a very keen constructor and a have a JTAG interface for programming a bootloader you can buy chips and chip carrier PCBs (at very low cost) and make your own core circuit board. In this app there isn't much I/O to connect so the board would not be overly complicated. 

Sorry I cant help any more than this.

Share this post


Link to post
Share on other sites

i dont know which librarys, i dont see any "include headers" or includes in "makefile" for librarys...

no i want to use LCDs, Encoders, and other stuff, in short i use a STM32F4 discovery.

 

however, i dont give up.

 

what i found on ST site: https://stm32f4-discovery.net/2014/04/library-04-connect-stm32f429-discovery-to-computer-with-usart/

USART1 uses PA9 and PA10 which is used for USBVBUS

USART2 uses PA2 and PA3 which is used for Midi1 IO (J11E)

USART3 uses PD8 and PD9 which is used for Midi2 IO (J11E) but for now it is DMX

 

old "DMX.h" as default: (f10 board)

#define DMX_TX_PORT      GPIOA
#define DMX_TX_PIN          GPIO_Pin_9
#define DMX_RX_PORT     GPIOA
#define DMX_RX_PIN         GPIO_Pin_10
#define DMX                         USART1
#define DMX_IRQ_CHANNEL USART1_IRQn
#define DMX_IRQHANDLER_FUNC void USART1_IRQHandler(void)

 

new "DMX.h" as default: (f4 board)

#define DMX_TX_PORT     GPIOD
#define DMX_TX_PIN         GPIO_Pin_8   
#define DMX_RX_PORT     GPIOD
#define DMX_RX_PIN         GPIO_Pin_9    
#define DMX                        USART3       
#define DMX_IRQ_CHANNEL USART3_IRQn   
#define DMX_IRQHANDLER_FUNC void USART3_IRQHandler(void)

i dont know if that is right... seems logical.

Edited by Phatline

Share this post


Link to post
Share on other sites

You would need to set the appropriate environment variables for the F4.

Make sure the midi uart is different from the DMX one.

Have you tried to build?  

Share this post


Link to post
Share on other sites
On 27.12.2016 at 10:20 PM, Duggle said:

Have you tried to build?  

yes i get follwing:

Quote

make (im Verzeichnis: /home/triggermatrix/c/dmx)
rm -f project.hex
Creating object file for dmx.c
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c: In function 'DMX_Init':
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:65:34: error: 'GPIO_Mode_AF_PP' undeclared (first use in this function)
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:65:34: note: each undeclared identifier is reported only once for each function it appears in
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:69:34: error: 'GPIO_Mode_IPU' undeclared (first use in this function)
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:101:12: error: 'DMX_IDLE' undeclared (first use in this function)
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c: In function 'TASK_DMX':
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:121:18: error: 'DMX_IDLE' undeclared (first use in this function)
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:128:17: error: 'DMX_BREAK' undeclared (first use in this function)
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c: In function 'USART1_IRQHandler':
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:176:21: error: 'DMX_BREAK' undeclared (first use in this function)
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:185:15: error: 'DMX_SENDING' undeclared (first use in this function)
/home/triggermatrix/mios32/trunk/modules/dmx/dmx.c:196:19: error: 'DMX_IDLE' undeclared (first use in this function)
Kompilierung fehlgeschlagen.
make: *** [project_build//home/triggermatrix/mios32/trunk/modules/dmx/dmx.o] Fehler 1

(dont matter if i leave it default or change the PinOut in dmx.h file)

 

In the meantime i made a shematic, and soldered the Test-Equipment:

fetch.php?media=phatline:mbhp-dmx-out-sh

ATTENTION - the Shematic has a Error --- the DMX has to be connected to MOB instead of MOA!!!

fetch.php?media=phatline:dmx-out.jpg

fetch.php?media=phatline:dmx-test-equipm

 

Edited by Phatline

Share this post


Link to post
Share on other sites

I don't have time to research things.

I do have an interest in a Midibox DMX controller but I have other things to do atm.

So all I can do to try help the effort is suggest the kinds of things that I would do if I was undertaking your task. 

If you want the code to run on an F4 that was implemented on an F10x then make sure the low level peripheral libraries are compatible (ie the same) or what the differences are.

The fact that the only compile errors relate to changed constants indicates the underlying hardware has differences. Usually the newer chip has enhanced functions that the older chip's peripherals don't support so the names of constants get changed to cater for the more diverse functionality offered in the newer microcontroller.  Rest assured that the newer chip will be able to do what the older chip does in a very similar if not identical way.

You may be able to identify the constants that provide the same functionality (with slightly different text/spelling) in the peripherals as the old one. These will be found in the equivalent headers that support the F4 instead of the F10x.

Share this post


Link to post
Share on other sites

thx for the tip

for F10 i found this: http://stm32.kosyak.info/doc/group___g_p_i_o___exported___types.html

but for F4 it is harder to find information (i dont found a documentation), i found this, https://stm32f4-discovery.net/download/tm-stm32f4-gpio-library/?wpdmdl=2237

this links are correct??

 

for example "GPIO_Mode_AF_PP" (f10) searcing in this GPIO F4 document (link from above): i search "Mode", i found "TM_GPIO_Mode_t GPIO_Mode" and others...

i am not the right man for that job, - dont have that lo level knowledge- PP AF IPU are words i dont know, nor i know "maybe" equvivalent words...

 

you want also do some DMX one day? well then i will wait... my last tryout with MB DMX was 2015, since this- the Light is in Project-corner waiting for more... well then it will be waiting a nother year... i have other projects ;) that are going faster :grin:

 

Share this post


Link to post
Share on other sites

It should be quite doable to convert this project to F4.

I have some of the old core32 board, so I could build the original project to test it.  I would have to build the interface circuit like what you posted. I could then adapt it for the F4 which I also have. Like you, I have other projects so this would have to wait some time for me to progress it. My thoughts are to buy an RGB LED lamp (50Watts or similar) from Ebay which are pretty cheap. The idea I have is to create  an application so that the LED lamp shines the colour of the selected track from an Ableton Live session to enhance a live performance.

If I get time to spend on understanding the similarities/differences in peripheral libraries re uart, I shall post back to this thread.

Share this post


Link to post
Share on other sites

Just have a look into various .c files under mios32/STM32F4/ which configure IO pins.

And then compare with the files under mios32/STM32F1/

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