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

analog write errors on Circuit Playground Express A0 (true analogue) #1061

Open
kevinjwalters opened this issue May 28, 2019 · 6 comments
Open

Comments

@kevinjwalters
Copy link

kevinjwalters commented May 28, 2019

Describe the bug
Very simple programs using analog write block to set an analogue value on a Circuit Playground Express board's A0 pin/pad (true analogue, not PWM) error immediately with a 909: PANIC_INVALID_ARGUMENT): the argument value is out of range or the type or format is invalid as indicated by colourful red/blue NeoPixels. D13 flashes too. MakeCode version is:

Adafruit Circuit Playground Express version:  1.4.27
Microsoft MakeCode version:  5.13.6
codal-circuit-playground runtime version:  v1.5.4-i2c_and_dac.0

To Reproduce
Steps to reproduce the behavior:

  1. Use analog write to pin A0

Expected behavior
A constant voltage appear on the A0 pad without error.

Screenshots
See code on https://makecode.com/_RDm03xPfVdz1 - this is the javascript code cut and paste from the MakeCode editor.

// analog write on the CPX is broken, this gives a 909
// error as indicated on the NeoPixels
forever(function () {
    pins.A0.analogWrite(0)
    pause(100)
})

Desktop (please complete the following information):

  • OS: Windows
  • Browser Firefox and Chrome
  • Version: n/a (?)

Additional context
I see there's a discussion about analog write on #604 and in particular a mention of A0 and "Michal's fixes" in #604 (comment) from Apr 2018.

@kevinjwalters
Copy link
Author

I tried MakeCode beta on 28-May-2019 and same issue there.

Adafruit Circuit Playground Express version:  1.4.28
Microsoft MakeCode version:  5.13.6
codal-circuit-playground runtime version:  v1.5.4-i2c_and_dac.0

@abchatra
Copy link
Contributor

@pelikhan @mmoskal

@kevinjwalters
Copy link
Author

Is there any ETA on this?

@kevinjwalters
Copy link
Author

I saw someone mention a "strange result" from analogue writes to A0 in AnalogWrite in MS MakeCode for pins A3, A6, A7, I'll ask what this was...

@smagoun
Copy link

smagoun commented Jan 7, 2021

I can reproduce the analogWrite problem with analog writes on A0 using the program in the original report. It's reproducible in both MakeCode + MakeCode beta. The error code on mine is b0001011010 / 90 (PANIC_CODAL_HARDWARE_CONFIGURATION_ERROR) rather than 909. Other analog pins (A1, A2) are fine; it's just A0 that causes the panic.

MakeCode:
Adafruit Circuit Playground Express version: 1.4.43
Microsoft MakeCode version: 5.20.6
codal-circuit-playground runtime version: v2.0.1

Makecode Beta:
Adafruit Circuit Playground Express version: 1.6.4
Microsoft MakeCode version: 6.1.10
codal-circuit-playground runtime version: v2.0.4

@smagoun
Copy link

smagoun commented Jan 9, 2021

I did some more sleuthing. The panic is a regression between 1.2.13 and 1.3.1.

https://makecode.adafruit.com/v1.2.13#editor - code runs:
Adafruit Circuit Playground Express version: 1.2.13
Microsoft MakeCode version: 5.1.5
codal-circuit-playground runtime version: v1.5.6

https://makecode.adafruit.com/v1.3.1#editor - same code causes panic:
Adafruit Circuit Playground Express version: 1.3.1
Microsoft MakeCode version: 5.5.25
codal-circuit-playground runtime version: v1.5.4-samd-peripherals.10

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

No branches or pull requests

3 participants