i have to program my pic16f887 to read a temperature from a (AD590) and display the temp on hyper terminal..
i dont even know where to start and if anyone could lend a hand it would be SUPER appreciated!
Thanks
i have to program my pic16f887 to read a temperature from a (AD590) and display the temp on hyper terminal..
i dont even know where to start and if anyone could lend a hand it would be SUPER appreciated!
Thanks
I think a good place to start would be to read the datasheet, for both your components! (the other datasheet)
HomePort : A C Web Service API for heterogeneous home automation systems
1. first write,compile and execute a 'hello world' program that you can run and see the output from hyperterminal. there should be an example of some kind that comes with the pic tools.
2. write a placeholder function 'readTemp' and have it just return a fixed value of the type you want (float,int,whatever). don't worry about the hardware yet. add that to your hello world program and print the value returned from that function instead of 'hello world'.
3. modify the readTemp function to read a hardware register.there has to be an example in the PIC documentation for how to read and write to I/O ports. don't worry about the A/D yet. just determine that you can read and write I/O ports in whatever way is simplest.
4. do what Tibo-88 said. read the data sheets. reading from an A/D usually takes a few steps of writing to output ports and reading input ports. after completing those steps, you will probably get an 8 bit binary number that represents the raw temperature value in whatever scale the chip outputs. a lot of times we call this value 'counts'. each 'count' will represent some temperature value.
5. if necessary, scale the output to what you want (C or F) and return that value from the function so the main program prints it.