WS2812B library support in atmel studio

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

I am trying to work with WS2812B RGB LED(GPIO Controlled) + SAML21 in Atmel studio.

 

Board: SAML21 Xplained Pro

Sensor: WS2812B RGB LED

IDE: Atmel studio

 

Looking for WS2812B Library which supports ATMEL Studio.  I could not find any reference library online.

 

How do I do this? If anyone can help, that would be great.

 

I have tried to port Arduino library below libraries. But no outcome.

https://github.com/adafruit/Adaf...

https://github.com/kitesurfer140...

 

Thanks in Advance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

katlin wrote:
Sensor: WS2812B RGB LED

Errr ... that's not a sensor 

 

katlin wrote:
How do I do this? If anyone can help, that would be great.

Search the AVR section of the forum - there's loads of discussion there.

 

Also google:  there are lots of people who have done this in various ways - and documented it online.

 

katlin wrote:
I have tried to port Arduino library below libraries. But no outcome.

You realise that Atmel Microchip Studio can import an Arduino "sketch" ... ?

 

https://www.avrfreaks.net/forum/...

 

EDIT

 

WS2812B Library which supports ATMEL Studio

The important thing is not Atmel Microchip Studio - that's just a fancy GUI.

 

The important things are:

  1. That the code is either for Cortex-M, or is independent of the CPU architecture
  2. That the code is compatible with the tooolchain used - ie, GCC.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Feb 23, 2021 - 03:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi awneil,

 

I was familiar with Atmel studio supports Arduino sketches. But I want to use ATMEL Software Framework, not Arduino code.

 

I am looking something in these lines: https://github.com/benlhy/WS2812... for SAML21 Xplained Pro Board.

Last Edited: Wed. Feb 24, 2021 - 07:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

katlin wrote:
I want to use ATMEL Software Framework, not Arduino code.

Once it has been imported, it becomes just a standard MS project - totally independent of your Arduino installation & IDE.

 

So you can work from there as you wish.

 

I am looking something in these lines: https://github.com/benlhy/WS2812... for SAML21 Xplained Pro Board.

So use that, then?

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Getting timing issues. Don't know how to solve that.

Last Edited: Thu. Feb 25, 2021 - 03:28 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You'll have to analyse the code:

  1. How is it trying to achieve the correct timings?
  2. Where is that going wrong?
  3. Fix that!

 

You could raise an Issue in GitHub: https://github.com/benlhy/WS2812b-SAMD10/issues/1

 

EDIT

 

The code provides a set of links - have you studied them to understand what's going on?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Feb 25, 2021 - 08:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The implementation provided in the GitHub reference is matching with the functionality of WS2812b mentioned in the datasheet.

 

So I am re-using the same code.  Changed the SPI Defintions as per the SAML21. But RGB LED is not working.

Last Edited: Fri. Feb 26, 2021 - 02:49 AM