Sign in to follow this  
Followers 0
Ravager

Who knows how to implement a USB Stack for PIC microcontroller?

capacitive 2D Touch Pad   2 votes

  1. 1. want one?

    • nah, too expensive
      0
    • nah, not DIY
      0
    • nah, too large
      1
    • count me in!
      1

Please sign in or register to vote in this poll.

8 posts in this topic

Last week I have dug up one of my older projects:

for a long time I wanted to create large capacitive touch pad that only uses PCB layout as touch-sensitive components.
I chose a PIC24FJ128 because it comes with 50 ADC channels that have hardware-support capacitive measurements so I could create a 2D matrix similar to a Freescale reference design. Note how on one side of the pcb there is no single component so it should fit nicely directly under the hood for many projects. But I assume it's a bit large for some applications. This single-side-placement design lead to only SMD parts being used. Sorry it's not really DIY.
In theory the thing should be rather cheap. I'm guessing 10-25€ with the majority being for placement & soldering of the TQFP100.

Eventually it will communicate via SPI and should thus be midibox-compatible but it should also be usable as a standalone USB device and either be a mouse or a midi controller that sends CC messages directly to your DAW.
We'll see about what can be done. I'm thinking in some cases even multi-touch may be possible but I'll have to experiment with the algorithms here.

My plan was to start designing the finger tracking algorithms on the PC. For this I was hoping to intially have the ADC data transmitted over USB in real time to my PC application where I could prototype algorithms. So this would be yet a third USB device type I need in the beginning but which will not be available after development has finished.

About 3 years ago it turned out developing a USB stack for a PIC µC with the tools available back then is a real pain. It lead to me dropping the project.
I don't have much more time these days but maybe someone is interested in a collaboration? Or maybe you guys know if the tools are better today?

Is there anyone out there who would have an easy time developing µC C code for the USB stacks I mentioned? I'm currently based in Munich, Germany but this is not a must!


Furthermore, would anybody be interested in actually having some of these (given I/we manage to get to a stable version that can be released) ?

IMG_5549.JPG

IMG_5550.JPG

Share this post


Link to post
Share on other sites

Hello,

Using an STM32F4 CPU is maybe a better way, by adding it on board, did you consider it?
USB stack is already existing. MIOS32 is working on it. MIOS32 is not ready for PIC24FJ128
I just added the HID class in MIOS32, not official but it's working. It's HID Host class, but HID Device is possible too. USB MIDI Device is available since the beginning.
You might be interested in the dipCoreF4 which is easy to integrate, it's based on a STM32F405RG which is small package and now compatible with MIOS32 which is the operating system we use here(MIDIbox).
Your project, if MIOS32 compatible, will surely interest some people here, but the condition is to use our existing tools ;)
Have a look on MIOS32, you will love it!

Bruno
Best regards

Edited by Antichambre

Share this post


Link to post
Share on other sites

Oh sorry forget about, I did not see the 50 ADC requirement. Oups

 

Share this post


Link to post
Share on other sites

ok I haven't received any answers but right now I'm working on the thing myself. It will be slow but I will keep you guys updated...

Share this post


Link to post
Share on other sites
On 13.12.2018 at 2:38 PM, Antichambre said:

Oh sorry forget about, I did not see the 50 ADC requirement. Oups

 

I've been thinking.

Setting everything up with discrete components that are compatible with any µC is not really economical. The only option I see is to use multiple microcontrollers in SPI Slave configuration and run the main processing code on the midibox core. I'm not sure if this is still interesting for people as we they will need to buy programming hardware or preprogrammed µCs. ATtiny controllers can provide 8 ADC channels at 1€; 6 of them would do the trick!

But I guess this still is too offtopic for this community :hmm:

Share this post


Link to post
Share on other sites

And a single CPU, an STM32F4 to take advantage from the MIOS32, AND good ADC with multiplexed input?

multiplexed-input-fig-06.png?la=en
An 8 inputs ADC with eight (8:1) multiplexers will give you 64 inputs ;)

Edited by Antichambre

Share this post


Link to post
Share on other sites

if it was just that easy. You also need to charge your pads so a simple ADC might not do the trick.

One very hacky solution: What's the input capacitance of the STM32F4 ADC channels. Can they be clamped to high or low internally? Can the tiny charge on the ADC input be transferred to a pad through a multiplexer or will all of the charge be eaten up by leakage currents?

I guess it's safer to use hardware which is intended for this. But maybe there is a workaround?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0