bus

One wire bus (DS1820) Control For CSS Compiler

One wire bus (DS1820) Control For CSS Compiler

#include <16F877A.h> #device adc=8 #FUSES NOWDT,XT //No Watch Dog Timer #use delay(clock=4000000) #include <Shift_595_C.c> // 25.5 C 0.5 to step #include <read_temp.c> void main(){ setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); set_tris_a(0xff); set_tris_b(0x00); value = 0; display(); delay_ms(100); while(true){ read_ds1820(); value = temp; hex_bcd(value*10); sent_data(); delay_ms(100); } }

I2C bus for 24LC16 For CSS Compiler

  #include <16F877.h> #device adc=8 #FUSES NOWDT ,XT #use delay(clock=4000000) #use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3) #INCLUDE “LCD_4BIT.C” #include “I2C_24LCxx.c ” int8 value,setpoint=112; void main(){ setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_psp(PSP_DISABLED); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); set_tris_c(0B10000000); // 1000 0000 PortC set_tris_d(0B00000000); // 0000 0000 Portd is Output lcd_init(); Write_eeprom_24LCxx(0x01,setpoint); lcd_init(); lcd_ROW_COL(1,0); // defind ddram address for put string lcd_putc(” KCHI_MICRO.PIC”); lcd_ROW_COL(2,0); lcd_putc(“READ EEPROM …

I2C bus for 24LC16 For CSS Compiler Continue Reading

One wire bus (DS1820) Control For Basic PRO Compiler

Include “modedefs.bas” @ Device PIC16F877,XT_OSC,WDT_off,PWRT_off,PROTECT_off ,BOD_Off define adc_bits 8 define osc 4 DEFINE LCD_DREG PORTD DEFINE LCD_DBIT 4 DEFINE LCD_RSREG PORTD DEFINE LCD_RSBIT 1 DEFINE LCD_EREG PORTD DEFINE LCD_EBIT 0 low portD.2 trisa = $ff trisb = $00 TRISD = $00 adcon1 = 7 temperature VAR WORD count_remain VAR BYTE count_per_c VAR BYTE sV var …

One wire bus (DS1820) Control For Basic PRO Compiler Continue Reading