Great! If you have basic knowledge of C++ then that will do. You will program it in C. I recommend MPLAB because it's free and it provides more debugging tools than any other compiler. An alternative and more powerful platform is Matlab, but do you know how to use this?
For others searching the PIC's specs. it's below:
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en026562If you have windows then use hyperterminal to communicate in whatever baud rate you prefer. (make sure the hyperterminal in windows knows your desired baud rate)
This PIC uses 11 channels at 10-bit resolution. For you to interpret this data you need to convert analog(0-5v) to digital(binary). Since it's binary at 10-bit, that equals 1024 steps or levels of resolution. You can split the 5 volts into 1024 steps and output this to the windows hyperterminal once your ADC (Analog to Digital Converter) has converted the signal.
comments = //
//Your programming should reflect the output hence here are a few lines to get you started:
////////////////////////////////////////////////////////////////////////////////////////start of oscar_data_acquisition.c
#include <16F886.H> //browse and download it online
//Declare your global variables:
#define photo_sensor PIN?? //assign which pin the sensor is outputting data to
#define temp_sensor PIN??
#define ph_sensor PIN??
int photo =0;
int temp =0;
int ph =0;
//standard initiation
#define RS232_XMIT PIN_A1 //Transmission line
#define RS232_RCV PIN_A0 //Receiving line
#use delay(clock=?) //input number of instructions per sec
#use rs232(baud=9600, xmit=RS232_XMIT, rcv=RS232_RCV) //9600 is sort of a standard and is a descent speed.
//Not too high not too low, just right.
main(void) //start of program
{
while(1)
{
do{
//a2d read photo sensor
delay_ms(500); // Use delays for stabilization in the system(normally after you read from an analog sensor)
rprintf("photo sensor:%d\r\n",photo); //displays your sensor data
//a2d read temp sensor
delay_ms(500); // Use delays for stabilization in the system(normally after you read from an analog sensor)
rprintf("temp sensor:%d\r\n",temp); //displays your sensor data
//a2d read ph sensor
delay_ms(500); // Use delays for stabilization in the system(normally after you read from an analog sensor)
rprintf("ph sensor:%d\r\n",ph); //displays your sensor data
}
}
} //end of main
////////////////////////////////////////////////////////////////////////////////////////end
This is something to get you going in the right path. The code is generic to PIC's and the a2d conversion is far more complex than just "//a2d read temp sensor", but do read more into it. Come back to the forum for more questions.
Let us know if you know how to use Matlab.
I could not find specs for your board. Can you please email me the specs at heribertor88 (at) yahoo (dot) com
Thanks and update us of your progress. I wish you luck!
Thanks
Heriberto