Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Read text files from pen drive usb
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
atmega64

Bascom Member



Joined: 23 Feb 2005
Posts: 298
Location: ITALY

italy.gif
PostPosted: Tue Jun 04, 2013 8:58 am    Post subject: Read text files from pen drive usb Reply with quote

Hi,
you may, kindly, give me an example on how to read a text file stored on a USB pen drive?
I can do it with an ATmega8?

thanks

(BASCOM-AVR version : 2.0.7.6 )
Back to top
View user's profile Visit poster's website
atmega64

Bascom Member



Joined: 23 Feb 2005
Posts: 298
Location: ITALY

italy.gif
PostPosted: Tue Jun 04, 2013 11:49 am    Post subject: Reply with quote

I'll explain the application, I need to create:

I have to write and read a 5-digit number on a support to be given to various people ...

I thought about using a smartcard ...

some change to this application that I could find to make my case?

http://www.mcselec.com/index.php?option=com_content&task=view&id=100&Itemid=57
Back to top
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2483
Location: Queensland

australia.gif
PostPosted: Tue Jun 04, 2013 10:27 pm    Post subject: Reply with quote

I note you started two topics almost identical for this.

USB is way too complicated to implement in small AVRs.

See the very long thread about how it can be done: http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=7537

My suggestion would be SD or microSD card and AVR-DOS.

SD card is gross overkill for the storage required, but the cards are cheap, and so are the connectors. You could do the same with a small eeprom, but it would have to be mounted in a holder of some sort, and a matching connector.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2483
Location: Queensland

australia.gif
PostPosted: Tue Jun 04, 2013 10:41 pm    Post subject: Reply with quote

As a further off-the-wall thought. Create a PCB with a matrix of X-Y connections, say about 8 * 8 wires. Provide the AVR with a 16 way connector, 8 pins to each of two ports. Use a different connection matrix on each PCB issued - just solder bridges across some of the junctions. That gives you 256 possible different patterns. Then scan the matrix like a keyboard to recover the connection pattern. Issue one to each person.
_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
StigOE

Bascom Member



Joined: 16 Oct 2007
Posts: 41

norway.gif
PostPosted: Wed Jun 05, 2013 1:25 pm    Post subject: Reply with quote

I didn't quite understand what your need actually is, but if you need to give something to your customers which you can later verify to make sure they are 'genuine', how about Dallas/Maxim 1-wire buttons? They're easy to read and each have a unique serial number.
Back to top
View user's profile
JC

Bascom Member



Joined: 15 Dec 2007
Posts: 586
Location: Cleveland, OH

usa.gif
PostPosted: Wed Jun 05, 2013 5:05 pm    Post subject: Reply with quote

To read a USB thumb drive you need a device that can act as a USB Host.

There are only a couple of AVR's that support USB Host Mode.

See this Thread on AVR Freaks: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=132871

JC
Back to top
View user's profile Visit poster's website
atmega64

Bascom Member



Joined: 23 Feb 2005
Posts: 298
Location: ITALY

italy.gif
PostPosted: Thu Jun 06, 2013 7:25 am    Post subject: Reply with quote

Hi,

@edit by MOD ........

I must, of necessity, use a PenDriveUSB, formatted FAT32 ...

I need to read only 6 numbers ...

Please I need a valid way to follow ...

Thank you.
Back to top
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Thu Jun 06, 2013 7:56 am    Post subject: Reply with quote

@Edit by MOD.....

I believe you expect some pre-made copy/paste code - but that's expected wrong.
Quote:
I must, of necessity, use a PenDriveUSB, formatted FAT32 ...
Please I need a valid way to follow ...

A definite way to get exactly what you want, is to use a Vinculum VNC1L, it implements an USB-host, and that's what's needed to connect an USB-stick to an µC.
The VNC1 can do file-management on the stick, create files, rename, all that stuff.
Create a file with a 6 number file name, or create a file that holds said 6 numbers, maybe encrypted in some way, and you're done.
But no pre-made code there either, and that's the moment where you'd need a clue, read data sheets, implement the protocol, all that sort of stuff.
In two words: forget it.
Back to top
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Thu Jun 06, 2013 9:15 am    Post subject: Reply with quote

In the Italian BASCOM-AVR forum

You got all most same answers as here ,

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
atmega64

Bascom Member



Joined: 23 Feb 2005
Posts: 298
Location: ITALY

italy.gif
PostPosted: Thu Jun 06, 2013 9:44 am    Post subject: Reply with quote

Very good,

I think the VNC1 is a solution to try ...

what do you think of this example?

http://www.mcselec.com/index.php?option=com_content&task=view&id=279&Itemid=57
Back to top
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Thu Jun 06, 2013 10:37 am    Post subject: Reply with quote

atmega64 wrote:
what do you think of this example?
http://www.mcselec.com/index.php?option=com_content&task=view&id=279&Itemid=57

Use it as a start.
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2156

netherlands.gif
PostPosted: Thu Jun 06, 2013 10:45 am    Post subject: Reply with quote

atmega64 wrote:

I have to write and read a 5-digit number on a support to be given to various people ...

What about a dallas (maxim) 1wire button?
It's robust, easy to implant and cheap.


_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2483
Location: Queensland

australia.gif
PostPosted: Thu Jun 06, 2013 11:34 pm    Post subject: Reply with quote

Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil

I have this really bright shiny new shovel, and its really good at digging holes, and I really like it, and lots of other people have them too. But I want to dig a hole 4 miles wide and 6 miles deep, please tell me how to do that !

Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil

In my opinion you are trying to use the wrong tool for the job.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
atmega64

Bascom Member



Joined: 23 Feb 2005
Posts: 298
Location: ITALY

italy.gif
PostPosted: Fri Jun 07, 2013 7:27 am    Post subject: Reply with quote

Quote:
Very good,

I think the VNC1 is a solution to try ...

what do you think of this example?

http://www.mcselec.com/index.php?option=com_content&task=view&id=279&Itemid=57


I will work on VNC1 and let you know ...

PS: Thanks to serious and humble are always managed to reach my goal .... later in life you always meet the professors cock! ... but you just do not consider them! Wink
Back to top
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Fri Jun 07, 2013 8:12 am    Post subject: Reply with quote

atmega64 wrote:
PS: Thanks to serious and humble are always managed to reach my goal ....

To be proactive would also help, there's not always somebody waiting to feed you with pap. And the internet is a great source for such information.
Quote:
later in life you always meet the professors cock! ... but you just do not consider them!

Huh? Is this sentence an ill-mutated result of google translate? LOL
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum