I have the equipment needed to make the connections between my atmega32 and my pc. I just don't know how to give data to matlab to design apt PID controller for my device.
Do you use a "pure" ATMega32 or an Arduino with this controller?
The first would still need an interface converter while the Arduino already has one on board.
Provided you've got the Arduino, you'll have to open the corresponding VCOM port to communicate via the serial interface. (About the same applies if you use the "pure" ATMega32 with a USB-to-Serial adapter.)
Hi Sina, U.Dreher offers the best answer using a USB-to-serial. You use the chips USART with the TxD (and RxD pins). See page 147 of the data sheet for how to send Data (after setting up the USART registers). If you want to incorporate the communications into your own board, I would highly recommend one of FTDIs USB ICs. They convert TTL serial communications into a USB input, COM Port or other, and are very simple to use.
Even if it is ATMega, PIC, DSP, etc. What you can do is use the serial communication of the microcontroller (either by hardware using a module or by software using a library), after which you can connect a USB-Serial adapter (such as a FTDI chip based board) that you can find on a electronic store. Then in Matlab there are tools to make serial communication both in code (defining a "serial" object) and in Simulink (with the "Serial Configuration" block to configure the serial port and "Serial receive" or "Serial Send").