Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

USB - ISP1362 flash logical addressing

Hello,

I would like to understand how the ISP1362 (DE2-70 board) chip works. I read most of the documentation provided (the programming guide and the ISP1362 datasheet). After further fruitless searches on the net, I cannot see how I would be able to specify a logical address to the chip's Host Controller for a read/write command to a USB mass storage device. I was thinking that maybe I would have to specify some sort of logical block address so that the Host Controller knows to which address the data (written or read) belongs to. Is there something huge that I am missing? Any help in the right direction would be greatly appreciated!

Thank you!

P.S. If I am not posting in the right place, I apologize. I am new to using the forums.

9 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello, I am venturing down the same road with my DE2.

    I've just recently been refereed to this page

    http://www.beyondlogic.org/usbnutshell/usb1.shtml

    and it looks pretty interesting.

    my thread is on the first page as well, here:

    http://www.alteraforum.com/forum/showthread.php?t=36018

    my interests might be a bit more basic than yours, but if you'd like, perhaps we can collaborate.

    i'd be happy to join you :)

    -edit-

    after reading your post a bit more, and not just skimming through it out of excitement, i can see you already know what you want and probably have most of the basics working. sorry if i've added an unnecessary post to your thread
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hey MMalik no worries. I am also starting to understand how USB works. I think, if I understood correctly, that you want to have a USB monitoring tool, sort of like a Logic Analyzer that is able to snoop the USB transactions and provide, on the output devices available on the DE2 board, information about what is happening. I think it is a very cool project. I also think we have similar needs in that we would both need to understand how the ISP1362 works (I'm using the DE2-70 and I'm not sure if you are or if the other DE2 boards have the same chip).

    I could suggest using the Nios II processor and one of the tutorials that Altera provides on how to use the USB (both as host and device). You could try to get that running (Altera provides the software drivers for these examples). Once these work, you could start thinking about writing an HDL component that would connect to the ISP1362 chip to read the memory and register contents. You should also read the datasheet and the programming guide as these could teach you how to talk to the chip.

    Anyway, I hope that I've helped you a little and also that we can collaborate in taming the USB beast :).

    P.S. If you like, you could look at how the Signal Tap Logic Analyzer works as this can help you see what is happening inside your system.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi decebal and MMalik,

    I'm also trying to figure out how does the DE2-70 USB works. I've also read the programming guide for the ISP1362 and took a look at the datasheet.

    I found out that the demonstrations of the Altera CD that comes along with the DE2 has an example of how to use the USB ( if you take a look at the project DE2-70_demonstrations/DE2-70_NIOS_DEVICE_LED).

    I'm still reading the code and trying to understand it. Mainly I want to know how to send data via USB to a host computer.

    decebal, have you found any other good material? Also do you have any idea how could I send data via USB, based on your reading of the programming guide?

    Thanks

    Ricardo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Ricardo,

    Yes there is a lot of material available that explains how USB works. The beyondlogic website that Mmalik has mentioned is a good place to start. I also recommend visiting usb.org and reading some documents there. The examples from Altera only show a Device demonstration (using the DE2-70 as a USB device connected to a Host computer) and a Host demonstration that uses a mouse. I'm not exactly sure what you want to do, but if you want the DE2-70 to be a Host and not the computer, then you have to write a Nios II Host Controller Driver. To do this, you have to understand the USB stack at every level (for example look at what the Transparent SCSI command set is). But maybe you can use the Device demonstration and tune it to suit your needs.

    Hope this helps a little,

    Decebal
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Decebal,

    I'm trying to use a beaglebone XM running linux as the host, and the DE2-70 as the device. The example using the DE2-70 as a USB device connected to a Host computer has the drivers, C code and libraries ready, but I'm actually having trouble to run this project on my board, although I didnt make any changes and just followed instructions on the user manual. The NIOS II IDE can't find a lot of libraries.

    About the USB I'm not really interested in understanding every detail of the protocol and communication, but rather make the board talk to linux. I'm trying to do what you said, using the devjce demonstrations and tune it, but I can't even run the Altera demonstration.

    Do you think I should try another approach? I wouldnt like to start this from scrath, but to re-use some codes.....
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yea, I think that is really helpful, but for the host side. I'm still trying to get the device side programmed :confused: which Im having lots of trouble.

    But Thanks anyway
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hey MMalik no worries. I am also starting to understand how USB works. I think, if I understood correctly, that you want to have a USB monitoring tool, sort of like a Logic Analyzer that is able to snoop the USB transactions and provide, on the output devices available on the DE2 board, information about what is happening. I think it is a very cool project. I also think we have similar needs in that we would both need to understand how the ISP1362 works (I'm using the DE2-70 and I'm not sure if you are or if the other DE2 boards have the same chip).

    I could suggest using the Nios II processor and one of the tutorials that Altera provides on how to use the USB (both as host and device). You could try to get that running (Altera provides the software drivers for these examples). Once these work, you could start

    --- Quote End ---

    Hi Decebel,

    sorry for the late reply:

    the DE2-70 is a DE2 with an expansion board, as far as i know. the DE2 also as the ISP1362.

    --- Quote Start ---

    I could suggest using the Nios II processor and one of the tutorials that Altera provides on how to use the USB (both as host and device). You could try to get that running (Altera provides the software drivers for these examples). Once these work, you could start thinking about writing an HDL component that would connect to the ISP1362 chip to read the memory and register contents. You should also read the datasheet and the programming guide as these could teach you how to talk to the chip.

    .

    --- Quote End ---

    I've looked at one of the tutorials, but it was just some application that allowed you to use USb to manipulate the DE2 etc. which is great, but I don't think i'd call that a tutorial. I'll try the NIOS II tutorials you've mentioned.

    --- Quote Start ---

    Anyway, I hope that I've helped you a little and also that we can collaborate in taming the USB beast :).

    P.S. If you like, you could look at how the Signal Tap Logic Analyzer works as this can help you see what is happening inside your system.

    --- Quote End ---

    I'd really love to collaborate if possible, again, sorry for the late response.

    does signal tap actually tap into binary files loaded into the DE2, or would it need a copy of the HDL code to reference?