microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
708 stars 588 forks source link

Set Pull Pin has no effect on V1 #4961

Closed gomakekit closed 1 year ago

gomakekit commented 1 year ago

The pins.setPull has no effect on micro:bit V1.

Test code: pins.setPull(DigitalPin.P1, PinPullMode.PullUp) Measure the output voltage between P1 and GND

Measured voltage on P1 is 1,7v regardless on PullUp, PullDown or PullNone. On V2, the voltage is 3.2, 0 and 1.7v respectively.

People reported that the Air:bit 2 micro:bit drone isnt working with micro:bit V1 any more so it's a bit of a problem.

martinwork commented 1 year ago

As I understand it, setPull is only relevant to inputs. The pull mode is activated by digital read, or enabling edge events. I don't think V1 has changed in this respect for at least 7 years. How is Air:bit affected?

abchatra commented 1 year ago

Please provide additional information and reopen the issue.

gomakekit commented 1 year ago

As I understand it, setPull is only relevant to inputs. The pull mode is activated by digital read, or enabling edge events. I don't think V1 has changed in this respect for at least 7 years. How is Air:bit affected?

Thanks for the information. We are using i2c via P1 and P2 via the i2c re-route driver (https://github.com/bsiever/microbit-pxt-i2cpins) and after each i2c read/write, the pull pin goes low again. I found I can make it work by setting the pulse pin high before each i2c read/write, and I can also add physical pull ups in the future. For some reason the pull goes away after this event each time, but not on V2. I also set the pin to edge event on start. Is there any particular reason why the pull pin should be disabled by an i2c command?