<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: read DMX</title>
		<link>http://forums.leaflabs.com/topic.php?id=10192</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:17:33 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=10192" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22277</link>
			<pubDate>Tue, 05 Feb 2013 12:53:57 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">22277@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;stephanschulz - &#60;em&#62;&#34;to explain my missing reference link. i was assuming that everyone knows ...&#34;&#60;/em&#62;&#60;br /&#62;
Assume =&#38;gt; AssUme :-)&#60;/p&#62;
&#60;p&#62;&#60;em&#62;&#34;yes i have a good dmx source. i will be send dmx from an app on my laptop via usb enttec pro.&#34;&#60;/em&#62;&#60;/p&#62;
&#60;p&#62;So you will be sending DMX data from a host PC to a &#60;a href=&#34;http://www.enttec.com/?main_menu=Products&#38;amp;pn=70314&#34;&#62;Enttec DMX USB Pro Mk2&#60;/a&#62;?&#60;br /&#62;
Then receiving that RS485 data, via a RS485 transceiver, through a USART on the Maple?&#60;/p&#62;
&#60;p&#62;&#60;em&#62;&#34;ISR(USART0_RX_vect)&#34;&#60;/em&#62; is Arduino (AVR) specific. &#60;/p&#62;
&#60;p&#62;The &#60;code&#62;ISR(...)&#60;/code&#62; tells the gcc compiler for AVR to generate code for an interrupt service routine, which is different from an ordinary function.&#60;/p&#62;
&#60;p&#62;The good news is &#60;code&#62;ISR()&#60;/code&#62; 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.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;UCSR1A&#60;/code&#62;, is specific to the AVR USART peripheral.&#60;br /&#62;
You'll need to look at ST Micro's STM32F103xB reference manual (listed at &#60;a href=&#34;http://wiki.leaflabs.com/index.php?title=Resources)&#34; rel=&#34;nofollow&#34;&#62;http://wiki.leaflabs.com/index.php?title=Resources)&#60;/a&#62;&#60;br /&#62;
The reference manual for STM32F1 is called &#34;RM0008&#34;. Chapter 27 describes the Maple's USARTs.&#60;/p&#62;
&#60;p&#62;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).&#60;/p&#62;
&#60;p&#62;If you do want to provide an interrupt service routine, then I've had a quick look in &#60;a href=&#34;http://leaflabs.com/docs/lang/api/serial.html&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/lang/api/serial.html&#60;/a&#62;&#60;br /&#62;
and can't find a way to set a user UART interrupt service routine at run-time in your code.&#60;/p&#62;
&#60;p&#62;However, in the source of usart.c, it does set-up a bunch of functions which look like interrupt service routines, i.e,&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;void __irq_usart1(void)  {
    usart_irq(USART1);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Those routines 'catch' and buffer characters for you, so you might want to copy and modify that file, and append your code:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;void __irq_usart1(void)  {
    usart_irq(USART1);
    my_irq_code(USART1);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;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 &#60;code&#62;.available()&#60;/code&#62; or &#60;code&#62;.read()&#60;/code&#62;.&#60;br /&#62;
(Health Warning: I haven't checked that the USART in-memory buffer is more than one character though.)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22274</link>
			<pubDate>Tue, 05 Feb 2013 10:49:06 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">22274@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;thanks for your replies.&#60;/p&#62;
&#60;p&#62;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.&#60;br /&#62;
but i will make sure to give all details in the future.&#60;/p&#62;
&#60;p&#62;gbulmer - yes i have a good dmx source. i will be send dmx from an app on my laptop via usb enttec pro.&#60;/p&#62;
&#60;p&#62;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:&#60;br /&#62;
ISR(USART0_RX_vect)&#60;br /&#62;
UCSR1A&#60;/p&#62;
&#60;p&#62;which seem arduino specific.&#60;/p&#62;
&#60;p&#62;thx.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22231</link>
			<pubDate>Sat, 02 Feb 2013 20:25:04 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">22231@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ah! Assume - AssUme :-)&#60;/p&#62;
&#60;p&#62;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.&#60;/p&#62;
&#60;p&#62;stephanschulz - have you got a good quality source of DMX messages so that you can test it?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22230</link>
			<pubDate>Sat, 02 Feb 2013 20:15:27 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">22230@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I wasn't so much guessing as making an assumption, but usually it sometimes will speed things along.&#60;/p&#62;
&#60;p&#62;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.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22229</link>
			<pubDate>Sat, 02 Feb 2013 20:05:04 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">22229@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;crenn - why guess when the OP can give facts?-), especially as the OP wrote &#34;what would i have to do to receive DMX data?&#34; and the link you posted is titled &#34;ArDMX - Simple DMX Receiver Code&#34;!-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22228</link>
			<pubDate>Sat, 02 Feb 2013 20:00:31 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">22228@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;actually i was referring to this library made for the maple:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://wiki.leaflabs.com/index.php?title=DMX-512&#34; rel=&#34;nofollow&#34;&#62;http://wiki.leaflabs.com/index.php?title=DMX-512&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;but true i am also looking at other option as you can see in that other post.&#60;/p&#62;
&#60;p&#62;thanks for any input.&#60;/p&#62;
&#60;p&#62;s.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22227</link>
			<pubDate>Sat, 02 Feb 2013 19:24:29 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">22227@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;gbulmer, he posted the link in this thread:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=10108&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=10108&#60;/a&#62;&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;i found this arduino example: &#60;a href=&#34;http://playground.arduino.cc//DMX/Ardmx&#34; rel=&#34;nofollow&#34;&#62;http://playground.arduino.cc//DMX/Ardmx&#60;/a&#62;&#60;/p&#62;&#60;/blockquote&#62;</description>
		</item>
		<item>
			<title>gbulmer on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22226</link>
			<pubDate>Sat, 02 Feb 2013 19:09:32 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">22226@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;stephanschulz - please post a link to the DMX example you are referring to.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "read DMX"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10192#post-22209</link>
			<pubDate>Fri, 01 Feb 2013 15:38:12 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">22209@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hi&#60;/p&#62;
&#60;p&#62;i found the DMX example and noticed that it only sends DMX data.&#60;br /&#62;
what would i have to do to receive DMX data?&#60;br /&#62;
in my case i only need read not send.&#60;/p&#62;
&#60;p&#62;thx.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
