Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ATMega 1284 not working out of the box (50kHz instead of 800kHz) #538
I have problems with my new ATMega1284P chip. I used logic analyzer to check the pattern which is ok but the timing is 50 kHz.
Is there something which I do wrong or is there a bug? I can run tests to get this working. I have no idea how the FastLED library works so I hope you could provide me with some help with this one.
What you're seeing in the logic analyzer is making me think that your chip is running at 1Mhz, not 16Mhz (50kHz is 1/16th the 800kHz that ws28xx and clones want).
Can you also do a build with verbose output and paste the build log into a gist.github.com and link to it here? I want to see what compile time defines MightyCore is setting (since I think this is the first reference i've seen to someone using MightyCore w/FastLED).
ATMega1284 Verbose with wrong fuses
So it seems the problem is there. Then I went to MCUdude/MightyCore board file and ripped the fuse values and tried to learn what they mean (quite simple actually). I did only one change (mistake?) and removed JTAG.
I uploaded the fuses with AVRdude command with slower baud rate (I took some random tutorial. I don't know why this was done with slower but I wanted to follow the tutorial). Everything else were correct I triple checked how I sent it (no erase)
Ok, so the fuse values were (in the same order):
The I checked that okokokok. Then I tried to reupload the hex (with bootloader) and it was not able to connect ICSP anymore. So I think I kinda bricked it..
I have bought spare but I don't want to brick them all. Do you happen to know did I made the mistake on taking the JTAG off?
Well now I understand where the problem is (now I understand more about the AVR). But could you throw me some help with the fuses?
Well it seems that you guys don't have a proper test environment with the ATMega1284P so I can also run those if necessary! I uploaded the AVR verbose. Hope that helps.
I don't - i've done no work at all with bare AVR chips - mostly I work with supporting the various arduino boards and clones (as well as a handful of arm and other 32-bit based platforms)
Given the number of platforms that I support, and the relatively low number of users that are using the 1284P (I think you're maybe the 3rd or 4th I've run across in the last 7 years), it's not a realistic platform for me to put a lot of direct effort into. I'm happy to fix bug reports when they come up if they're easy enough to do without requiring major code base changes/testing.
Okay now I got this working. This issue might be a tutorial for other people who want to play with ATMEGA1284P and FastLED. Here goes:
CMD: sudo avrdude -p atmega1284p -C ~/avrdude_gpio.conf -c pi_1 -v -U efuse:w:0xFD:m -U lfuse:w:0xF7:m -U hfuse:w:0xD6:m
or use the Arduino IDE straight away
Done and works for me. FastLED works perfectly. This issue can be closed.