CPX: Panic with A0.analogWrite()

Microsoft's MakeCode platform for easy blocks-style programming

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
smagoun
 
Posts: 11
Joined: Sun Feb 11, 2018 5:35 pm

CPX: Panic with A0.analogWrite()

Post by smagoun »

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

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

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

Re: CPX: Panic with A0.analogWrite()

Post by smagoun »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “MakeCode”