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.
Hi.I am a student at electrical & electronics engineering.My final project is related to this topic.I have a 8051 board that has a serial communication with computer.I have a software that is written on Keil uVision programme and it works properly.My aim is to use Matlab programme instead of using Keil uVision.I tried several times and I saw that Matlab transmits the data to the 8051 board by using serial port but the board doesn't work in spite of receiving the data.I am waiting for you ideas to solve this problem.Thank you for your attention.Bye:))
I think you need to make sure you have set up your baud rate properly in matlab and in your keil program. You can use the set() function in matlab to set the baud rate as well as other parameters like parity, etc. Or you can see the Matlab code that Vincent posted. The parameters you set up in matlab should match the ones you have setup in keil. The matlab script you provided does not do this. Andrew has a good idea of using the Keil Simulator to test this before you try it on the real hardware.
From http://www.keil.com/forum/docs/thread7205.asp "the baudrate values for keil and matlab are the same and equal to 9600." Baud rate is not the only thing: You must have all settings identical including parity, number of bits, etc, etc,... "But when we run the matlab program it gives an error as below warning: a timeout occured before the terminator was reached" OK - just read that literally: "a timeout occurred" - means that it was waiting, and had waited too long, so it gave up. "before the terminator was reached" - it was expecting some sort of "terminator", but didn't see it. So, the possibilities are: 1. The timeout is too quick - you must allow enough time for your 8051 to send whatever it sends. 2. The 8051 didn't send anything 3. The 8051 sent the wrong thing 4. The 8051 did send the right thing, but Matlab either didn't receive it at all, or received it incorrectly 5. The 8051 did send the right thing, and Matlab did receive it, but your Matlab program has a bug and didn't recognise it. etc, etc, etc,... You need to adopt a systematic approach, taking just one step at a time, and identify precisely what is and isn't happening. At the moment, you just have far too many variables in the equation!!