Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

sample source code

Status
Not open for further replies.

Mark1980

New Member
Dear frinds

I want to conect the PIC16c745 to USB flash disk with USB port on PIC
that i can write the file on flash disk and then read this file by PIC or PC
How I can do this?

please introduce to me a sample project with PIC source code

Thanks very much
 
2 things...

1. PIC16C745 should be considered as obsolete, they are really old and useless now. Consider a 18F2550, 18F4550 or anything else in the 18F serie

2. A pic can't host a USB device.
 
Why

Dear Steve

Thank you very much

Yes, they are useless but I can not provide the 18F series.

About section two why the PIC with USB port can not host the USB device we know that both of them have USB port. Would you explain your reason?
 
Hi Mark,

USB is quite complex and supports many different transfer modes. I did a quick scan of the datasheets and I think the USB hardware in those PIC's is limited to supporting slow speed interrupt transfers, and they are designed as endpoint devices only.

To connect to a USB disk you would need to make a USB host, this is quite different from an endpoint device, and it would have to support bulk transfer mode.

Even if you managed to write a cut-down host controller in software you would also need to implement one of several possible mid-level protocols such as SCSI, ATAPI, RBC, UFI etc.. the choice of which one would be dependant on the make model of flash disk you were using as not all flash disks use the same protocol, and some are not even publicly available standards.

Then there is the filesystem to consider. I suspect you want the flash disk to be readable by a PC ? If so you are going to need some code to handle this. e.g a FAT driver.

I've thought about a project like this in passing, seems to be quite a lot of work to do IMO. I don't want to discourage you tho!
 
what you need to use... to reduce pain, is a piece of hardware like that
**broken link removed**

Never use it as now.. but it suppose to do the job.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top