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 24LC");
DELAY_MS(1000);
LCD_CLear();
LCD_INIT();
while (TRUE){ 
Lcd_row_col(1,0);   
Lcd_putc("setpoint="); 
value=Read_eeprom_24LCxx(0x01);
hex_bcd(VALUE);
lcd_row_col(1,9);
sent_Lcd();
delay_ms(100);
}
}




READ  Forverse - Reverse Control For Basic PRO Compiler

Leave a Comment

*
= 4 + 0

Read previous post:
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...

Close
Scroll to top