You are reading a single comment by @DrAzzy and its replies. Click here to read the full conversation.
  • I have run into several issues that are caused by pins fighting with each-other over peripherals - primarily an issue with PWM. I found that sometimes, a PWM pin would be impacted when another pin was set to use PWM. Once pins are in a misbehaving state, a hard reset is needed to bring them back to expected behavior.
    See github issue #142 and related issues.

    I made a little board with some LEDs on it to test this with ( board pic - in chrome, this pic displays wrong when first loaded; zooming in+out will fix http://drazzy.com/espruino/20140417_045254.jpg ), and so far I've found the following; all issues relate to PWM unless stated otherwise.

    C8 and B0 are mutually exclusive. Setting one turns the other off.
    A6 and C6 are mutually exclusive. Setting one turns the other off.
    C7 is linked to B0 (unpredictable behavior)
    A7 is linked to C6 (unpredictable behavior)
    B1 is linked to C8 (unpredictable behavior)
    A9 is always broken - setting it with analogWrite() turns it on 100% of the time.
    A8 is linked to B13, and kills SPI2 (B13 goes high), preventing SD card access

    A0, A1, A2, A3, C6, C7, C8, C9, and B3 through B11 all appear to be usable at the same time without issue (most combinations tested - my board only had 10 LEDs though, so I was switching back and forth - it's possible I didn't hit all combos).

    I did not find any cases of other SPI interfaces having pins pulled into the wrong state as a result of PWM on a different pin. I did try to make sure the SPI interfaces were associated with the pins by sending some dummy data down it with send4bit()) - it's actually kinda cool to see leds blink when data goes down a line :-P

    Has anyone run into any other combinations of pins/functions that don't play well together? I think it would be useful to have a list of these somewhere (ideally, imo, it should be on the Espruino Board reference page, right under the lovely pinout diagram), so we can plan around them.

About

Avatar for DrAzzy @DrAzzy started