Jump to content

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


Ravager
 Share

capacitive 2D Touch Pad  

2 members have voted

  1. 1. want one?

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


Recommended Posts

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

Link to comment
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
Link to comment
Share on other sites

  • 4 weeks later...
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:

Link to comment
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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...