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

Gemma M0 program hangs consistently after many loops #1222

Open
ricknun opened this issue Sep 12, 2024 · 0 comments
Open

Gemma M0 program hangs consistently after many loops #1222

ricknun opened this issue Sep 12, 2024 · 0 comments

Comments

@ricknun
Copy link

ricknun commented Sep 12, 2024

Describe the bug
The attached Gemma M0 MakeCode program hangs consistently after many successful loops.

To Reproduce
Load maker-LFSR-Strip.png into the MakeCode editor at https://maker.makecode.com/#editor. Look at the simulator display to see the desired output -- 1 red LED traversing the strip, then green+blue, then cyan+off+magenta... looping forever. Connect an Adafruit 3811 30-NeoPixel strip to Gemma M0 (black to GND, red to Vout, white to A0). Download the program and see the program work as seen in the simulator (good so far). Then after 3 minutes 44 seconds the program hangs. The Gemma M0 LED blinks Morse code "SOS" and the LED strip (from Gemma M0 out) shows 2 off, magenta, 1 off, cyan, 13 off, blue, green, 10 off (30 total).

Expected behavior
The program should loop forever.

Screenshots
See below.

Desktop (please complete the following information):

Additional context
Setting the "pause" at the end of the "forever" loop to 0 shows the problem much faster, at the same failure state. The Gemma M0 simulator seems to run forever as expected, so the problem seems to be in Gemma M0 not the program. The program is a 16-bit Linear Feedback Shift Register (LFSR), b0 = (b15 xor b14), seed 0x0001, resulting in a 255-state cycle. LFSR bits are mapped to the NeoPixel strip. I am a retired software engineer and adjunct professor, teaching LFSRs in my Digital Logic class.
LFSR-Strip-Image
maker-LFSR-Strip

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

1 participant