Pic24f04ka201

Thread Starter

adulfo

Joined Feb 10, 2010
6
I have this project using this PIC24F04KA201. I have two inputs coming from two sensors, temp and load cell. I want to acquire the two data via serial port(RS232) to be plotted using MATLAB. This project is all about getting the moisture content of the soil using an oven that is controlled by the MCU, only on and off of the oven. The host computer will send first a command to turn on (and off if the weight becomes constant) the oven via a relay connected to one I/O pins of the MCU. Now, can somebody help me in writing the sequences of the codes, from 2 channel ADC to transmitting and receiving via UART.
 

t06afre

Joined May 11, 2009
5,934
The simplest method will be to send the numbers to Matlab as 16 bits data. Then do all the scaling in Matlab. I often do this kind of work in Labview no problem at at all. Just remember to get the correct byte order (little/big Endian)
 

Thread Starter

adulfo

Joined Feb 10, 2010
6
My problem is in programming the PIC, maybe it is a little bit easy in MATLAB. But thank you for your advice. I will just post my codes later. AU.
 

t06afre

Joined May 11, 2009
5,934
Your CPU is quite powerful and since I guess your samplerate will be relatively low. You will have more than enough time to do both calculations and formatting in your MCU. But one thing you should emphasise on, is the data transfer protocol. This should be made so you can send simple commands to the MCU, like start sampling, stop sampling, and change samplearte as some examples. And also be able to detect error. Like that you miss a byte for some reason.
 
Top