473,809 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sending microcontroller data to matlab

8 New Member
I want to send the signal from atmega32 to pc and plot them through matlab. I am sending the signals from microcontroller to pc through RS232 link. Can anybody tell how to go about the coding of atmega32 so that the signals can be plotted through matlab?
Nov 27 '09 #1
5 4800
Banfa
9,065 Recognized Expert Moderator Expert
What signals?

Presumably you are using something like Terminal on the pc to receive the data?

Can matlab deal with ASCII encode values? If so that is probably the easiest way to transfer the data to your PC.
Nov 27 '09 #2
anju1401
8 New Member
The data I am getting from the microcontroller , i want to plot that.I dont know whether matlab can take ascii codes. If I use the hyperterminal to take the data from microcontroller , then how to make a code for that?
Nov 28 '09 #3
Banfa
9,065 Recognized Expert Moderator Expert
Well check the data sheet for the atmega32, it should tell you what values to put into what registers to configure the serial port (it is the USART device) and then transmitting data is normally simply a matter of writing data to the transmit register and waiting for it to be sent before writing the the byte.

It is up to you weather you send binary or ASCII data, most terminals can receive either although probably if you use binary you will want to have the terminal capture the data straight to a file. With ASCII obviously you can read it in the terminal window.

I can't help you with matlab, I have never used it but you are going to have to find out what format it excepts data in before you start implementing.

It took me 10 seconds to google this page that looks like it may have useful information on the subject.
Nov 28 '09 #4
anju1401
8 New Member
Thanks a lot. If I want to plot the data from ADC of microcontroller , then writing the data from the ADC register to the transmitter register will do?
Nov 29 '09 #5
Banfa
9,065 Recognized Expert Moderator Expert
Possibly but then you would need matlab to understand the values that the ADC outputs. If you had to change the micro-controller and therefore the ADC then those values could change for the given input and you matlab program would have to change.

It would be better for the micro-controller to convert the ADC values to some format specified and known to you, then if you have to change the micro-controller you can do so with having to change the matlab program.

So you would be better off doing something like having the micro-controller convert the ADC register value to an actual input voltage and then sending that.
Nov 29 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
14546
by: coder_1024 | last post by:
I'm trying to send a packet of binary data to a UDP server. If I send a text string, it works fine. If I attempt to send binary data, it sends a UDP packet with 0 bytes of data (just the headers). I can see this because I'm running Ethereal and watching the packets. I'm defining the packets as shown below: $text_msg = "Hello, world\r\n"; $binary_msg = chr(0x01).chr(0x02).chr(0x03).chr(0x00).chr(0xA0); $binary_msg_size = 5;
5
6728
by: gof | last post by:
I'm pretty new to C++, and this seemingly simple thing is driving me crazy. I'm trying to write a CGI script to serve images on the fly. CGI requires the content to be sent through standard output, but since cout and printf convert LF line endings to CRLF (I'm on Windows), the resulting image ends up being corrupt. Is there ANY way to get around this? It seems writing CGI scripts in C++ on Windows is pretty much impossible. Here's an...
1
6343
by: JoeB | last post by:
hi, Im trying to send data (raw bytes) to a web server. I cannot figure out how to do it. I need the data to be read by PHP which i have already written. The data must be post data. I also send some variables to the web server, which i can retreive, but the raw data disapears. Here is my sending code (error checking removed):
4
4233
by: Schwarty | last post by:
I hope I posted this to the correct group. If not, please let me know and I will get it posted in the correct section. I have a web application developed in ASP.NET using C# for the code behind. I need to be able to print shipping labels from a web page within this application. The shipping label data is pulled from a 3rd party application and comes in binary format specific for certain brands of label printers. I have a class library...
9
18067
by: thorley | last post by:
Greetings, since there was no reponse to my previous post about an existing FastCGI server in python, I've taken to writing my own. (which of course I'll share--*if* there's something to share ;) My problem now, is that I need to send certain binary data over a socket. That is, I want to make some bytes, and stuff them in a TCP packet, send them down the pipe, and then listen for a response. socket.send, as best I can tell, will only...
1
1102
by: Mike | last post by:
Hi, We are in the process of evaluating a system that would allow us to receive data from third-parties and send data to partner companies. Our infrastructure includes Microsoft Navision, a SQL Server, and .NET 2.0. My idea would be to use web services with XML to fullfil the above requirements, but I have very little experience on web services. My main concerns are flexibility (future changes), performance in sending/retrieving data, and...
1
2890
by: fabrizio.viggiani | last post by:
I need to send a mail message to an SMTP server. The .net framework provides System.Net.Mail namespace to send an email: - Build a System.Net.Mail.MailMessage and send it using SmtpClient The message that I have to send is already in the form of a MIME stream (multipart, attachments and digitally signed), so using the classes of the System.Net.Mail namespace I have to: - parse the MIME - Extract the components - Build a MailMessage...
0
1532
by: sanjaygupta11 | last post by:
I am using httpwebrequest and httpwebresponse objects for sending data to remote appication by post and receiving the response from there. I am using this code in my windows application which will send a request to remote application. --------------------------------------------------------------------------------------------------------------- string lcUrl = "http://localhost/check/WebSite3/Default.aspx"; HttpWebRequest loHttp...
10
5106
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area> <zone>BOXING</zone> <status>Running</status> <job>1000139233</job>
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10635
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7653
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3013
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.