I’m using the RC3 version of the library and IDE 1.0.4 Having problems with pin mapping on the MEGA with 2811 pixels. I’m wishing to hook up two separate strings on 2 pins.
if I map to any of the ‘traditional’ Arduino ports common to the UNO, works fine. I can run firstlight, with an add of an additional string on a second pin and all is well. When mapping to MEGA ports just doesn’t seem to work. First, I hook to pin 32. Nothing. Unless I init for pin 42, then I get output on pin 32. I can’t seem to map that to anything. I haven’t been able to get any other MEGA pins to work reliably, although I see signals on them, it appears that the library is ‘splattering’ additional signals on other pins.
Any idea? I’m sure it’s something stupid. But I’m stuck
ATMEGA 2560 – have tried on two boards. Compiled with either 1.0.4 arduino or 1.0.5 arduino, same result. The environment is set for ATMEGA 2560 (BTW, it appears in the fastspi code that 1280 and 2560 map the same pins).
I thought it might be something known… but if not i’ll keep simplifying things until I figure out what’s going on.
I’ll also recheck all the back port pins manually - I got the pin/port mapping out of the arduino docs and used that. It’s possible that some of the pins/ports are wrong/off.
Weird - I just did another check - this time comparing the pins/ports that i’m using with the pin/port definitions that the arduino platform uses, and the arduino mega 2560 pins/masks are all lining up properly to the appropriate ports/masks.
Checking with a logic probe here and my MEGA, FastPin<32>::hi() toggles on pin 32, and FastPin<42>::hi() toggles on pin 42.
Occasionally, setting Pin 32 high with FastPin<32>::hi() causes pin 42 to toggle, quickly (on for 12 clocks then off again), unless i set pin 42 to be output, so I think the megas do have some noise going out over pins that have not explicitly been set to output (at least when performing direct io port register manipulations).
However, I just ran through and checked all the pins on the mega, and I am getting output working off of them - output on expected pins. Also - the glitch mentioned doesn’t always occur (in fact, when doing multi-pin tests, I can’t get it to occur at all).
There are some outstanding timing issues with the ws2811’s and AVR based systems that i’m in the process of redoing the code for them - newer batches seem to have tighter timing constraints, so code that’s working with leds that I have isn’t working with newer shipments. It is possible this is what you are hitting (some pins on the mega take only 1 clock to set, others take 2).