Hey guys, I appreciate all the effort Mr. Garcia has put into this library, As I understand from doing some quick searches, FastLED only works on a limited number of commonly available dev boards. I had to switch to the 1284p from the 328p due to dynamic memory issues. I didn’t want to switch to the 2560 because the 1284 seemed to be a better bargain and gave me much more headroom for future expansion of my project. I know no further platform support will be added but I’m looking to see if anyone has had any luck or has any info on what to do to make things work. I don’t mind digging in to things. i don’t have a scope however so I can’t do my own timing adjustments. I have commented out FastLED in my code currently because FastLED would boot loop my chip every time it made it to the FastLED.addLeds call. I didn’t realize FastLED would not be compatible with my chip until I spent hours of meticulous debugging to find the problem. I don’t know enough about FastLEDs code to do any hunting, so here I am asking for a little help. Its greatly appreciated.
Looks like it’s supposed to be supported:
https://plus.google.com/u/0/102282558639672545743/posts/SmbG1v8JDpe
https://plus.google.com/u/0/110570843435318151834/posts/KpkB8K9u44x
thats odd. If it is indeed supported now in 3.1 then why does FastLED.addLeds crash my chip? I thought i had gone through my code to verify no other issue. I even tried running the example code and it just boot looped after loading the setup loop. any ideas?
Thank you for finding those posts for me. I was refering to this thread where Daniel Garcia stated he would not be adding support back in January. https://github.com/FastLED/FastLED/issues/121 But if he did add support then I’m going to be a happy man. lol I just have to find the bugs.
FWIW I am not using hardware SPI pins due to having to use those for programming and a ENC28J60 Ethernet Module. I am however using the I2C port as well as two other pins. My code has pins 22, 23, 24 and 25 reserved for use by FastLED. but for debugging reasons i have them commented out. Ultimately I want to use those 4 pins though.
The 1284 is indeed an awesome chip. I have been using the chip with FastLED a couple of years now, the only issues I had were not from FastLED but rather the Arduino board files. This may not affect you but I ended up using http://github.com/JChristensen/mighty-1284p and Arduino as ISP, then had a real hard time with pin numbers. I don’t remember exactly but the pin out was not correct, so had to do some experimenting with led’s on different pins to find the correct numbers I needed.
Another problem with 1284, for me at least was the flash memory, it turns out you need a different memory call to access the second half if you use progmem(something like pgm read byte far) which is really tricky (for me impossible) I gave up on the 2nd half of memory, still accessing progmem in the first 64k fine though. I mention this as the issue did lead to unaccountable crashing.
Anyway I can definitely confirm FastLED 3.0.1 at least is working for me fine now on the Atmega1284
I’ll have to go back in a debug my FastLED code then. I tried even just doing the strand test and it still didn’t run correctly. serial monitor debugging showed it hanging and looping through the setup void.
FWIW: i am using the latest Arduino IDE and the mighty 1284 code that was recently released to fix compatibility issues in 1.6 i know the 1284 works fine with everything else. pinouts are where they should be. but as soon as i try to run fastLED at any point it crashes and boot loops… really weird.
Some info and background:
I still can’t get Fast LED to work at all on the 1284p I pulled out my pro nano and uno and had some weird bugs that i’m still trying to figure out. I wonder if I need to reinstall the libraries. Using IDE 1.6.5 and FastLED 3.1, using the latest and greatest maniacbug mighty 1284p board definitions downloaded via the new board manager in IDE 1.6.5. I’ll try a few more things, in the mean time if anyone has any ideas let me know. thanks.
Have you tried with Arduino 1.0.6 that is what works for me… Many things got broken in the move to 1.6.x
I reloaded the libraries and reinstalled the maniac bug hardware files. I was able to get my pro mini to work so i moved over to the 1284p and it worked but i discovered that the FastLED library is putting out the signal on the wrong pins. If i define the data pin as 16 it puts it out on digital pin 29. If i do the simple blink example with a standard led i can check every pin and they all work like they should, it seems that something is not right with the pin outs in the library. I understand this library uses avr assembler to control the pins directly. maybe the board definitions aren’t set to translate the pins correctly. how can i fix this?
Am i missing a define to set the platform to the 1284p or is that supposed to be auto set?
i see the definitions and port translations in fastpin_avr.h but its not working correctly.
ok i see the pin translations but i’m not sure how to fix it in fastpin_avr.h or how to tell if its wrong or not. i’m not keen on the avr C port stuff and the bit masking, this may be a good time to learn though. if someone can explain to me how this is supposed to work I’d be grateful.
I’m guessing i change the _DEFPIN_AVR(X, 1<<Y, Z); to where X is the digital pin we use in the code, y is the number of the physical port pin number, and z is the port (either A, B, C, or D) so according to the pin out i have from the data sheet. this port mapping is way off. I’ll change them around to what i assume is correct and come back with results.
Success! I have fixed the bad code in the pin definitions. Not sure if anyone is interested in merging this into their library files but i also fixed the SPI pin definitions which seemed to have been copied from the 328 definitions and set a max pin definition the same way the other boards have it set. here is the past from what i edited http://pastebin.com/Ra5Ks7Te
Thanks for your help guys.
I can now confirm that the 1284p is fully functioning with Fastled 3.1.0 and IDE 1.6.x after my fixes.
hey Nicholas thanks for sorting out the problem with pinouts. this could help a lot of people
I am going to try this with my setup as soon as I have a minute.
Great let me know how it works for you. This has been an interesting crash course in c outside of the arduino IDE.
I have just attempted to upload a ~32k sketch to my new 1284p using “standard” pinout defined in the new optiboot 6 bootloader (available at https://github.com/MCUdude/MightyCore ) and it seems to work without modification (will do more testing but it boots and starts the sketch at least. ) The sketch was originally written for 32u4 running FastLED 3.1.1.
As a side note, this new bootloader has an awesome new feature as well… Runtime flash writing (ie. PROGMEM). This opens up some interesting possibilities for actually modifying program code, palettes, variables, or whatever else one might have stored in the previously untouchable program space.
So for anybody working with the 1284, this could be worth checking out.
That is well worth checking out, thanks for sharing Ryan! A major upgrade of one project suddenly appears on the horizon…