Discussion in "8051 Discussion Forum" started by    Kelvin    Jan 23, 2008.
Wed Jan 23 2008, 03:50 PM
Hello everybody, how can i interface a 8051 microcontroller with matlab. I have finished the code at microcontroller side and i have displayed it on PC using Visual basic. But now i want to display it on PC using MATLAB. Can anybody help.
Thu Jan 24 2008, 03:13 PM
No body here to help?
Thu Jan 24 2008, 03:36 PM
hai kevin

u can use the serial port in 8051 to send data serialy. In matlab there is a command to receive your data serialy. The command is

ser= serial('COM1','BaudRate',9600,'DataBits',8);
% while(1)
for i=1:1000
fwrite(ser,4);% asci C

try this and see.

Thank you
 ajay_bhargavshyam like this.
Tags interfacing matlab serial port
Thu Jan 24 2008, 06:35 PM
thank you swat!
Fri Jan 25 2008, 04:29 AM
thank you swat, i will try it.
Sat Mar 29 2008, 09:06 AM
Heres the code which i wrote to get the data from the serial port and to display it. But it shows error in matlab. anybody can debug it.

s= serial('COM1','BaudRate',9600,'DataBits',8);
idn = fscanf(s);
Sat Mar 29 2008, 09:17 AM
what is the exact error? can you please copy and paste it here..
most probably its syntax error coz you are using C codes in matlab. Check swat's code how he has written C codes..

and instead of fscanf try using fread(s,NO_OF_BYTES)
Thu Feb 20 2020, 08:58 AM
With regards to the particular characters sent to the microcontroller, you should assume that this is a MATLAB newsgroup and that I might not know the 8051 assembly language that you are using.
I also do not have the Test and Measurement Toolbox, and as you had not previously mentioned that you were using that, I had no way of guessing it.
If you don't know about the graphics interface, then you had better find out, because the *supported* ways of reading individual keys from a keyboard require using the graphics interface.
When you have finished assuming that we will "just know" things you have failed to mention despite having been asked about them, read these reference pages:
http://www.mathworks.com/help/toolbox/instrument/serial.html .
If you are interested to learn MATLAB course then visit CETPA.

Get Social


Powered by e107 Forum System


Mon Jan 24 2022, 11:41 PM
Horny Shriya
Mon Jan 24 2022, 03:42 AM
Taxi Utrecht Taxibus utrecht Taxi Utrecht is een jonge en dynamische taxicentrale in Utrecht. Wij zijn gespecialiseerd in het aanbieden van op maat gemaakte services op het gebied van taxivervoer in en rondom Utrecht. TaxiBus Utrecht
Sun Jan 23 2022, 04:22 PM
Attractive part of content. I simply stumbled upon your site and in accession capital to say that I acquire actually enjoyed account your blog posts. Anyway I will be subscribing on your feeds and even I success you get right of entry to consistently quickly. https://gkh.dvinaland.ru/forum/user/25793/ http://en.pepeduarte.com/community/profile/monroemallory69/ P1805429 (Zora)
Sun Jan 23 2022, 04:20 PM
I blog often and I really thank you for your information. This great article has really peaked my interest. I will book mark your website and keep checking for new details about once per week. I subscribed to your Feed too. http://agrotrans.5nx.org/viewtopic.php?f=2&t=59222 http://esport-dream-team.eu/index.php?site=shoutbox_content&action=showall Id (Maxie)
Sun Jan 23 2022, 02:13 PM
Hello just wanted to give you a quick heads up and let you know a few of the images aren't loading correctly. I'm not sure why but I think its a linking issue. I've tried it in two different internet browsers and both show the same outcome. https://kramatorsk.iboard.ws/viewtopic.php?id=862 http://logistik.lebedevgroup.com/blog/razdel-1/blog-3/ p2036 (Mikel)



Thu Jun 25 2020, 03:46 PM
Mon Jun 22 2020, 03:03 PM
Tue Jun 16 2020, 05:10 PM
Sat Jun 13 2020, 09:43 PM
Thu May 21 2020, 12:44 PM
Thu May 21 2020, 01:28 AM
Wed May 20 2020, 07:05 PM
Wed May 20 2020, 11:52 AM


Guests: 61, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123