Discussion in "8051 Discussion Forum" started by    Kelvin    Jan 23, 2008.
Wed Jan 23 2008, 03:50 PM
#1
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
#2
No body here to help?
Thu Jan 24 2008, 03:36 PM
#3
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);
fopen(ser)
% while(1)
for i=1:1000
fwrite(ser,4);% asci C
end
fclose(ser);

try this and see.

Thank you
 ajay_bhargavshyam like this.
Tags interfacing matlab serial port
Thu Jan 24 2008, 06:35 PM
#4
thank you swat!
Fri Jan 25 2008, 04:29 AM
#5
thank you swat, i will try it.
Sat Mar 29 2008, 09:06 AM
#6
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);
fopen(s)
fprintf(s,'*IDN?')
while(1)
{
idn = fscanf(s);
}
Sat Mar 29 2008, 09:17 AM
#7
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
#8
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

Information

Powered by e107 Forum System

Conversation

Fri Oct 30 2020, 01:16 AM
Lyle Birnie
I’ve already received plenty of ‘thank you’ messages from those who have purchased FLIIK based on my recommendation. So I strongly suggest you take a look too, it just might be the missing link in your affiliate marketing jigsaw!
Thu Oct 29 2020, 05:50 PM
Antwan Hanton
The inability to drive targeted traffic
Thu Jun 11 2020, 06:27 AM
anudee
sir could please send the code for I2C and wifi interfacing with 8051
scena
Tue May 19 2020, 10:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 07:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 01:39 PM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 10:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 12:55 PM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 05:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 04:58 PM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 100, Members: 0 ...

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

Members: 38215
Newest member: Mirza123