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

TM1803 v2 LED Strip


  • Please log in to reply
8 replies to this topic

#1 KenTi

KenTi

    Member

  • Members
  • PipPip
  • 11 posts

Posted 17 May 2015 - 04:55 PM

Being a complete newbie and have no clue what I'm doing, I was wondering if someone can point me in the right direction.

 

I have a couple of RGB LED strips from Radio Shack that use the TM1803 controller. Is it possible to drive it using the Netduino? They use 1 wire for communication and it takes 12v at least 1 amp... I'm using a 12v 2amp adapter.

 

What method do I use to send it information? I have the Arduino code and the strips work fine, but I'd like to move it over to the Netduino, but since I'm such a newbie at this stuff, I'm not sure what pin I use (analog or digital) and how to send the information. I tried a bunch of different things but the strip just sits there and taunts me :-)

 

The arduino code seems to do a direct port write with a bunch of no ops to put in the required delay's when sending the 24 bit data structure. But converting that to .Net has stumped me.

 

To represent a High signal the TM1803 expects to see a signal with a period of 2.04uS and a duty cycle of 66%

To represent a Low signal the TM1803 expects to see a signal with a period of 2.04uS and a duty cycle of 33%

To represent a Reset signal the TM1803 expects to see a Low for 24uS

 

Any push in the right direction would help.

 

Attached is the data sheet for the chip.

Attached Files



#2 HSven1611

HSven1611

    Member

  • Members
  • PipPip
  • 14 posts

Posted 18 May 2015 - 07:18 AM

Hi

 

Netduinos digital IOs are to slow and to unpredictable to control your LEDs. You should try this:

http://jcoder.me/blo...ws2812-rgb-led/

 

Regards

Sven



#3 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 18 May 2015 - 07:58 AM

There is also an article on Adafruit's web site regarding using Neopixel's with the Netduino Plus 2 which may also be interesting.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#4 Lunddahl

Lunddahl

    Advanced Member

  • Members
  • PipPipPip
  • 152 posts
  • LocationEurope, Denmark

Posted 18 May 2015 - 09:58 PM

Netduinos digital IOs are to slow and to unpredictable to control your LEDs. You should try this:

http://jcoder.me/blo...ws2812-rgb-led/

 

Would it be possible to control the new DotStar LED Strips, they have a separate clock signal ?

 

https://learn.adafru...it-dotstar-leds



#5 HSven1611

HSven1611

    Member

  • Members
  • PipPip
  • 14 posts

Posted 19 May 2015 - 02:52 PM

Hi

 

As far as I can see yes.

 

This seems to be the datasheet of the used LEDs:

http://www.adafruit....eets/APA102.pdf

 

As you can see on page 4, you need to make sure, your SPI Data is valid during the high flank of your SPI Clock signal.

 

(btw.: Thak you for that information about those awesome new LED stripes!!)



#6 KenTi

KenTi

    Member

  • Members
  • PipPip
  • 11 posts

Posted 19 May 2015 - 07:54 PM

Thank you HSven1611... JCoder's code actually got me closer... I'm able to light up some of the strip now (still playing around with my limited time)

 

Now why is it that if I do the following:

SPI.Configuration spiConfig = new SPI.Configuration(Pins.GPIO_PIN_D10, false, 0, 0, false, true, 6666SPI.SPI_module.SPI1);

 

I actually have to hook up my green wire to pin 11???  :wacko:

 

Looking at the code, I would think hooking it up to PIN 10 for the Digital I/O would be what I do.

 



#7 HSven1611

HSven1611

    Member

  • Members
  • PipPip
  • 14 posts

Posted 20 May 2015 - 11:08 AM

Hi KenTi

 

Some basic information about SPI:

A Spi Interface generally contains 4 Pins:

1. SCK - Thats the clock signal. Netduinos have this signal connected to Pin 13

2. MoSi (Master Out Slave In) - Thats the data signal that goes from the controller to the connected slave. Netduino Pin 11

3. MiSo (Master In Slave Out) - Data going from the connected slave to the controller. Netduino Pin 12

4. CS (Chip Select) - Thats the signal that shows the connected slave that data transmitted on MoSi is ment do be received by that client and the client is allowed to send data on the MiSo line. 

 

The ChipSelect Pin is actually necessary only if you connect 2 or more clients to one single SPI interface.

 

Now back to your question:

You need to connect your green wire to Pin 11 because you want to use the SPI interfaces data output to "talk" to the LEDs. The Chip Select signal is nor used in that application. Neither the clock and the MiSo signals.

 

I do not know if it is possible to use the SPI interface and only map the MoSi signal to the Netduinos Outputs to save pins for other applications. Maybe one of the other people here might know that.

 

Best Regards

 

Sven



#8 KenTi

KenTi

    Member

  • Members
  • PipPip
  • 11 posts

Posted 20 May 2015 - 05:32 PM

Hi Sven,

  Thank you for that very informative reply. Since I'm always trying to look for sources, where did you learn this or is this something that's general knowledge and I should have known  :)

 

So, to make sure I understand, I could have put anything in place of Pins.GPIO_PIN_D10 (like PIN_D09) and that would not have mattered? The pins 11, 12 and 13 are always the same for the purpose of SPI?

 

Again, thank you very much for sharing your knowledge... 



#9 HSven1611

HSven1611

    Member

  • Members
  • PipPip
  • 14 posts

Posted 20 May 2015 - 06:45 PM

Hi

 

So, to make sure I understand, I could have put anything in place of Pins.GPIO_PIN_D10 (like PIN_D09) and that would not have mattered? The pins 11, 12 and 13 are always the same for the purpose of SPI?

 

 

As far as I know, that's correct.

 

I don't know, if thats general knowledge. I leaned that stuff in university during my Electrical Engeneering studies.






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.