Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin 0 digital input may be high by default on V2 micro:bit #357

Closed
microbit-giles opened this issue Jul 26, 2023 · 4 comments
Closed

Pin 0 digital input may be high by default on V2 micro:bit #357

microbit-giles opened this issue Jul 26, 2023 · 4 comments

Comments

@microbit-giles
Copy link

To reproduce:

  • Go to https://microbit.org/projects/make-it-code-it/pir-movement-alarm/
  • Download the transmitter HEX file and flash to micro:bit V2
  • Both I and a colleague observe that the diamond is shown immediately when nothing is connected to the micro:bit. We expect nothing to be shown on the display when nothing is connected to the micro:bit. This suggests pin 0 may be floating or high by default.

The HEX file seems to work as expected on a micro:bit V1 - no diamond shown by default. Diamond is shown when 3v pin connected to pin 0, and disappears when disconnected.
microbit-screenshot (2)

Are there any mitigations we can add in code, or does this need some other kind of fix?

@martinwork
Copy link
Collaborator

I think it must be an old hex file with a bug that has been fixed.

I see the same problem with the downloaded hex, but not with a newly built hex.

@microbit-carlos
Copy link
Collaborator

Based on issue #17 V2 should be configured to match V1 and set the pins default state to pull down:

Looking at the source code we have the default pull configured to down in the target.json files:

"DEVICE_DEFAULT_PULLMODE":"PullMode::Down",

"DEVICE_DEFAULT_PULLMODE": "PullMode::Down",

And the default mode is applied here:

@microbit-carlos
Copy link
Collaborator

I think it must be an old hex file with a bug that has been fixed.

I see the same problem with the downloaded hex, but not with a newly built hex.

Ah, thanks @martinwork!
As this hex file is hosted in the website we'll have to update it in the CMS to a newer version of MakeCode.

@microbit-carlos
Copy link
Collaborator

Okay, so the issue was from an old MakeCode release and has been fixed in current CODAL, so we can close this as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants