Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

CPX: Panic with A0.analogWrite()
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CPX: Panic with A0.analogWrite()

by smagoun on Fri Jan 08, 2021 6:14 pm

I'm reliably encountering a panic on my CPX when calling pins.A0.analogWrite() within MakeCode. This program is enough to reproduce:
Code: Select all | TOGGLE FULL SIZE
input.buttonB.onEvent(ButtonEvent.Click, function () {
    pins.A0.analogWrite(1)
})

The panic code is 0xF5 / 90 decimal, which is PANIC_CODAL_HARDWARE_CONFIGURATION_ERROR according to https://makecode.adafruit.com/device/error-codes. Other analog outputs (A1, A2) are fine.

My (perhaps ambitious) goal is to play a PCM sample through the speaker, hence the need to write to A0.

I've seen several other reports of the same issue, dating back to 2019. Is there a known workaround, or a chance at a fix in the near future?

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

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

smagoun
 
Posts: 11
Joined: Sun Feb 11, 2018 5:35 pm

Re: CPX: Panic with A0.analogWrite()

by smagoun on Sat Jan 09, 2021 11:57 am

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

smagoun
 
Posts: 11
Joined: Sun Feb 11, 2018 5:35 pm

Please be positive and constructive with your questions and comments.