Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Does anyone know how to talk to a memory stick?

Does anyone know how to talk to a memory stick?

Scheduled Pinned Locked Moved The Lounge
hardwareperformancequestionhtmljson
43 Posts 27 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D dandy72

    lw@zi wrote:

    I talk to it sometimes. Something along these lines: "Just get in to the slot you little..."

    Has it ever responded with, "wrong way - flip me over"?

    M Offline
    M Offline
    milo xml
    wrote on last edited by
    #33

    Twice, ironically. :laugh:

    1 Reply Last reply
    0
    • C CodeWraith

      I mean the low level protocol, not some framework, API or driver. In my ongoing quest to interface modern devices to very old 8 bit computers I have stumbled over this: DEBO USB TTL: Raspberry Pi -USB-TTL-Schnittstellenwandler, CH340G bei reichelt elektronik[^] Not really rocket science. With this I can send and receive bytes from a USB device with a simple UART. This would solve a few problems at once. A simple cheap memory stick would be all the hard disk' an 8 bit computer would ever need. Don't worry about speed. Mass storage is for many reasons a relatively slow affair on 8 bit computers, beginning with their low bandwith on the bus. Remember what Commodore did with the C64's floppy drives? I could also use a USB keyboard or a mouse. So, with that converter and a UART I can now talk to USB devices. Can I also hook up a USB hub to it and access several USB devices over the same UART? How do I select devices? How do I request or send bytes? Some kind of USB protocol with an embedded device specific protocol?

      I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

      T Offline
      T Offline
      Tim Kirk
      wrote on last edited by
      #34

      Converters like the one mentioned are typically only for connecting slave devices to host computers. If you are trying to be the host and use a memory stick, you need a USB Host or OTG peripheral. Something along the lines of the Arduino Host shield if you want a pre-made solution. Arduino USB Host Shield[^]

      1 Reply Last reply
      0
      • D dandy72

        lw@zi wrote:

        I talk to it sometimes. Something along these lines: "Just get in to the slot you little..."

        Has it ever responded with, "wrong way - flip me over"?

        O Offline
        O Offline
        obermd
        wrote on last edited by
        #35

        dandy72 wrote:

        Has it ever responded with, "wrong way - flip me over"?

        Daily. I think my USB sticks need the Jeep warning: If you can read this, flip me over.

        1 Reply Last reply
        0
        • C CodeWraith

          If this were not the place it is, I would now ask you by which coordinate axis you flipped her over and if that was the right choice.

          I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

          F Offline
          F Offline
          Forogar
          wrote on last edited by
          #36

          It was the X coord. :cool: I really miss The Soapbox sometimes. :sigh:

          - I would love to change the world, but they won’t give me the source code.

          1 Reply Last reply
          0
          • C CodeWraith

            If this were not the place it is, I would now ask you by which coordinate axis you flipped her over and if that was the right choice.

            I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

            K Offline
            K Offline
            Kent K
            wrote on last edited by
            #37

            :laugh: Whew, glad you didn't ask. :)

            1 Reply Last reply
            0
            • F Forogar

              Quote:

              "wrong way - flip me over"?

              I had a girlfriend say that to me once, long, long ago.

              - I would love to change the world, but they won’t give me the source code.

              D Offline
              D Offline
              dandy72
              wrote on last edited by
              #38

              I was trying to be subtle...

              1 Reply Last reply
              0
              • C CodeWraith

                I mean the low level protocol, not some framework, API or driver. In my ongoing quest to interface modern devices to very old 8 bit computers I have stumbled over this: DEBO USB TTL: Raspberry Pi -USB-TTL-Schnittstellenwandler, CH340G bei reichelt elektronik[^] Not really rocket science. With this I can send and receive bytes from a USB device with a simple UART. This would solve a few problems at once. A simple cheap memory stick would be all the hard disk' an 8 bit computer would ever need. Don't worry about speed. Mass storage is for many reasons a relatively slow affair on 8 bit computers, beginning with their low bandwith on the bus. Remember what Commodore did with the C64's floppy drives? I could also use a USB keyboard or a mouse. So, with that converter and a UART I can now talk to USB devices. Can I also hook up a USB hub to it and access several USB devices over the same UART? How do I select devices? How do I request or send bytes? Some kind of USB protocol with an embedded device specific protocol?

                I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

                F Offline
                F Offline
                FredWah
                wrote on last edited by
                #39

                I think it's meant to be used the other way. You talk to the usb part and out comes TTL

                R 1 Reply Last reply
                0
                • F FredWah

                  I think it's meant to be used the other way. You talk to the usb part and out comes TTL

                  R Offline
                  R Offline
                  rjmoses
                  wrote on last edited by
                  #40

                  didi dodidi didi dodidi dodi do do didididi didi dodi dodido dido dodi dodidodo dodido dodi di didodo dodo dododo didodi dididi di dodidodi dododo dodidi di dido dodi dodidodo dodo dododo didodi di (The secret language of ancient hackers.)

                  1 Reply Last reply
                  0
                  • C CodeWraith

                    I mean the low level protocol, not some framework, API or driver. In my ongoing quest to interface modern devices to very old 8 bit computers I have stumbled over this: DEBO USB TTL: Raspberry Pi -USB-TTL-Schnittstellenwandler, CH340G bei reichelt elektronik[^] Not really rocket science. With this I can send and receive bytes from a USB device with a simple UART. This would solve a few problems at once. A simple cheap memory stick would be all the hard disk' an 8 bit computer would ever need. Don't worry about speed. Mass storage is for many reasons a relatively slow affair on 8 bit computers, beginning with their low bandwith on the bus. Remember what Commodore did with the C64's floppy drives? I could also use a USB keyboard or a mouse. So, with that converter and a UART I can now talk to USB devices. Can I also hook up a USB hub to it and access several USB devices over the same UART? How do I select devices? How do I request or send bytes? Some kind of USB protocol with an embedded device specific protocol?

                    I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

                    A Offline
                    A Offline
                    ACRowland
                    wrote on last edited by
                    #41

                    Have you seen Mark of RetroClinic's DataCentre (RetroClinic DataCentre - USB on your Beeb[^]) for the BBC Micro? The DataCentre is discontinued, but I expect he would be willing to discuss any questions you have.
                    I seem to recall that one of the big issues was the Beeb's 16-bit address bus, which meant only accessing a fraction of, say, an SD card's capacity, but I have no idea what the solution was.

                    1 Reply Last reply
                    0
                    • C CodeWraith

                      I mean the low level protocol, not some framework, API or driver. In my ongoing quest to interface modern devices to very old 8 bit computers I have stumbled over this: DEBO USB TTL: Raspberry Pi -USB-TTL-Schnittstellenwandler, CH340G bei reichelt elektronik[^] Not really rocket science. With this I can send and receive bytes from a USB device with a simple UART. This would solve a few problems at once. A simple cheap memory stick would be all the hard disk' an 8 bit computer would ever need. Don't worry about speed. Mass storage is for many reasons a relatively slow affair on 8 bit computers, beginning with their low bandwith on the bus. Remember what Commodore did with the C64's floppy drives? I could also use a USB keyboard or a mouse. So, with that converter and a UART I can now talk to USB devices. Can I also hook up a USB hub to it and access several USB devices over the same UART? How do I select devices? How do I request or send bytes? Some kind of USB protocol with an embedded device specific protocol?

                      I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

                      B Offline
                      B Offline
                      bence98
                      wrote on last edited by
                      #42

                      USB is complicated. Trust me. I would highly discourage you to implement your own. That said, the protocol you're looking for is the USB Mass Storage CDC (Common Device Class). You're probably going to have to toush USB Attached SCSI as well. If you want to do that though, this CH340 won't do, because it is a USB **device** and not a **host**. You'll need something with either a USB ROOT hub (like a RasPi), or USB OTG (I heard some AT90's and PIC16F's are capable of this, but I never found anything like that, so dunno). You also don't "select" devices per se. When a USB device is connected, the USB hub sends you (the ROOT hub) a message. Let's say, it was hub #5. Then you instruct said hub to reset it. This will make the newly attached device assume an address of "5.0". Now, you send a GET DESCRIPTOR followed by a SET ADDRESS to USB address "5.0.0", which is the CONTROL endpoint of the new device. In SET ADDRESS, you give it a permanent address that it can use moving forward. Now, why did I say you don't really "select" devices? Because, even though you *can* address individual devices, *all* attached USB devices will hear the ROOT's messages, and it is up to them to decide whether to activate or not. If you misconfigure a device and cause an address collision, you're screwed. I could go on and on about USB, but I think you get the point: Don't Implement Your Own. For your purposes, I'd use a SD/microSD card instead, as these can be used in SPI transfer mode, which is a cakewalk to implement, as opposed to the pain-in-the-backyard you're gonna have if you try to implement a USB host yourselves. "I don't think about dying. It is the last thing I want to do. :) " - theoldfool

                      C 1 Reply Last reply
                      0
                      • B bence98

                        USB is complicated. Trust me. I would highly discourage you to implement your own. That said, the protocol you're looking for is the USB Mass Storage CDC (Common Device Class). You're probably going to have to toush USB Attached SCSI as well. If you want to do that though, this CH340 won't do, because it is a USB **device** and not a **host**. You'll need something with either a USB ROOT hub (like a RasPi), or USB OTG (I heard some AT90's and PIC16F's are capable of this, but I never found anything like that, so dunno). You also don't "select" devices per se. When a USB device is connected, the USB hub sends you (the ROOT hub) a message. Let's say, it was hub #5. Then you instruct said hub to reset it. This will make the newly attached device assume an address of "5.0". Now, you send a GET DESCRIPTOR followed by a SET ADDRESS to USB address "5.0.0", which is the CONTROL endpoint of the new device. In SET ADDRESS, you give it a permanent address that it can use moving forward. Now, why did I say you don't really "select" devices? Because, even though you *can* address individual devices, *all* attached USB devices will hear the ROOT's messages, and it is up to them to decide whether to activate or not. If you misconfigure a device and cause an address collision, you're screwed. I could go on and on about USB, but I think you get the point: Don't Implement Your Own. For your purposes, I'd use a SD/microSD card instead, as these can be used in SPI transfer mode, which is a cakewalk to implement, as opposed to the pain-in-the-backyard you're gonna have if you try to implement a USB host yourselves. "I don't think about dying. It is the last thing I want to do. :) " - theoldfool

                        C Offline
                        C Offline
                        CodeWraith
                        wrote on last edited by
                        #43

                        Thanks. Upgrading an old computer is not easy and I'm still looking in all directions to see what is reasonable and what is not. Actually I'm not really upgrading it, but restoring it to its original condition and then build a new one with the upgrades. SD in SPI mode is also possible, but the processor has no real SPI port. however, it does have a few microcontrollerish I/O signals. These already are doing triple duty as bit banged RS232, bit banged cassette tape I/O and bit banged sound generation. Back in the day, be even did digital sound recording and playback with them.

                        I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups