<?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; User Favorites: stephanschulz</title>
		<link><a href='http://forums.leaflabs.com/profile.php?id=6656'>6656</a></link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:10:10 +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?profile=6656" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "USART3 Interrupt Grabbing?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1134&amp;page=2#post-105731</link>
			<pubDate>Sat, 02 May 2015 03:22:07 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">105731@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;While LeaqfLabs have 'end of lifed' their production of the product, it is still easy to get Maple or Maple mini, that is part of the potential power of Open Source Hardware.&#60;br /&#62;
For example search for &#60;a href=&#34;http://www.ebay.com/sch/i.html?_from=R40&#38;amp;_nkw=leaflabs+maple&#38;amp;_sacat=0&#34;&#62;&#34;leaflabs maple&#34; at eBay&#60;/a&#62;.&#60;br /&#62;
Mini's are under $5.&#60;/p&#62;
&#60;p&#62;So, IMHO, it is still worth sharing code, and, as @stephanschulz has written, it might also be ported to other manufacturers MCUs.&#60;/p&#62;
&#60;p&#62;I would add, AFAICT, DMA varies between different manufacturers, so it will take a bit of work to move to other manufacturers MCUs. Also, ST Micro's Nucleo's are 'cheap as chips', so that might provider another path to make low-level code available.&#60;/p&#62;
&#60;p&#62;(Full disclosure: I am not a member of LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "USART3 Interrupt Grabbing?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1134&amp;page=2#post-105727</link>
			<pubDate>Wed, 29 Apr 2015 14:39:08 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">105727@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@konan&#60;br /&#62;
did you ever get your DMX code working by using DMA channels? want to share what your got?&#60;/p&#62;
&#60;p&#62;i know the maple is dead but other ARM micros like the Teensy might benefit from a DMA - DMX library :)&#60;/p&#62;
&#60;p&#62;thanks,&#60;br /&#62;
stephan.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>nickc on "USART3 Interrupt Grabbing?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1134#post-66804</link>
			<pubDate>Fri, 04 Oct 2013 11:42:12 +0000</pubDate>
			<dc:creator>nickc</dc:creator>
			<guid isPermaLink="false">66804@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;This forum post doesn't quite resolve this issue for me.&#60;/p&#62;
&#60;p&#62;What is the correct method for overriding default interrupt handlers?&#60;/p&#62;
&#60;p&#62;For example, I get multiple definitions errors of __irq_usart1 in the maple IDE unless I go in and comment out the code in the library usart.c&#60;/p&#62;
&#60;p&#62;It doesn't seem like there's currently any method or compiler macro in libmaple is this the case?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "L9822 solenoid 8bit spi driver"</title>
			<link>http://forums.leaflabs.com/topic.php?id=12403#post-27163</link>
			<pubDate>Sat, 22 Jun 2013 16:12:34 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">27163@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;stephanschulz - It might be helpful to add that that device appears to like a nominal 5V power supply.&#60;br /&#62;
At that voltage, its spec says its input pins would like a minimum of 0.7*5V  = 3.5V.&#60;br /&#62;
It's signal pins could be driven directly at a slightly lower voltage, e.g. a Maple output pin. Certainly try it, but it might be a bit sensitive to electrical noise.&#60;/p&#62;
&#60;p&#62;So the pins could be driven by 5V tolerant pins, using pull-up resistors to reach 5V, and set up with pinMode OUTPUT_OPEN_DRAIN.&#60;br /&#62;
AFAICT, the SPI input signals need to rise and fall reasonably quickly (i.e. 200ns), so relatively small pull-up resistors would be needed.&#60;/p&#62;
&#60;p&#62;Some of the Maple SPI pins are &#60;strong&#62;not&#60;/strong&#62; 5V tolerant.&#60;br /&#62;
So, for example D11 (SPI MOSI) and D13 (SPI SCK) are not 5V tolerant, and if they have a bit of a problem driving that chip directly, they couldn't be pulled up to 5V with pull-up resistors.&#60;br /&#62;
D32 (SCK) and D34 (MOSI) might be better because they are 5V tolerant, so you could try directly driving L9822 pins, or using pull-up resistors.&#60;/p&#62;
&#60;p&#62;It looks like all the SPI signals need have 'slower' rise time, or fall time than 200ns.&#60;br /&#62;
The Maple GPIOs are normally set up for a 50MHz rise/fall, so if there are problems, it might be worth having a look at &#60;code&#62;gpio_set_mode&#60;/code&#62; and setting the rise/fall time a bit slower.&#60;br /&#62;
For example &#60;code&#62;GPIO_CR_CNF_OUTPUT_OD &#124; GPIO_CR_MODE_OUTPUT_10MHZ&#60;/code&#62; or even &#60;code&#62;&#60;/code&#62;GPIO_CR_CNF_OUTPUT_OD &#124; GPIO_CR_MODE_OUTPUT_2MHZ`&#60;br /&#62;
WARNING: I've never tried this!&#60;/p&#62;
&#60;p&#62;The L9822 looks very tolerant to being driven at low speed. AFAICT, it has no lower speed.&#60;br /&#62;
So you could write a simple 'shift_out' function using two digital pins, and just setting them with digitalWrite. This might be useful if you haven't got an oscilloscope, or have problems with SPI. Using a 'soft-SPI' would allow the bits to be written so slowly that LEDs could be wired up the the soft-SPI-equivalent signals, or &#60;code&#62;print/println&#60;/code&#62; could be used, and you could see what is happening. The pins would be set up for pinMode OUTPUT_OPEN_DRAIN.&#60;/p&#62;
&#60;p&#62;A small aside; that chip could be 'emulates' using an ordinary, cheap 8bit SIPO shift register ($0.50) driving LEDs. Judicous choice of part would work at 3.3V too, so you could do software development and testing without a 5V power supply.&#60;/p&#62;
&#60;p&#62;Tiny aside: the L9822 is listed as obsolete e.g. a Mouser, but the L9822E is active, so I assume that's the part about to be used.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mlundinse on "L9822 solenoid 8bit spi driver"</title>
			<link>http://forums.leaflabs.com/topic.php?id=12403#post-27123</link>
			<pubDate>Fri, 21 Jun 2013 13:10:49 +0000</pubDate>
			<dc:creator>mlundinse</dc:creator>
			<guid isPermaLink="false">27123@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Its all in the datasheet so its good to practice how to read them, sure&#60;br /&#62;
they can be anything from clear  and easy to understand to completly confusing&#60;br /&#62;
and filled with errors.&#60;/p&#62;
&#60;p&#62;You will not be sure until you have tried it out, but from what I can see&#60;br /&#62;
it is MSB, clock idling low, data capture on first clock transition, that would be&#60;br /&#62;
Spi Mode 0, and max clock frequency of 2MHz. &#60;/p&#62;
&#60;p&#62;The maximumum clock frequency also depends upon the amount of noise in the system&#60;br /&#62;
and length and capacitance of connecting leads. So start with a low clock and&#60;br /&#62;
increase it. If you have an oscilloscope you can watch the waveforms as you increase&#60;br /&#62;
spi clock frequency.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "L9822 solenoid 8bit spi driver"</title>
			<link>http://forums.leaflabs.com/topic.php?id=12403#post-27113</link>
			<pubDate>Fri, 21 Jun 2013 09:23:08 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">27113@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;i am planning to use this smart solenoid driver &#60;a href=&#34;http://www.st.com/web/en/resource/technical/document/datasheet/CD00000110.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.st.com/web/en/resource/technical/document/datasheet/CD00000110.pdf&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;but i am uncertain how to use the maple's spi library to communicate with this chip&#60;/p&#62;
&#60;p&#62;can anyone take a look at the documentation and tell me which mhz, which mode etc to select?&#60;/p&#62;
&#60;p&#62;thanks so much.&#60;br /&#62;
stephan
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=3#post-25535</link>
			<pubDate>Mon, 29 Apr 2013 17:45:56 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">25535@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;stephanschulz - I think the thing that gives the high performance are the LED strips which handle PWM themselves.&#60;/p&#62;
&#60;p&#62;For example, have a look at &#60;a href=&#34;http://www.adafruit.com/products/306&#34; rel=&#34;nofollow&#34;&#62;http://www.adafruit.com/products/306&#60;/a&#62;&#60;br /&#62;
which have Arduino libraries for driving the LED strip.&#60;/p&#62;
&#60;p&#62;Maple has two SPI peripherals, so it could drive two sets of strips with very low overhead.&#60;/p&#62;
&#60;p&#62;Edit:  The performance of the mbed they use is pretty close to Maple, i.e. it is the same Cortex-M3 processor, running a bit faster. Hence I think pushing the problem of controlling brightness into the smart LED strips has a much more dramatic effect on the performance of the overall system. Once set, the smart strips will handle PWM for themselves until the brightness needs to change.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tlgosser on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=3#post-25423</link>
			<pubDate>Sat, 27 Apr 2013 14:30:55 +0000</pubDate>
			<dc:creator>tlgosser</dc:creator>
			<guid isPermaLink="false">25423@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I see, you engineer for Rafael Lozano-Hemmer.  I used to to do similar work in the 90's.  I worked for Bob Bielecki - he's the guy who engineered (and, ahem, often proposed) Laurie Anderson's technology art.  And I was Roxy Paine's engineer for a while. It was all PIC programming and parallel port back then, writing c++ with djgpp with Allegro.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tlgosser on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=3#post-25421</link>
			<pubDate>Sat, 27 Apr 2013 13:04:06 +0000</pubDate>
			<dc:creator>tlgosser</dc:creator>
			<guid isPermaLink="false">25421@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Are you working for this artist?  Or do you mean that you are working on something similar?&#60;/p&#62;
&#60;p&#62;That looks like it could be a great out-of-box solution and it would eliminate any 'malfunction anxiety'.  If something goes wrong you'd just toss it in the garbage and plug in another one.  &#60;/p&#62;
&#60;p&#62;Would this interface with your DMX?  Their description is confusing.  Sounds... unique.&#60;/p&#62;
&#60;p&#62;Thanks for tip about the avatar.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=3#post-25408</link>
			<pubDate>Fri, 26 Apr 2013 20:44:13 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">25408@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;the profile image just showed up, because i registered with &#60;a href=&#34;http://www.gravatar.com&#34; rel=&#34;nofollow&#34;&#62;http://www.gravatar.com&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;the leds are for this piece: &#60;a href=&#34;http://lozano-hemmer.com/voice_array.php&#34; rel=&#34;nofollow&#34;&#62;http://lozano-hemmer.com/voice_array.php&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;i just saw this, which makes me rethink my use of the maple for this project: &#60;a href=&#34;http://www.heroicrobotics.com&#34; rel=&#34;nofollow&#34;&#62;http://www.heroicrobotics.com&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tlgosser on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=2#post-25407</link>
			<pubDate>Fri, 26 Apr 2013 20:00:42 +0000</pubDate>
			<dc:creator>tlgosser</dc:creator>
			<guid isPermaLink="false">25407@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Of course.  That is why you are participating in the port registers forum.  That's a lot of LEDs.  Are you making a monitor?&#60;br /&#62;
With LEDs it's all about the refresh rate in your eyeballs somehow.&#60;/p&#62;
&#60;p&#62;Btw how did you change your icon?  I don't mean to sound insecure but my icon was assigned to me randomly and I assumed it would be simple to change.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=2#post-25396</link>
			<pubDate>Fri, 26 Apr 2013 19:00:17 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">25396@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;thanks for the reply.&#60;/p&#62;
&#60;p&#62;i figured out my problem. i was trying to access an array element that did not exist.&#60;/p&#62;
&#60;p&#62;about the dimming. i am just doing it linear, but your idea of some sort of curve is interesting. i did notice that the leds dim more noticeably in the lower numbers.&#60;br /&#62;
but i am also concerned that the dimming of my 16 leds takes up too much time and in turn messes up the dmx receiving. i have 16 channels per maple mini and a chain of 30 boards.&#60;/p&#62;
&#60;p&#62;all works well at this point though.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tlgosser on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=2#post-25384</link>
			<pubDate>Fri, 26 Apr 2013 16:09:39 +0000</pubDate>
			<dc:creator>tlgosser</dc:creator>
			<guid isPermaLink="false">25384@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I'm looking at this on my phone so it's difficult to read.&#60;br /&#62;
Is the dmx dimming data already 'curved' or are you generating&#60;br /&#62;
linear gradients here ++?&#60;/p&#62;
&#60;p&#62;The maple is fast enough to run the arduino spline library effectively&#60;br /&#62;
if you want to interpolate  splines on board.&#60;br /&#62;
&#60;a href=&#34;https://github.com/kerinin/arduino-splines&#34; rel=&#34;nofollow&#34;&#62;https://github.com/kerinin/arduino-splines&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I think you only have to replace Arduino.h with WProgram.h
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=2#post-25372</link>
			<pubDate>Fri, 26 Apr 2013 10:42:42 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">25372@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;now it works. i had some other problem that were not apparent when using gpio_write_bit and only showed up when using digitalwrite. works great this library.&#60;br /&#62;
thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "Port Registers on Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=737&amp;page=2#post-25371</link>
			<pubDate>Fri, 26 Apr 2013 09:10:27 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">25371@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;this looks very interesting.&#60;/p&#62;
&#60;p&#62;i tried to integrate it in to my project which also receives dmx data. &#60;/p&#62;
&#60;p&#62;digitalWriteFaster works fine before running my dmx setup routine. could it be that some of my dmx pins are being effect by the digitalWriteFaster.h library?&#60;/p&#62;
&#60;p&#62;i am using pin 25 to receive dmx data&#60;/p&#62;
&#60;p&#62;-------------dmx code-----------------&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;enum
{
  DMX_IDLE,
  DMX_BREAK,
  DMX_START,
  DMX_RUN
};

// We need to read the data register in order to avoid overrun errors,
// but we don&#38;#39;t do anything with the value. This attribute silences an
// unused variable warning from GCC.
#define __unused __attribute__((unused))

volatile unsigned char dmx_state;

// this is the start address for the dmx frame
//const unsigned int dmx_start_addr = 0;
unsigned int dmx_start_addr = 0;

// this is the current address of the dmx frame
volatile unsigned int dmx_addr;

//// this is used to keep track of the channels
volatile unsigned int chan_cnt;

extern &#38;quot;C&#38;quot; {
  void __irq_usart1(void) {
    unsigned char status = USART1_BASE-&#38;gt;SR;
    data = USART1_BASE-&#38;gt;DR;

    switch (dmx_state)
    {
    case DMX_IDLE:
      if (status &#38;amp; 1&#38;lt;&#38;lt;USART_SR_FE_BIT)
      {
        dmx_addr = 0;
        dmx_state = DMX_BREAK;
        update = 1;
        //delayMicroseconds(8);
      }
      break;

    case DMX_BREAK:
      if (data == 0)
      {
        dmx_state = DMX_START;
      }
      else
      {
        dmx_state = DMX_IDLE;
      }
      break;

    case DMX_START:
      dmx_addr++;

      if (dmx_addr == dmx_start_addr)
      {
        chan_cnt = 0;
        dmx_data[chan_cnt++] = data; //constrain(data,0,maxDMXvalue); //data;
        dmx_state = DMX_RUN;
      }
      break;

    case DMX_RUN:
      //for (int wasteTime =0; wasteTime &#38;lt;2; wasteTime++) {}
      dmx_data[chan_cnt++] = data; //constrain(data,0,maxDMXvalue); //data;
      if (chan_cnt &#38;gt;= DMX_NUM_CHANNELS)
      {
       // printTestStage = 2;
        dmx_state = DMX_IDLE;
      }
      break;

    default:
      dmx_state = DMX_IDLE;
      break;
    }
  }
}

void setup_dmx(){
  update = 0;

  // set default DMX state
  dmx_state = DMX_IDLE;
dmx_start_addr = myGroupID * 16 + 1;
  Serial1.begin(250000);

  // Set USART1 to 2 stop bits
  USART1_BASE-&#38;gt;CR2 = 2;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;---------------------and this is my dimming code------------------------&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;void setup_dimming(){
  for(int i=0; i&#38;lt;DMX_NUM_CHANNELS; i++){
    pinMode(ledPin[i],OUTPUT_OPEN_DRAIN);
    // dimValue[i] = counterLimit/DMX_NUM_CHANNELS * i;
  }

  Timer3.setPrescaleFactor(1);
  Timer3.setOverflow(255); //2000); //500); //1079);
  Timer3.attachCompare1Interrupt(timer3_dimming_handler);
}

void timer3_dimming_handler(void) {
  for(int i=0; i&#38;lt;DMX_NUM_CHANNELS; i++){

    if(dmx_data[i] &#38;gt; counter){
      dimStates[i] = true;
    }
    else{
      dimStates[i] = false;
    }
    digitalWriteFaster(ledPin[i],dimStates[i]);

    //if(LED_PORTref_ARRAY[i] == 0) gpio_write_bit(GPIOA, LED_BIT_ARRAY[i],dimStates[i]);
    //if(LED_PORTref_ARRAY[i] == 1) gpio_write_bit(GPIOB, LED_BIT_ARRAY[i],dimStates[i]);
    //digitalWrite(ledPin[i],dimStates[i]);

  }

  counter++;
  if(counter &#38;gt; counterLimit) counter = 0;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
