Page 262 - Making PIC Microcontroller Instruments and Controllers
P. 262

260   A DUA! THERiIOI'ETER  IIISTRUiIENI



























                                                  instrument.
                    lffitr!|tdf*   Dual thermometer


                      Analog signal0   PORTApin 0
                      Analog signal  I   PORTA  pin I

                      Analog signal  2   PORIA pin 2
                      Analog signal3   PORTApin  3
                                      PORTA  pin  4  Pin is not for analog  use!  (see  Table 18.2)

                      Analog signal4   PORTApin 5
                      Analog signal 5   PORTE  pin 0

                      Analog  signal 6   PORTE  pin I
                      Andlog signal 7   PORTE  pin 2

                      ff you use the following ADCIN  instruction:
                     tDcrN  5.  var_(rE
                    you will  need to have the signal connected  to pin E0 and the value read will  be placed
                    in variable VAL  UE. The number  (5) in the  instruction is a relerence  to the iifth analog
                    signal  number in these eight  analog input  pins,  totP1NA.5.
                      Since most projects require a liquid crystal display, and we oiten use the lines on
                    PORTE to control the displat  the five lines on PORTA will be the ones  most commonly
                    used as analog inputs.  (Howeve!  all three ljnes on PORTE can also be used as analog
                    inputs  if the LCD conuol tines  are assigned to another  poft with the DEFINES,  or if you
                    are not using  the LCD at all.)
                      As with any  PIc  microprocessor  with analog capabiljties,  the 16F877A  micro-
                    prccessor  comes  up in the analog mode on reset and sfartup.  A number of the analog
   257   258   259   260   261   262   263   264   265   266   267