Shop OBEX P1 Docs P2 Docs Learn Events
Stamp and USB — Parallax Forums

Stamp and USB

nv-bobnv-bob Posts: 5
edited 2005-07-11 13:11 in BASIC Stamp
Has anyone ever used a stamp to communicate with a USB device?
I want to save data on a USB memory Stick.

Any help is appreciated.

Bob

Comments

  • John BondJohn Bond Posts: 369
    edited 2005-02-03 13:05
    Hi Bob
    ·
    I would·also like to know how to do this and if it is possible. I have a couple of ideas where large amounts of portable data would be useful and I have responded to this string so that if anyone posts a solution, I will also be notified.
    ·
    I will also share my limited knowledge of USB protocol.
    ·
    I went to a Microchip·presentation on using PICs as slaves on the USB bus (a 3 hour presentation doesn't make me an authority!). It seems that each USB device needs both a manufacturer code and a device code. You would need to find the Flash Ram’s codes.
    ·
    The USB master continuously polls the bus at the minimum speed at station 0 on the bus to determine if any new hardware has been added. The added slave device then responds to the poll and tells the master its code and which station it is on and what speed it operates at. You also have various levels of priority on the bus and various levels of data integrity.
    ·
    After all this, you have all the communications and operational software.
    ·
    This is way beyond my “see input on pin 0, switch output on pin 8” type of programming.
    ·
    Kind Regards for Kwa Dukuza
    ·
    John Bond
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-02-03 14:14
    It turns out the BS2 can easily be a USB 'slave' device, through adding an FTDI serial adapter. It's much much harder to be a USB 'master' device -- the BS2 does not have the resources for this. A USB 'slave' cannot connect to another USB 'slave' without a USB 'master' in the middle.

    A USB memory stick is a USB 'slave' device. So I think you are out of luck.

    There do exist FlashCard interfaces for the BS2, you might try that approach.
  • nv-bobnv-bob Posts: 5
    edited 2005-02-04 00:28
    Thanks for the reply.

    Can you please tell me where I can find more information about the FlashCard interface?· I'll consider using any type of removeable media.

    Thanks

    Bob
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-02-04 00:43
    Bob,

    BiPom sells a board which supports an MMC card and also has a DS1307 real time clock on board: www.bipom.com/periph_boards.shtm. I just got one a couple days ago, but forgot the breadboarding cable. Oh well.

    Dealing with the card should be pretty easy. You just talk SPI to it. They have sample a sample application for it written for the BS2.

    Jim
  • nv-bobnv-bob Posts: 5
    edited 2005-02-04 00:46
    Thanks Jim.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-02-04 08:48
    this is a cheaper no-frills version: www.sparkfun.com , click on breakout boards, its the 6th product down
  • John BondJohn Bond Posts: 369
    edited 2005-02-04 10:21
    Hi Guys

    Thanks again for your advice and assistance. I never cease to be amazed by the collective knowledge of the people reading this forum.

    Kind regards from Kwa Dukuza

    John Bond
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-02-04 15:36
    Paul,

    I'd forgotten about the Sparkfun one. I'd looked at it but decided on the BiPom so that I could focus on the software data reading and writing side initially instead of integrating the hardware. The MMC cards are 3.3 vdc devices so you then add voltage regulating and level shift buffers into the mix. I'll have to do it for myself down the road. But for me it was a walk first, run second affair. (Well, maybe crawl first, walk second.)

    Jim
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-02-04 23:26
    Yeah forgot to mention the 3.3V aspect, heres an interface you could adapt fairly easily to a stamp http://www.captain.at/electronics/pic-mmc/

    Basically the serial out (MISO) is fed directly into the stamp with the stamp input set to TTL (I dunno if you can do this with a stamp, Jim could help you here), but TTL's high voltage is a minimum of 2.0V or a healthy 1.3V margin, CMOS is 2.5V or a .8V margin, both will work, but if your in a noisey electrical environment CMOS might cause problems.

    And the Serial In (MOSI), Serial Clock (SCLK) and Chip Select (CS) use a 1.8k/3.3k resistor voltage divider, you can just tie CS to ground if its the only SPI device your using and save two resistors. Then get a 3.3V fixed regulator to supply power to the card and your all set (well hardware-wize).
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-02-05 04:49
    I hadn't though of the voltage divider option. That's an alternative way around it, although at a higher device count. The 74hc04 is only $0.42 qty 1 at Mouser so I'm not sure if it is worth it to deal with the voltage dividers. OTH, I'm a beginner at this stuff and aren't sure of the other trade-offs involved.

    As I understand the stamp, it is TTL level... period. Anything above 1.6 vdc is considered a logic true. So the actual headroom for a logical true is 1.7 vdc.

    I just did a quick scan through the MMC spec and agree with Paul. It appears that with only one MMC card being dealt with, and using SPI exclusively, the CS line can be tied low. But, again, I emphasize that I am just learning this stuff so I may have missed a subtlety.

    Jim
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-02-05 05:37
    Im doing most of my stuff in smt now, I figure if I have to do some, I can do all (except things which connect to off-board things such as the power jack, headers etc, I don't want operational stresses lifting the traces off the board) with the voltage dividers you can get away with 1/16, 1/20 even 1/32 Watt resistors which gets you down to a 201 package which is .6x.3mm, cant get much smaller than that [noparse]:)[/noparse] and its arround 10 cents for a lot of 10, personally i wont go below a 402 which is 1x.5 mm, not before I make my reflow oven.

    Post Edited (Paul Baker) : 2/5/2005 5:43:12 AM GMT
  • christo1423christo1423 Posts: 19
    edited 2005-07-11 13:11
    Check out USBWIZ I haven't tried it yet but it may just be the solution you need.
Sign In or Register to comment.