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.

[SOLVED] Send data from Matlab to 8051 using proteus simulation.

Status
Not open for further replies.
oh thanks a lot!! Btw how did u send data serially? That code u ran once.?. i ll be typing everytime in command window.So asked. I see you didnt use that serial port emulator?
 

Oh ya max232 output will be inverted.So if i have to send data serially from matlab.Say HELLO from matlab.. Does the max232 connection change? Like T1In should be given to COMPIM txd?..should i have to send ascii values from matlab?...What are the changes
 
Last edited:

No i tried..IF i send from matlab.. i get data only from COMPIM . Not after max232. I am missing Something.. Should i send 0x41 for A in matlab to display the value ?
 
Last edited:

kis.JPG Hey i have sent ABCDE serially from microcontroller. But receiving some unknown characters in hyperterminal.Baudrate,parity,stop bits all are configured properly in hyperterminal as well as COMPIM.. ANd even 8051 has 9600 baudrate..
 

I have attached code.Hyperterminal will be start->prog->accessories--> communciations->Hyperterminal in windows!. Getting wierd characters but data is being sent i guess.Please connect TXD AND RXD pins of compim to the max232 if i left
 

Attachments

  • eda v2.rar
    71.1 KB · Views: 55

Do not use MAX232 in Proteus, in conjunction with the COMPIM. It uses digital ('TTL') levels like the Virtual Terminal, while transforms the phisical port to a virtual port.
 

yes. In proteus only.The hello world is in code itself.that i m sending to hyperterminal.Simulating in proteus
 

That works without max232 .But i want to implement it in real world too.So max232 shud be der rite?,
 

Hi i have written small matlab code
Code:
s = serial('COM4','BaudRate',9600);
 fopen(s);
 fprintf(s,'A');
My circuit in proteus View attachment 87800.. IF i send higood. i got this as output in virtual terminal View attachment 87801. And the keil code for receiving data serially is
Code:
#include<reg51.h>
void sertex(unsigned char);
void main(void)
   {							  unsigned char z;
						   TMOD=0x20;
						   TH1=0xFD;
						   SCON=0x50;
						   TR1=1;
				 		  
						   
			while(1)
{

while(RI==0);
z=SBUF;
P1=z;
RI=0;


}
}
. Please someone tell me whats the fault in circuit or in programme.I need to send data from PC and make sure microcontroller received it properly.Thanku
hi, fprintf instruction send text not binary data check fwrite instruction

- - - Updated - - -

Hi i have written small matlab code
Code:
s = serial('COM4','BaudRate',9600);
 fopen(s);
 fprintf(s,'A');
My circuit in proteus View attachment 87800.. IF i send higood. i got this as output in virtual terminal View attachment 87801. And the keil code for receiving data serially is
Code:
#include<reg51.h>
void sertex(unsigned char);
void main(void)
   {							  unsigned char z;
						   TMOD=0x20;
						   TH1=0xFD;
						   SCON=0x50;
						   TR1=1;
				 		  
						   
			while(1)
{

while(RI==0);
z=SBUF;
P1=z;
RI=0;


}
}
. Please someone tell me whats the fault in circuit or in programme.I need to send data from PC and make sure microcontroller received it properly.Thanku
hi, fprintf instruction send text not binary data check fwrite instruction
 

projec1.JPG This circuit worked!!! I just added two inverters in between max232 and compim!
 
  • Like
Reactions: Crysta_Oman

    Crysta_Oman

    Points: 2
    Helpful Answer Positive Rating
    V

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top