hi
i found the DMX example and noticed that it only sends DMX data.
what would i have to do to receive DMX data?
in my case i only need read not send.
thx.
hi
i found the DMX example and noticed that it only sends DMX data.
what would i have to do to receive DMX data?
in my case i only need read not send.
thx.
stephanschulz - please post a link to the DMX example you are referring to.
gbulmer, he posted the link in this thread:
http://forums.leaflabs.com/topic.php?id=10108
i found this arduino example: http://playground.arduino.cc//DMX/Ardmx
actually i was referring to this library made for the maple:
http://wiki.leaflabs.com/index.php?title=DMX-512
but true i am also looking at other option as you can see in that other post.
thanks for any input.
s.
crenn - why guess when the OP can give facts?-), especially as the OP wrote "what would i have to do to receive DMX data?" and the link you posted is titled "ArDMX - Simple DMX Receiver Code"!-)
I wasn't so much guessing as making an assumption, but usually it sometimes will speed things along.
It looks like some work needs to be done to allow the ArDMX to be integrated into the Maple Library, shouldn't be too difficult, but I'm only guessing as I haven't had experience with DMX before.
Ah! Assume - AssUme :-)
DMX has always seemed a bit odd (transmitting all 'dimmers' every time), but it does have the benefit that an unforeseen event should never cause jitter. I've never used it, though the protocol spec seems straightforward.
stephanschulz - have you got a good quality source of DMX messages so that you can test it?
thanks for your replies.
to explain my missing reference link. i was assuming that everyone knows of the example project folder on github and that it is the general reference for beginners.
but i will make sure to give all details in the future.
gbulmer - yes i have a good dmx source. i will be send dmx from an app on my laptop via usb enttec pro.
i have seen this Ardmx example on the arduino site but don't know how to converted to work with the maple since it was things like:
ISR(USART0_RX_vect)
UCSR1A
which seem arduino specific.
thx.
stephanschulz - "to explain my missing reference link. i was assuming that everyone knows ..."
Assume => AssUme :-)
"yes i have a good dmx source. i will be send dmx from an app on my laptop via usb enttec pro."
So you will be sending DMX data from a host PC to a Enttec DMX USB Pro Mk2?
Then receiving that RS485 data, via a RS485 transceiver, through a USART on the Maple?
"ISR(USART0_RX_vect)" is Arduino (AVR) specific.
The ISR(...)
tells the gcc compiler for AVR to generate code for an interrupt service routine, which is different from an ordinary function.
The good news is ISR()
isn't needed on an ARM Cortex-M. The calling convention for functions and interrupt service routines (the ARM Cortex ABI) is the same, so every function generated by gcc for Cortex-M can also be used as an interrupt service routine.
UCSR1A
, is specific to the AVR USART peripheral.
You'll need to look at ST Micro's STM32F103xB reference manual (listed at http://wiki.leaflabs.com/index.php?title=Resources)
The reference manual for STM32F1 is called "RM0008". Chapter 27 describes the Maple's USARTs.
To make some progress, and minimise complexity, I'd suggest avoiding using interrupts and just try to read the Maple USART, or check if there is a character available. To make this easier, set the DMX framerate very low (say 1Hz).
If you do want to provide an interrupt service routine, then I've had a quick look in http://leaflabs.com/docs/lang/api/serial.html
and can't find a way to set a user UART interrupt service routine at run-time in your code.
However, in the source of usart.c, it does set-up a bunch of functions which look like interrupt service routines, i.e,
void __irq_usart1(void) {
usart_irq(USART1);
}
Those routines 'catch' and buffer characters for you, so you might want to copy and modify that file, and append your code:
void __irq_usart1(void) {
usart_irq(USART1);
my_irq_code(USART1);
}
I think, because the interrupt service routine buffers characters into memory when the interrupt triggers, you have a bit more flexibility and time to process a character than on the Arduino (which only has one character of buffer in the peripheral hardware), so you may find you can get a lot of code working using .available()
or .read()
.
(Health Warning: I haven't checked that the USART in-memory buffer is more than one character though.)
You must log in to post.