Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Arduino and Netduino code porting


  • Please log in to reply
5 replies to this topic

#1 fexxx

fexxx

    New Member

  • Members
  • Pip
  • 2 posts

Posted 25 October 2010 - 08:19 AM

Hello,


I've done a small personal project using Arduino that uses an LDP6803 based LED strip for lighting. The LED strip is driven every 25 microseconds using an interrupt for Arduino's hardware clock. The interrupt code is responsible for sending 16 bits per LED to the LED strip.

The code for sending the actual bits looks like this:

digitalWrite(dataPin, bit);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);

As an experienced .NET developer I would like to starting using NetDuino, can anybody tell me how I would go about porting this code? From what I've seen it looks like I can just create two output ports and write to them, but I am uncertain about the 25 microseconds clock interval.

Thanks!!

#2 SkyLiberty

SkyLiberty

    Member

  • Members
  • PipPip
  • 22 posts

Posted 26 October 2010 - 05:11 PM

So .Net is not a language, is a framework!! So you have to understand it to begin coding!

For the particular translation you asked:
OutputPort out =new OutputPort(Pins.GDIO1,false); //this initialize the obkect that work on digital output

out.write(true); //or false --------> send the data thruth the port

But what knoledge do you have on C# ?

#3 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 26 October 2010 - 06:15 PM

Hello,


I've done a small personal project using Arduino that uses an LDP6803 based LED strip for lighting. The LED strip is driven every 25 microseconds using an interrupt for Arduino's hardware clock. The interrupt code is responsible for sending 16 bits per LED to the LED strip.

The code for sending the actual bits looks like this:

digitalWrite(dataPin, bit);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);

As an experienced .NET developer I would like to starting using NetDuino, can anybody tell me how I would go about porting this code? From what I've seen it looks like I can just create two output ports and write to them, but I am uncertain about the 25 microseconds clock interval.

Thanks!!


If the timings are that tight then you can not achive it from c#, check out the discussions on the bitbanger firmware.

#4 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 26 October 2010 - 07:37 PM

I've done a small personal project using Arduino that uses an LDP6803 based LED strip for lighting. The LED strip is driven every 25 microseconds using an interrupt for Arduino's hardware clock. The interrupt code is responsible for sending 16 bits per LED to the LED strip.

If the timings are that tight then you can not achive it from c#, check out the discussions on the bitbanger firmware.

I have not looked into the LDP6803 datasheet, but sending 16-bits at 25 µs clock can be achieved by Netduino's SPI interface - use 40 kHz clock rate and 16-bit Write() method. But I am not sure if the '16 bits per LED' must be transmitted continuously, or once a time.

#5 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 26 October 2010 - 08:33 PM

I have not looked into the LDP6803 datasheet, but sending 16-bits at 25 µs clock can be achieved by Netduino's SPI interface - use 40 kHz clock rate and 16-bit Write() method. But I am not sure if the '16 bits per LED' must be transmitted continuously, or once a time.


Hi Fexelein

Do you have URL for a data sheet or application note for the LDP6803? There appears to be lots of references to products using the chip but not the chip it self.

#6 fexxx

fexxx

    New Member

  • Members
  • Pip
  • 2 posts

Posted 12 January 2015 - 09:30 PM


Do you have URL for a data sheet or application note for the LDP6803? There appears to be lots of references to products using the chip but not the chip it self.

 

http://www.adafruit....ets/LPD6803.pdf






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.