Has anyone been successful in interfacing a PIC16, a MAX3421 USB Host and a camera?


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Has anyone been successful in interfacing a PIC16, a MAX3421 USB Host and a camer

    I ordered the MAX3421EVKIT-1+ from Digikey to help me understand USB a bit more and to develope my camera intervalometer project.
    There are many questions about enumeration and other things. Just how much does the MAX3421 do behind the scenes to allow the PIC to just read and write registers via SHIFTIN and SHIFTOUT.
    Only one device will be connected to MAX3421, so I am assumming that the MAX3421 will assign the endpoint as EP1???
    Below is how I understand the MAX3421 to work. Someone with MAX3421 experience please check my program flow and let me know if I am missing any steps.

    Set Mode:
    1. Assert SS low.
    2. Clock out SPI command byte 11011010 – selects R27 (MODE) for a write.
    3. Clock out 11000001 – sets D+ and D- pulldowns and Host mode.
    3. Assert SS high to end.

    Read HRSL status register:
    4. Assert SS low.
    5. Clock out SPI command byte 11111000 – selects R31 (HRSL) for a read.
    6. Clock in R31 data and check for JSTATUS AND KSTATUS to determine when a device has been connected or disconnected and is a Low or High speed device.
    7. Loop step 6 until detected.
    8. Assert SS high to end.

    Load Send FIFO register with camera shutter release command data bytes:
    9. Assert SS low.
    10. Clock out SPI command byte 00010010 – selects R2 (SNDFIFO) for a write.
    11. Clock out data bytes to load Send FIFO.
    12. Assert SS high to end.

    Load Send Byte Count register with the number of data bytes in Send FIFO:
    13. Assert SS low.
    14. Clock out SPI command byte 00111010 – selects R7 (SNDBC) for a write.
    15. Clock out number of bytes loaded into SNDFIFO.
    16. Assert SS high to end.

    Send data to device by writting to HXFR register:
    17. Assert SS low.
    18. Clock out SPI command byte 11110010 – selects R30 (HXFR) for a write.
    19. Clock out 00100001 – selects Bulk Transfer and EP1.
    20. Assert SS high to end.
    21. Pause x seconds then repeat the write to HXFR register.

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default Re: Has anyone been successful in interfacing a PIC16, a MAX3421 USB Host and a camer

    I also have a MAX3421 waiting for better explanation.
    The following C code reference (not a lot of help) is what I had found:

    ********************
    MAXIM USB Laboratory
    ********************
    This project was constructed from the downloaded Keil demo code mdk303a.exe,
    available on the Keil web site. If you have a Keil ULINK box, be sure also
    to download the USB driver from the Keil web site. The USB driver downloaded
    and tested with this code has the file name "3071.zip".

    This project uses two files that are not supplied with the Maxim code:

    C:\Keil\ARM\RV30\Boards\Keil\MCB2130\Blinky\startu p.s
    C:\Keil\ARM\RV30\Boards\Keil\MCB2130\Blinky\retarg et.c

    If you installed the Keil demo code in the default C:\Keil directory this project
    should compile without incident.
    Norm

  3. #3
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Has anyone been successful in interfacing a PIC16, a MAX3421 USB Host and a camer

    Actually, if all you want to do is control the shutter remotely (or an external intervalometer), there's an easier way to do this. I dont have a Nikon, I use Canon, but the principle is the same.

    Check out this page for a complete time-lapse aid that *fits in an EP plug*!

    http://cms.diodenring.de/en/electron...tervalltimerv2

    Regards,

    Anand Dhuru

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Has anyone been successful in interfacing a PIC16, a MAX3421 USB Host and a camer

    Unfortunately, the Nikon D40 only has a USB interface, so USB commands are the only option.

  5. #5
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Has anyone been successful in interfacing a PIC16, a MAX3421 USB Host and a camer

    How about IR, then?

    http://www.bigmike.it/ircontrol/

    Well written code running off NiMH batteries should go on for quite a few days without a recharge, I guess. Still much simpler than USB, I'm sure.

    Regards,

    Anand
    Last edited by ardhuru; - 5th October 2011 at 15:58.

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Has anyone been successful in interfacing a PIC16, a MAX3421 USB Host and a camer

    I actually started down the IR path several months ago, by buying another IR control to modify.

    My MAX3421 Eval kit arrives today, so I will be able to experiment with USB control. Who knows, I may go back to IR soon.

  7. #7
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default Re: Has anyone been successful in interfacing a PIC16, a MAX3421 USB Host and a camer

    This might be helpful although not directly answering your question. I went searching for a 3.3V to 5V converter and stumbled on to it.

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts