cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

 Hi!

   

 

   

I wanted to send a matlab data file (.mat) to the psoc flash periodically via USB. 

   

So i wanted to ask where to start? How would I convert the .mat file to an acceptable transfer file type? 

   

 

   

Regards

   

Masab

0 Likes
Reply
16 Replies
Esteemed Contributor II

For the transmission of data you may use the USBUART on the PSoC side and an emulated serial  interface (COMn:) on the PC-side.

   

Storing data in flash can be done with the emulated EEProm usermodule (latest Creator update!).

   

The question I have is: What do you intend to do with the matlab-file on the PSoC?

   

 

   

Bob

0 Likes
Reply
Honored Contributor II

This just depends on what you want to do with this data file. Since my crystal ball is still in repair and you didn't tell us about your project, I would guess that a CSV file might be the simplest solution.

0 Likes
Reply
Honored Contributor II

Forgot to mention that Matlab can write CSV directly: www.mathworks.com/help/matlab/ref/csvwrite.html

0 Likes
Reply
Esteemed Contributor II

@HLI, what about of creating a CBRC (Crystal Ball Repair Center, I would be in the boat!

   

 

   

Bob

0 Likes
Reply
Honored Contributor II

Sure, as long as I don't need to promise any success with the repairs 🙂 I will only promise that it will be expensive...

0 Likes
Reply
Anonymous
Not applicable

Many thanks for the reply

   

I actually wanted to transmit a large speech signal from a converted matlab data file (about 3Mb in size) onto the PSOC EEPROM, with the data being overwritten to the EEPROM after it gets full (like a runtime acquisition of data using a FIFO). I'm using the CY8C001 kit.

   

i need to send the matlab file from the PSOC to an FPGA.

   

Will i have to write a seperate program on my PC to send this data?

   

Regards

   

Masab

0 Likes
Reply
Honored Contributor II
        Is the streaming in realtime? If yes, there is no need to write to the EEPROM (which not really large). If no - then the memory of the PSoC won't be enough to hold the file.   
Depending on the sample rate of the wave file you can get away witrh not needing a special program on the PC side. Using an UART would give you about 10 kbytes/second transfer rate, using an USBUART gives you at most 100kbytes per second.   
Both can be used with any program on the PC side being able to write to a serial port. For a wav file, I would suggest really generating one from the MatLab file, and then decode it on the PSoC side. Or maybe you extract the pure waveform stuff, and send just this over, in binary form (to save bandwidth).   
Can you explain a little bit more what this project is about?   
0 Likes
Reply
Anonymous
Not applicable

I actually wanted to stream neural signals (stored in my matlab data files) to the PSoC, real time would be better. These signals have been sampled at 20Kb/sec. 

   

I dont have a serial port in my PC, so i wanted to do it using the USB port. 

   

I then have to transmit these stored samples serially from the PSoC to an FPGA, on which the processing will be done. I'm not transmitting the samples directly to the FPGA because the transmission wouldnt remain synchornous.

0 Likes
Reply
Honored Contributor II

A PSoC3 (looking at e.g. CY8C3866AXI-040) as 8kb of RAM, so it will be able to hold about 1/10th of a second worth of data in memory. It has up to 64kb of Flash, this would be up to 3 seconds of data.

   

So we are talking about continous data transfer here. If the PSoC has no other tasks, it would be just work as an USB pridge. In that case, using a specialized one might be better. Lokk at the FT232 chips (and their newer counterparts). Or e.g. the MCP2210 which is a USB-to-SPI bridge (which might make the FPGA part simpler).

0 Likes
Reply
Anonymous
Not applicable
        I would rather recommend using a Cypress EZ-USB FX2LP microcontroller with a dual port RAM chip. the FX2 can easily serve as a hight speed bridge and write data to ram that could be used later by the FPGA.   
0 Likes
Reply
Honored Contributor II

Silly me to forget about the Cypress parts 😞

0 Likes
Reply
Esteemed Contributor

At 20 Kb/s, read  2.5 KB/s, seems like no shortage of ways to do this.

   

Serial one wire could do this 🙂    

   

 

   

USB > PSOC > One wire/SPI/I2C/RS232/RS485/LVDS...........

   

 

   

Regards, Dana.

0 Likes
Reply
Anonymous
Not applicable

 Yes, communication between the PSOC and an FPGA is no problem. 

But i have to do this using the PSOC3 on the CY8C001 kit only. So i only have to write the data to the USB serially, then read it on the PSOC using USBUART functions?

   

Also, does matlab write directly to a USB port?

   

Thanks

0 Likes
Reply
Esteemed Contributor

Yes to both.

   

 

   

This might help.

   

 

   

http://forums.ni.com/t5/Multifunction-DAQ/simultaneous-input-output-USB-Daq-in-Matlab/td-p/681206

   

 

   

Regards, Dana.

0 Likes
Reply
Anonymous
Not applicable

hi,

   

can any one help me, will matlab generate a c code automatically for a psoc embedded core?

0 Likes
Reply
Anonymous
Not applicable

Hi, No matlab does not create a C code for PSoC. You need to use PSoC Creator IDE to write code for PSoC. 

0 Likes
Reply