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

Multiplexer capelet - core code not driving channel selects #712

Closed
robsilf opened this issue Mar 1, 2023 · 7 comments
Closed

Multiplexer capelet - core code not driving channel selects #712

robsilf opened this issue Mar 1, 2023 · 7 comments

Comments

@robsilf
Copy link

robsilf commented Mar 1, 2023

I am using the multiplexer capelet, but the multiplexers are not muxing. I'm running the example project "multiplexer-display", I've enabled the caplet in the IDE settings, tried 16, 32, and 64 channels. I'm probing the A, B, C (channel select) inputs on the 4051 chips, they are all staying at zero. I checked the schematic, found where those mux selector bits are driven from the BeagleBone GPIOs via header P8. They are not doing anything, just staying at 0V. I tried two different boards (Bela as well as the Multiplexer Capelet) and I get the same result. My hardware is new, just ordered in the past 2 months, so it must be the latest revision.

Is there something I am missing in the IDE settings to enable the mux control signals?

@giuliomoro
Copy link
Contributor

giuliomoro commented Mar 1, 2023

it looks like there is a #define that's been left disabled that needs enabling. In /root/Bela/pru/pru_rtaudio_irq.p, remove the leading // in

 //#define ENABLE_MUXER // enables run-time selection of the Multiplexer capelet

and rebuild and see what happens there

@robsilf
Copy link
Author

robsilf commented Mar 1, 2023

Ah, that sounds like a smoking gun — thank you!! Will try it later today and report back.

@robsilf
Copy link
Author

robsilf commented Mar 1, 2023

@giuliomoro I am new to this development environment. I followed the instructions here: [ https://learn.bela.io/using-bela/advanced-topics/editing-the-core-code/ ] to get access to the core code in the IDE. I followed the second method creating a new project and naming it core_code. I found the file and the commented line, and removed the // in front. I then went back and ran the multiplexer-display example project, but the behavior is still the same (mux control lines all staying at zero). Am I missing a step to save my edit in pro_rtaudio_irq.p into the core code that the project is building from? I invoked "make coreclean" on the command line in the IDE, and this seemed to re-build all the source files. But still the mux control lines are not activating.

@giuliomoro
Copy link
Contributor

make coreclean

that should definitely trigger a rebuild, so I must assume your changes have been applied. I'll have a look in the coming days.

@robsilf
Copy link
Author

robsilf commented Mar 2, 2023

@giuliomoro I wanted to make sure the edit I made in the IDE was actually in the file that the project was building from. So I figured out how to ssh into Bela from my Mac terminal, navigated to root/Bela/pru/pru_rtaudio_irq.p and opened the file in using nano. The line (#define ENABLE_MUXER) was still commented out. I made the edit there in nano, saved the file, and now I am seeing the mux control lines cycle as they should. Hooray!

My question now is about the guidance on how to edit the core code that I found on the Bela website . The second method seems to not work, even though it gives access to files of the core code. Perhaps it makes copies of the files instead of providing access to the live sources? I can now verify that the file I can pull up from my terminal using nano is different from the version I can access from the IDE in the "core_code" project that I created following the website instructions.

@giuliomoro
Copy link
Contributor

giuliomoro commented Mar 3, 2023

I made the edit there in nano, saved the file, and now I am seeing the mux control lines cycle as they should. Hooray!

that's great news

I can now verify that the file I can pull up from my terminal using nano is different from the version I can access from the IDE in the "core_code" project that I created following the website instructions.

Investigating this led me to this: #713

Meantime, I updated the wiki with a method that works around the IDE limitation:

 - create a new C++ project called `core_code`, then run the following commands from the IDE's console:
 ```
-mkdir -p projects/core_code/core;
-mkdir -p projects/core_code/include;
-mkdir -p projects/core_code/pru;
-ln -s /root/Bela/core/* projects/core_code/core/;
-ln -s /root/Bela/include/* projects/core_code/include/;
-ln -s /root/Bela/pru/* projects/core_code/pru/;
+rm -rf /root/Bela/projects/core_code/*;
+ln -s /root/Bela/pru /root/Bela/include /root/Bela/core projects/core_code/;
 ```

and this is now live at the page you linked.

I also pushed the fix you tested to master of this repo.

@robsilf
Copy link
Author

robsilf commented Mar 3, 2023

Wow, that's fantastic -- thanks so much for the fast replies and finding the root cause for me! I'm excited to have made an impact toward the Bela community working on my first Bela project. I barely know what I'm doing, but it's good fun. I really love the platform and hope to use it for a bunch of things.

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

2 participants