Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to transfer data from a PC (via USB) into a Microcontroller RAM

Status
Not open for further replies.

dd10

Newbie level 2
Joined
Jan 22, 2012
Messages
2
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,300
How to transfer data from a PC (via USB) into a Microcontroller's RAM

Hi all! This is my first thread here!!

My question is simple.

I need to transfer the content of a .wav file, which is currently in a PC computer, into the RAM of a PIC24xxx... (16-bit data bus) via USB.

This .wav file is nothing else than a list of 16-bit numbers that represent a sampled audio.

For example:

Data 1: 1010 1011 1110 1000
Data 2: 1110 1101 1100 1010
Data 3: 1010 1001 1010 1001
Data 4: 1100 1101 1000 0001
.
.
.
etc, etc

So I need this group of numbers inside the RAM of the microcontroller (to eventually being able to play it back, as you can imagine).

well, I know that there are microcontrollers that have a built-in USB capability and there are others that don't. Also I know that some people put a converter (USB to UART) to input data into the microcontroller in a (apparently) easier way.

Questions:
1) What do you people recommend me overall?
2) What does a USB transmission consist of? Is it like a RS232 one? (start bit followed by data followed by parity bit followed by stop bit).
3) Have you got anything similar to this implemented at all? Any assembly code or C programs to show me? Any schematics diagram?

Thank you very much indeed.

dd10
 
Last edited:

Welcome to edaboard. :)


dd10 said:
2) What does a USB transmission consist of? Is it like a RS232 one? (start bit followed by data followed by parity bit followed by stop bit).
From the microcontroller side it is exactly the same. For both USB and RS232, serial communication via UART needs to be implemented. You will need a USB to UART driver for this:
http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf

A couple of similar threads with schematics included:
https://www.edaboard.com/threads/229914/
https://www.edaboard.com/threads/193699/


dd10 said:
Any assembly code or C programs to show me?
09.1 UART Setup | Engscope
**broken link removed**


dd10 said:
1) What do you people recommend me overall?
Well that's a decision to be made by you, but following the FT232 option is the most common way. References and resources for this will be easy to find in the web.

Finally Microchip seems to be offering a USB framework. Check this, it might be usable for your case:
**broken link removed**
**broken link removed**

Even though I don't use PIC, I googled for a reference on this framework to give you a starting point:
**broken link removed**

There is also the ready made option. A commercial adapter, on which you have to add only the UART code. You will need a serial cable and the device drivers as well:
USB to Serial Adapter RS-232

Finally let's not forget the USB to serial cables. You will also need the PC drivers for this.
USB to RS232 - USB Converter Cable: Amazon.co.uk: Computers & Accessories


Hope this helps,
Alexandros
 
Last edited:

Thank you very much Alexandros!!!!
The information you gave me is really useful for me.
I have to do some more research and some more questions will certainly arise!!!

Thank you again.

dd10
 
  • Like
Reactions: alexxx

    alexxx

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top