|
|
View previous topic :: View next topic |
Author |
Message |
naughty_mark
Joined: 29 Aug 2012 Posts: 97
|
USB host on dsPIC33EP chips |
Posted: Wed May 22, 2013 5:30 pm |
|
|
Dear All,
Does anyone know if CCS has USB host example code on dsPIC33EP microchip?
I am using dsPIC33EP256MU814 or dsPIC33EP512MU814 microchip, and want to use its USB OTG feature to build code that can creat, write and read file from a external USB stick.
I searched our forum, most people use FTDI solution because asking PIC to performance as host will include lots of work(code). I was wondering does CCS have example(driver) about it currently?
EDIT: One more question, because I am doing USB host program, is there any way(software or/and hardware) that I can monitor what data the micro send out on the USB bus for me to debug?
Thanks a lot.
Mark |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Thu May 23, 2013 12:32 am |
|
|
You'd have to translate the MicroChip examples.
I'm afraid I don't know of anyone actually having done this.
Best Wishes |
|
|
naughty_mark
Joined: 29 Aug 2012 Posts: 97
|
|
Posted: Thu May 23, 2013 4:21 pm |
|
|
Ttelmah wrote: | You'd have to translate the MicroChip examples.
I'm afraid I don't know of anyone actually having done this.
Best Wishes |
Thanks Ttelmah, yesterday I looked at Microchip example, honestly, it is hard for me to translate such amount code to fit in CCS compiler and make a working USB host module.
Actually currently my code problem is even I can not send the token out like I mentioned several weeks before in thread, especially dsPIC33EP USB feature (BDP part) is different from other chips... |
|
|
arocholl
Joined: 14 Dec 2008 Posts: 21
|
|
Posted: Fri May 24, 2013 3:58 am |
|
|
If you need USB support, I would not recommend CCS compiler, go with the Microchip compilers. If you use an external USB IC, such as FTDI, then you only work with standard RS232 or SPI commands, depending on the model you choose. In that case CCS compiler is fine because no real USB work is needed in the PIC.
For your second question, you will need a USB sniffer, there are many online. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Fri May 24, 2013 5:52 am |
|
|
I've used the Vinculum chips in the past. Super simple and easy to implement to get 'up and running' without the USB-blues.Flash drives are easy unlike SD/MMC cards ,as we all know .While the upfront cost of Vchips is high, it's a LOT cheaper than the $$$ for codecutting!
USB is a horribly complex,nondeterministic,memory hog serial interface that 'everyone' seems to love...until YOU have to cut real code for it!
.. I can understand why CCS hasn't spent the time and resources(man power) on code for it.Very little,if any, 'return on investment'.It's better to tweak their compilers,offer new PCBs, etc.
cheers
Jay |
|
|
naughty_mark
Joined: 29 Aug 2012 Posts: 97
|
|
Posted: Fri May 24, 2013 6:38 pm |
|
|
temtronic wrote: | I've used the Vinculum chips in the past. Super simple and easy to implement to get 'up and running' without the USB-blues.Flash drives are easy unlike SD/MMC cards ,as we all know .While the upfront cost of Vchips is high, it's a LOT cheaper than the $$$ for codecutting!
USB is a horribly complex,nondeterministic,memory hog serial interface that 'everyone' seems to love...until YOU have to cut real code for it!
.. I can understand why CCS hasn't spent the time and resources(man power) on code for it.Very little,if any, 'return on investment'.It's better to tweak their compilers,offer new PCBs, etc.
cheers
Jay |
Thanks Jay.
I used Vinculum before, Yes, it is easy to use, that microchip does all lower layer software for us, I like it.
It looks so far no better solution for this problem... |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Fri May 24, 2013 6:51 pm |
|
|
Sometimes you just have to 'open the wallet' and buy a ready made solution! It sure beats banging you head against the wall trying to accomplish the same task.This from a guy who would wirewrap 4000 series chips to make a '6402' UART clone....yeesh...those were the dayze.
Same goes for 'USB' to PIC...instead of using PICs with USB, I now use a $3 USB-TTL module.Totally hassle free,wireup and GO.NO USB coding required, leaving valuable R&D time to be spent on the real code issues.
cheers
jay |
|
|
naughty_mark
Joined: 29 Aug 2012 Posts: 97
|
|
Posted: Fri May 24, 2013 8:05 pm |
|
|
[quote="naughty_mark"] temtronic wrote: | I've used the Vinculum chips in the past. Super simple and easy to implement to get 'up and running' without the USB-blues.Flash drives are easy unlike SD/MMC cards ,as we all know .While the upfront cost of Vchips is high, it's a LOT cheaper than the $$$ for codecutting!
USB is a horribly complex,nondeterministic,memory hog serial interface that 'everyone' seems to love...until YOU have to cut real code for it!
.. I can understand why CCS hasn't spent the time and resources(man power) on code for it.Very little,if any, 'return on investment'.It's better to tweak their compilers,offer new PCBs, etc.
cheers
Jay |
Thanks Jay.
I used Vinculum before, Yes, it is easy to use, that Vchip does all lower layer software for us, I like it.
It looks so far no better solution for this problem... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Sat May 25, 2013 12:43 am |
|
|
Yes, it is a problem.
Key thing is that 'slave' USB, is 'relatively' simple. Master is perhaps ten times harder (depending on the devices involved). As a slave, the PIC code works pretty well, and on chips with reasonable amount of RAM/ROM, can be a very acceptable solution. However master, forces you up to one of the OTG chips, and the code becomes increasingly complex. Unfortunately, there has not been a port done of the Microchip code (anyone remember how CCS were promising a Microchip compatibility mode for the compiler so one would be able to compiler Microchip code directly a while ago....). I must admit if I was looking at a application that was for at least perhaps 10000 units, I'd probably just sit down and port the Microchip code, to keep the parts cost as low as possible. For anything below this, I'd probably try to save a few pence/cents by going for a slightly lesser PIC, and just add the Vinculum. The cost per board would be offset by the reduction on code costs.....
Best Wishes |
|
|
naughty_mark
Joined: 29 Aug 2012 Posts: 97
|
|
Posted: Sun May 26, 2013 4:31 pm |
|
|
Thanks for your kind helps, guys.
Because the USB feature is just a part of the project, maybe it is hard to use Microchip compiler to just fit USB module, and for the microcontroller selection, it was selected by hardware engineer, and they have their reason, and the hardware design is fixed or say hard to change. Looks I need either like Ttelmah said to translate microchip example to fit in CCS compiler or I wrote my code which I don't think I can make it with my current skill and time limitation..
By the way, if I want to define a 512-byte aligned array, you know BDT is 512-bytes aligned, is there a easier way to define those BDT? The way I can think is just use #locate to define those BDs one by one.
Thank you guys again, if I make some break through, I will let you know.
Kind Regards
Mark |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|