LDmicro0.2 MICRO=Microchip PIC16F876 28-PDIP or 28-SOIC CYCLE=2000 us at Timer1, YPlcCycleDuty:0, ConfigurationWord(s):0x1F908A3A00003F72 CRYSTAL=20000000 Hz BAUD=9600 Hz, RATE=1000000 Hz, SPEED=400000 Hz COMPILED=\\RASPBERRYPI\Share\SIETESEGMENTOS16F876_LM35M_CA.hex COMPILER= PULL-UP LIST RA: 0xFFFFFFFF RB: 0xFFFFFFFF RC: 0xFFFFFFFF END VAR LIST 1 bytes #POERB Now not used !!! 1 bytes #POETB Now not used !!! 1 bytes #PORTA 1 bytes #PORTB 1 bytes #PORTB2 Now not used !!! 1 bytes #PORTC 1 bytes #PORTD Now not used !!! 1 bytes #TRISA 1 bytes #TRISB 1 bytes #TRISC 1 bytes #TRISD Now not used !!! 1 bytes #TRISE Now not used !!! 1 bytes C1 Now not used !!! 1 bytes C2 Now not used !!! 1 bytes C3 1 bytes CC0 Now not used !!! 1 bytes CC1 Now not used !!! 2 bytes Chour Now not used !!! 2 bytes Cmin Now not used !!! 2 bytes Cnew Now not used !!! 1 bytes Cselect Now not used !!! 2 bytes Denzena2 Now not used !!! 2 bytes Dezena1 Now not used !!! 2 bytes Dezena2 Now not used !!! 2 bytes I2C1 Now not used !!! 2 bytes Min Now not used !!! 2 bytes POERB Now not used !!! 2 bytes POETB Now not used !!! 2 bytes PWM Now not used !!! 1 bytes T0 Now not used !!! 2 bytes T1 Now not used !!! 2 bytes T2 Now not used !!! 2 bytes T3 Now not used !!! 2 bytes T4 Now not used !!! 1 bytes T5 Now not used !!! 1 bytes TT1 Now not used !!! 2 bytes TT2 Now not used !!! 2 bytes TT3 Now not used !!! 2 bytes TT4 Now not used !!! 2 bytes TT5 Now not used !!! 2 bytes TT6 Now not used !!! 1 bytes Tadcf Now not used !!! 2 bytes Tadco 2 bytes Tadcof Now not used !!! 1 bytes Tnew Now not used !!! 1 bytes Tt0 Now not used !!! 1 bytes Tt1 Now not used !!! 1 bytes Tt2 Now not used !!! 2 bytes Unidade1 Now not used !!! 2 bytes Unidade2 Now not used !!! 2 bytes c1 Now not used !!! 2 bytes cels 129 bytes char7seg 1 bytes char7seg[0] 2 bytes dest Now not used !!! 2 bytes duty_cycle Now not used !!! 2 bytes hour Now not used !!! 2 bytes hund 2 bytes index Now not used !!! 2 bytes int Now not used !!! 2 bytes intc 2 bytes min Now not used !!! 2 bytes name Now not used !!! 2 bytes name[0] Now not used !!! 2 bytes pWM Now not used !!! 2 bytes recv Now not used !!! 2 bytes saved Now not used !!! 2 bytes sec Now not used !!! 2 bytes select Now not used !!! 2 bytes send Now not used !!! 2 bytes src Now not used !!! 2 bytes temp Now not used !!! 2 bytes tens 2 bytes tens_temp 2 bytes test Now not used !!! 2 bytes unit END IO LIST Yq0 at 11 0 0 Yq1 at 12 0 0 Atemp at 7 0 0 END PROGRAM RUNG 1 COMMENT Measure temperature with LM35 sensor END RUNG 2 COMMENT -- Rad is 1 cycle high every sec for stable reading END RUNG 3 CONTACTS Rad 1 0 TON Tadco 1000000 0 COIL Rad 0 0 0 0 END RUNG 4 CONTACTS Rad 0 0 READ_ADC Atemp 0 END RUNG 5 PARALLEL MUL intc Atemp 22 DIV cels intc 45 END END RUNG 6 PARALLEL DIV hund cels 100 MOD tens_temp cels 100 DIV tens tens_temp 10 MOD unit tens_temp 10 END END RUNG 7 COMMENT -- #PORTB is output END RUNG 8 MOVE #TRISB 0X00 END RUNG 9 CONTACTS RDIGITO 1 0 COIL RDIGITO 0 0 0 0 END RUNG 10 CONTACTS RDIGITO 0 0 CTC C3 1 0 / END RUNG 11 COMMENT -- q0 is unit and q2 is tens ---> the same name as the BC547 transistors END RUNG 12 EQU C3 0 7SEGMENTS #PORTB tens A COIL Yq1 0 0 0 0 END RUNG 13 EQU C3 1 7SEGMENTS #PORTB unit A COIL Yq0 0 0 0 0 END