• AVR Freaks

Hot!Is there a PIC18 library for the CH376 USB drive?

Author
AndyWorsley
New Member
  • Total Posts : 13
  • Reward points : 0
  • Joined: 2019/05/30 09:14:14
  • Location: Colombia
  • Status: offline
2019/08/20 09:08:17 (permalink)
0

Is there a PIC18 library for the CH376 USB drive?

I have a project for a client who wants to use a CH376 USB drive to log data. Is there a library to do this? I don't want to waste my time re-inventing the wheel.
 
I'm using MPLABX 5.25 with xc8 V2.05 and the micro is the PIC18F25K83.
 
Regards
Andy
#1

10 Replies Related Threads

    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11284
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 09:57:30 (permalink)
    0
    Why not just use a PIC24 that can do this without a special chip?
    #2
    AndyWorsley
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2019/05/30 09:14:14
    • Location: Colombia
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 10:25:31 (permalink)
    0
    Two reasons:
    1. Too late into the project.
    2. This is a very cost sensitive product and the USB drive is debugging/calibration purposes only. It will not be a part of the final product.
    #3
    katela
    Super Member
    • Total Posts : 1372
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 10:28:13 (permalink)
    0
    I don't think so

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #4
    AndyWorsley
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2019/05/30 09:14:14
    • Location: Colombia
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 10:40:48 (permalink)
    0
    Are there libraries (of any kind) available to download from the website? I can't see any, but maybe I'm looking in the wrong places.
    #5
    katela
    Super Member
    • Total Posts : 1372
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 10:54:00 (permalink)

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #6
    Antipodean
    Super Member
    • Total Posts : 1732
    • Reward points : 0
    • Joined: 2008/12/09 10:19:08
    • Location: Didcot, United Kingdom
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 11:17:12 (permalink)
    +1 (1)
    AndyWorsley
    Two reasons:
    1. Too late into the project.
    2. This is a very cost sensitive product and the USB drive is debugging/calibration purposes only. It will not be a part of the final product.




    jtemples is correct, to get to where you want to go I wouldn't start from here.
     
    What you want to do will not work with the hardware you have because the 18F series chips cannot act as a USB master device which is what you need to access a USB drive. So to do what you want you will need to add another chip.
     
    Another way to do what you want would be to add an SD card socket and use SPI to access that. You will still need to add complete file system code to your project, but you would have needed to do that anyway for a USB drive.
     
    The reason a PIC 24 would be the way to go is because the USB peripheral in the ones that have it can also be a USB master and hence can access a USB drive like you want. As your code is already written in C I suspect it would port very easily, probably less time than it would take to add an SD card to your existing setup.
     
     

    Do not use my alias in your message body when replying, your message will disappear ...

    Alan
    #7
    AndyWorsley
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2019/05/30 09:14:14
    • Location: Colombia
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 12:42:00 (permalink)
    0
    to get to where you want to go I wouldn't start from here.
    Seriously unhelpful comment.
     
    I looked on the microchip selector for PIC24s and chips with USB and CAN - Zero! So, not an option.
    #8
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11284
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 12:49:20 (permalink)
    +1 (1)
    I looked on the microchip selector for PIC24s and chips with USB and CAN - Zero! So, not an option.

     
    I see 9.  Select 16-bit parts only, USB, and CAN.
    #9
    AndyWorsley
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2019/05/30 09:14:14
    • Location: Colombia
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 12:55:53 (permalink)
    0
    Selected 16 CPU, USB 1, CAN 1, result zero!
     
    The point is our design is based on PIC18, so we're not going to change now.
    #10
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11284
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: Is there a PIC18 library for the CH376 USB drive? 2019/08/20 13:01:21 (permalink)
    +1 (1)
    These all have 2 CAN modules, so they won't match if you've specified exactly 1.  Leave the second dropdown at "All" when you're searching.
    #11
    Jump to:
    © 2019 APG vNext Commercial Version 4.5