i have written matlab code for sending data to fpga.....
code:
------
1. clc;
2. delete(instrfindall);
3. clear s;
4. s = serial('COM3', 'BauRate',9600, 'DataBits',8);
5. f = open(s);
6. fwrite(s,'1');
7. a = fscanf(s,'%c',s.BytesAvailable);
8. disp(a);
9. fclose(s);
Q) when i run this program it is giving error in the line:7 s.BytesAvailable should be greater than '0' but s.BytesAvailable is zero. my data is present in a text file.
we r representing 's' with com port, baudrate and databits but i didn't mention any data which i wanted to transfer in s..... so how to send data in textfile to that port?
i have a textfile with 1's and 0's' .... each line consist of 63 digits (eg: 101111000010110100010101...... 63rd digit)... now i have to send each digit from pc(1 next 0 next 1 ans so on)....
uart(rx) : uart at fpga
Q) the o/p of uart(rx) is 7 bit representation of each digit (now my first digit is 1 represented by 7 bits as 0000001) but i have to represent in 1 bit (1 should be represented in 1 bit instead of representing 0000001 ).... how to write code for that in vhdl to send a digit(8-bit) from pc to 1 bit in fpga?