hai can any one help me out in giving hints to write a programme for pic and ds1620 temperature sensor to communicate
- posted
19 years ago
hai can any one help me out in giving hints to write a programme for pic and ds1620 temperature sensor to communicate
PIC +DS1620
Look at the third entry
It's already done for you. Code, schematic, everything.
Google is your friend. Chris
I have some DS1620 code on my PIC page:
Look in the projects area for the thermostat.
BAJ
"balu" schreef in bericht news: snipped-for-privacy@g14g2000cwa.googlegroups.com...
petrus bitbyter
hello chris,byron and petrus,, thanx for the info given,, i got almost a clear idea
hai evryone, itz me again, i have written some code to activate ds1620, still it is not working. actually this code doesnt show the temperature readings, but it will just check weather some signal is comming from ds1620. so if any one can spare for 5 mins please have a look and suggest me where the problem is and why iam not able to get the ouput.
/*ds1260.c iam using pic 16f876 which has two 7 segment led displays*/ #include #device 16F876 ICD=TRUE #use delay(clock=4000000) #fuses XT,NOWDT, NOPROTECT, NOPUT, NOBROWNOUT #define led_delay 500 #define digitbit 49 /* for left display LB0 = (8x6)+1 */ #define digitbit1 48 /* for right display RB0 = (8x6)+0 */ #define clk_c0 56 /* portc 0 bit */ #define rst_c1 57 /* portc 1 bit */ #define ip_c5 61 /* portc 5 bit the i/p of ds1620 is been connected to 5th pin of pic*/ #define input 0xff #define output 0x00 #define port_c 0x07 /*#define temp 0x22, i havent defined temp variable it automatically taking 22h for temp, so the below tempmsb has been caluculated like 22*
8+7=183*/ #define tempmsb 183 #define config 0x0c #define valbit 176 /* here the 22 byte 0th bit same as above*/ #define seg7zero 0x3f #define seg7one 0x06 #define rstdelay 5/* write function*/
void write_ds1620(byte adrs) { byte i; int value; for(i=0; i>1; value=adrs&0x01; if(value==0x01) { output_high(ip_c5); } else output_low(ip_c5); output_high(clk_c0); delay_us(1); } delay_us(rstdelay); } void main() { while(1) { byte rawtemp,temp=0x02; int i; int cnt = 0; set_tris_c(0xdc); /*11011100*/ delay_us(rstdelay); output_high(rst_c1); write_ds1620(config); write_ds1620(0x02); write_ds1620(0xee); write_ds1620(0xaa); output_low(rst_c1);
set_tris_c(0x20); /* reading from ds 1620*/ output_high(rst_c1); for(i=0; i
hai evryone, itz me again, i have written some code to activate ds1620, still it is not working. actually this code doesnt show the temperature readings, but it will just check weather some signal is comming from ds1620. so if any one can spare for 5 mins please have a look and suggest me where the problem is and why iam not able to get the ouput.
/*ds1260.c iam using pic 16f876 which has two 7 segment led displays*/ #include #device 16F876 ICD=TRUE #use delay(clock=4000000) #fuses XT,NOWDT, NOPROTECT, NOPUT, NOBROWNOUT #define led_delay 500 #define digitbit 49 /* for left display LB0 = (8x6)+1 */ #define digitbit1 48 /* for right display RB0 = (8x6)+0 */ #define clk_c0 56 /* portc 0 bit */ #define rst_c1 57 /* portc 1 bit */ #define ip_c5 61 /* portc 5 bit the i/p of ds1620 is been connected to 5th pin of pic*/ #define input 0xff #define output 0x00 #define port_c 0x07 /*#define temp 0x22, i havent defined temp variable it automatically taking 22h for temp, so the below tempmsb has been caluculated like 22*
8+7=183*/ #define tempmsb 183 #define config 0x0c #define valbit 176 /* here the 22 byte 0th bit same as above*/ #define seg7zero 0x3f #define seg7one 0x06 #define rstdelay 5/* write function*/
void write_ds1620(byte adrs) { byte i; int value; for(i=0; i>1; value=adrs&0x01; if(value==0x01) { output_high(ip_c5); } else output_low(ip_c5); output_high(clk_c0); delay_us(1); } delay_us(rstdelay); } void main() { while(1) { byte rawtemp,temp=0x02; int i; int cnt = 0; set_tris_c(0xdc); /*11011100*/ delay_us(rstdelay); output_high(rst_c1); write_ds1620(config); write_ds1620(0x02); write_ds1620(0xee); write_ds1620(0xaa); output_low(rst_c1);
set_tris_c(0x20); /* reading from ds 1620*/ output_high(rst_c1); for(i=0; i
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.