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

Need help #1

Open
4dvn opened this issue Sep 30, 2020 · 7 comments
Open

Need help #1

4dvn opened this issue Sep 30, 2020 · 7 comments

Comments

@4dvn
Copy link

4dvn commented Sep 30, 2020

Can you upload the schematic and how to upload code for stm32f103c8t6 bluepill? I want to make 16 buttons from note 36 to 51 can you give me the code of that?

@bjsowa
Copy link
Owner

bjsowa commented Sep 30, 2020

I'm glad someone took interest in my project. Unfortunately, I stopped development at some point, but want to continue it in the near future.

I used BlackPill board (F1), so I'm not sure if everything will work correctly on bluepill, but since they use the same MCU, there's a high chance it will.

To upload the code, I used PlatformIO IDE and ST-Link programmer.

If you manage to successfully flash the bluepill board, and it registers as a MIDI device, I can provide the schematics and help you modify the code for your needs.

@4dvn
Copy link
Author

4dvn commented Oct 1, 2020

I'm glad someone took interest in my project. Unfortunately, I stopped development at some point, but want to continue it in the near future.

I used BlackPill board (F1), so I'm not sure if everything will work correctly on bluepill, but since they use the same MCU, there's a high chance it will.

To upload the code, I used PlatformIO IDE and ST-Link programmer.

If you manage to successfully flash the bluepill board, and it registers as a MIDI device, I can provide the schematics and help you modify the code for your needs.

Thank you for reply, can you tell me which part need to modify for my buttons request ( 16 buttons ) also i need schematic for testing thank you!

@bjsowa
Copy link
Owner

bjsowa commented Oct 2, 2020

Here's a schematic you can try
image

@bjsowa
Copy link
Owner

bjsowa commented Oct 2, 2020

For code editing, you should look at the main.c file. In particular, the gpio_setup() and sys_tick_handler() functions, and these lines:

static bool key_states[8];
static uint8_t key_number[8] = { 44, 45, 46, 47, 48, 49, 50, 51 };
static uint16_t key_gpio[8]
    = { GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5, GPIO6, GPIO7 };
static uint16_t key_gpios;

The code assumes all buttons are connected to GPIO Port A. If you need to use buttons connected to other GPIO ports or use a scan matrix, you will need to write some more logic in the code which I did not have time to add.

@4dvn
Copy link
Author

4dvn commented Oct 2, 2020

I'll buy blackpill and some potentiomters and diodeimage
I really want to move from arduino uno to stm32 for faster midi communication, hope you can help to finish it 😫

@bjsowa
Copy link
Owner

bjsowa commented Oct 3, 2020

What's wrong with bluepill ?

@4dvn
Copy link
Author

4dvn commented Oct 3, 2020

What's wrong with bluepill ?

I create a new project with bluepill and import your code to compile it but when upload hex via stm utility done the usb midi driver show error on board

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