1. Tell us WHAT you are trying to do. That is, please tell us (a) what you have done, (b) what you expected to happen, and (c) why you think that (a) should result in (b)!!
(a): I am trying to address 10 LEDs in a WS2812B LED strip to be a series of colors. And just leave them on. Once I get this working, I can continue to the main large scale grid project I am working on. I am basing my code off of a code for Arduino called Bitbang_whitish (found at http://www.instructables.com/id/... also attached below, original and modified). In the arduino IDE, I can use this code to generate all LEDs white, modifiy it to change their color, and add variables and if-statements to use magnetic reed switches to control when the lights turn on. The problem is I need to use the ATmega324pb as part of a course requirement, not an Arduino. I started with the arduino as a proof of concept.
(b): I worked with partially with a teacher's assistant to transfer the code from Arduino into Atmel Studio 7. We have modified the code significantly to work in c++. I unfortunately feel the the inline assembly portion of the arduino code might not be ported over properly, that is my first suspicion as to why it does not work and I am unsure on how to solve it. The code compiles, and according to oscilloscope readings there appears to be high and low data being sent out of the data pin (PORTB0), but it is much more infrequent than it should be. the LEDs remain off.
2. Provide us with CODE. Don't hand copy the code, but copy and paste, so that errors are preserved. Use the code buttons at the beginning and end of the code listing (works best if you click the code button, paste the code, then click the "end-code" button at the end). This will make it much easier to read and others will be more likely to look at it. If the code is big (maybe more than a 50-100 lines or so), reduce the code to a small version that demonstrates the same problem. Make sure that the code you provide COMPILES! PLEASE, tell us what compiler or assembler and what version you are using.
I have attached my Atmel studio project in a .zip file. I commented out many of the statements in the main and left only enough to turn the LEDs on (setColorRGB calls for each light).
3. Tell us how the FUSES are set and what you use as a clock source.
I am using the external crystal oscillator on the ATmega324PB Xplained PRO dev board. I have attached a screenshot of the fuses menu (screenshot says simulator as I do not currently have the xplained connected, but the information is the same settings).
4. Tell us what PROCESSOR you are using.
I am unsure what you mean.
5. Tell us if you have tried to SIMULATE the operation of the code. If you did, tell us what you found.
Well, I was able to get a simple code to turn the LEDs on when a switch was pressed. with some LEDs I changed to color of it when the switch was closed. It works in Arduino.
6. Provide us with some DETAILED OBSERVATIONS about what it is or is not doing. This should relate to 1(b)(, above. "Doesn't work" covers a lot of territory! Is your LED off when it should be flashing, is your motor turning or not. Tell us what test equipment (volt meter, oscilloscope, etc) are available to you, what measurements you have actually made, and what the measurement results were.
I think I may have answered this earlier, but ask for more if needed.
7. If you have some suspicions about why it does not work, tell us what the evidence is for your diagnosis.
The inline assembly text is red, which I am unsure if that is normal when using asm in a main.cpp. I am unfamiliar with the use of assembly, but because the timing needs to be precise (0.8us high and 0.45us low for a "1" and 0.4us and 0.8us low for a "0" bit) for the WS2812B strips, assembly is used as well as cli() to clear interrupts.
8. If you think that there is a hardware problem, provide a circuit diagram. Or, tell us what development board you are using and HOW you connect to it.
I do not believe there is a hardware problem as the LEDs can be addressed on an arduino. bright and colorful!
10. PLEASE do NOT use shorthand "texting" language. Spell words out as real words and use a spellchecker. You will get faster and better help if you do. Also, "The Curmudgeons" will not make rude remarks about your post.
Well, I checked for errors and tried to be as clear as possible. Please tell me if anything is unclear and I will explain to the best of my ability.
11. Words like "urgent", "ASAP", "I need it very quickly" and so forth do NOT get you good answers. All capitals, many question marks or exclamation marks don't help either. Asking the same question several times (duplicate post) will make a very bad impression.
I know it might be hard to see what i'm trying to do so again, ask away if you need anything from me.