We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hai...i tried to send the letter 'L','S','R' from matlab just opening in command line and typing...
se=serial('COM7'); set(se,'BaudRate',9600); fopen(se); fprintf(se,'%c','L','async'); fclose(se)
in matlab uc(at89c51)...and in response it should change its port settings accordingly... Here is my code...
#include<reg51.h> sbit mlp=P1^0; sbit mln=P1^1; sbit mrp=P1^2; sbit mrn=P1^3; void main(void) { char i; SCON=0x50; // to receive and transmitt serially TMOD=0x20; // timer in mode 2 8 bit auto reload mode TH1=-3; // baud rate 9600 TR1 = 1; while(1) { if(TI==1) TI=0; else if(RI ==1) { i=SBUF; RI=0; } if(i=='S') { mlp=mrp=1; mrn=mln=0; } else if(i=='L') { mlp=mrn=1; mrp=mln=0; } else if(i=='R') { mlp=mrn=0; mrp=mln=1; } else { mlp=mrn=0; mrp=mln=0; } } }
I have my uc connections on bread board...and i dnt knw wat is the Tx,Rx pin in my connector... So what i did was put a 2k Resistor in between so that not to fry the ckt accidentatally in case i changed the pins...the character is not at all being sent...the four pins are in 0 condition...see the ELSE part...in abv prgm... Please help... re soon...please....
The USB-to-serial with logic level output are most definitely not sold in normal computer shops.
It's something like www.ftdichip.com/.../USBTTLSerial.htm
If there is a standard 9-pin RS-232 connector on the cable, then it is not supplying logic levels, and a MAX232, MAX3232 or similar is needed.