Results 1 to 10 of 10

Thread: Ilda Usb Converter

  1. #1

    Default Ilda Usb Converter

    Hi

    My name is Cornel, I am living Romania.
    I am trying to make an ILDA converter for USB port but I have some prolems.
    This photo is the schematic diagram block of my converter.

    I am using a microcontroller PIC16F877a, a FTDI USB converter 8bits FT245RL, a memory LP621024D and some 2 DAC serial converters 12bits LTC1257. For addressing of memory I am using 2 of HC74hc574.
    I made the programs for PIC in PROTON IDE Basic Compiler. And for computer programming I am using DELPHI.
    The problem is that I don't know the logics that I must use in transfering data between PC - FTDI - PIC - MEMORY. I tryed a lot of variant for transefering data but I failed. I can transfer data from PC to PIC via FTDI, I can put data in MEMORY, I can read data from memory and send it to XY DAC converters. But my PIC program is bad because I think that memory remain free of information at some time and the microcontroller has not what to send to DAC converters. And because of this I have some delays between points and between frames.
    Is somebody who tryed to made an ILDA interface or who has some ideas ?

    2 month ago I tryed the same thing without FTDI FT245rl but with PIC18f4550 because this microcontroller is including an USB interface. But I had another problem : I could not have enough speed because I was not working in C but in basic because I know only pascal and basic. And in basic programming there is not support for full speed. I had only about 100Kbytes /sec maximum data transfer speed. And because of that I abandoned the PIC18f4550.

    Thank you
    Attached Thumbnails Attached Thumbnails USB ILDA.bmp  


  2. #2

    Default

    Hello Cornel,

    Welcome to Photonlexicon. This looks like a very interesting project.

    You must use a technique called "double buffer". You can use a memory with enough space to store two frames "A" and "B". When frame "A" is displaying, frame "B" is downloading. Then you swap, frame "B" is displaying and frame "A" is downloading. This way you always keep the data ready to display in memory and there is no break between the frames.

    But, there is a problem with the microcontroller, because it is not easy to download the next frame and display the current frame at the same time. You can use the main process to download the next frame and the interrupt routine to display the current frame at the same time. You can set the timer to run the interrupt routine at the pps rate. Each time the interrupt routine is called, you use the interrupt routine to update the DACs. In between the interrupts, the main process is updating the next frame so it will be ready in the memory. When the last point is output, the other frame is ready so you can swap right away and start downloading the next frame.

    I think the choice of the FTDI chip is very smart, because the USB peripheral in most microcontroller is very hard to use. The FTDI chip also has a buffer, so you never wait for the USB frame. You need to copy 7/8 bytes or more to the memory between every display point. You can keep the FTDI chip buffer full, so these bytes are always available without any wait for the USB frame.

    If the frames are displayed faster than you can download between the interrupts, then you can get 20% more speed by using the 18F4550 chip (but do not use the USB peripheral). This is because the 18F4550 chip can run at 48MHz when the other PIC are all only 40MHz. If this is still not fast enough, then I think you have to use ASM or the C language for the microprocessor. I think the C language would be a good idea. Since you already know DELPHI and BASIC it will be easy for you to learn. Microchip have a very good, free C compiler for PIC you can use, with lots of examples.

    Please post again with your progress, and if you have any other questions.

    Kind regards,

    sonaluma

  3. #3

    Default

    Dear friend,
    Please can you send me a code example of using double buffer ? I think I am persisting in a wrong. And more important is that I don't know using interrupt routine !
    Thank you

  4. #4

    Default

    Hi Cornel,

    Unfortunately I don't have any code example for the double buffer, but the concept is simple. You have to use interrupt routines, because you must update one buffer asynchronously while the other buffer is being displayed. One operation (display or update) has to be running in the interrupt routine so that they can both happen at the same time. Otherwise you have to stop the display to update the buffer, then there is no purpose for the double buffer. I recommend you output each point in the interrupt routine and update the buffer in the main program. I think you have to learn how to use the interrupt routines first, then the solution will become clear.

    Kind regards,

    sonaluma

  5. Default

    Did you ever get this project working?
    Please let me know, I am interested in doing the same.

  6. #6
    Join Date
    Sep 2007
    Location
    Omaha, NE
    Posts
    769

    Default

    You might look at the EasyLase DLL project on Chris Favrau's site
    I hope this helpful!
    -Mike


  7. #7
    Join Date
    Oct 2006
    Location
    Cleveland, Ohio
    Posts
    2,332

    Default

    Quote Originally Posted by mikkojay View Post
    You might look at the EasyLase DLL project on Chris Favrau's site
    I hope this helpful!
    -Mike
    Wow how did you ever find that site.. and wow someone else started trying to use the common E.L. API for compatibility purposes long before I did... Good find!

  8. #8
    Join Date
    Sep 2007
    Location
    Omaha, NE
    Posts
    769

    Default

    Yeah, Chris is a cool dude- I emailed back and forth with him a few times. I think he checks this site once and a while. He's definitely got some skills with this driver stuff, as do you- I wish he would come around more often.
    -Mike


  9. #9
    Join Date
    May 2008
    Location
    nerdtown, USA
    Posts
    1,165

    Default

    I would suggest, seriously, learn C. BASIC is a toy and Delphi is all very nice for developing Windows applications but for device drivers, you want to use C.

    It doesn't take long to learn, it's a very simple language, and you will be able to use the same language on the PIC as you do on the PC.

  10. #10
    Join Date
    Nov 2005
    Location
    Melbourne, Australia
    Posts
    3,677

    Default

    Or assembler for the micros
    KVANT Australian projector sales
    https://www.facebook.com/kvantaus/

    Lasershowparts- Laser Parts at great prices
    https://www.facebook.com/lasershowparts/

Posting Permissions

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